# PostgreSQL error



## balanga (Jun 23, 2016)

I installed PostgreSQL over a month ago as a backend for Drupal 8 and it has been running unobtrusively since, until a couple of days ago when it stopped and now I can't restart it...
	
	



```
$ service postgresql start
pg_ctl: another server might be running; trying to start server anyway
LOG:  unrecognized configuration parameter "dynamic_shared_memory_type" in file "/usr/local/pgsql/data/postgresql.conf" line 132
FATAL:  configuration file "/usr/local/pgsql/data/postgresql.conf" contains errors
pg_ctl: could not start server
Examine the log output.
```

/usr/local/pgsql/data/postgresql.conf line 132:-


```
dynamic_shared_memory_type = posix      # the default is the first option
                                        # supported by the operating system:
                                        #   posix
                                        #   sysv
                                        #   windows
                                        #   mmap
                                        # use none to disable dynamic shared memory
```
This has not been changed since installation a month ago.

Unfortunately I can't locate the log. log destination is set to 'syslog' so am not sure where it gets sent.


----------



## ab2k (Jun 23, 2016)

Hi, you may try to set this parameter to `sysv` or just comment it out and check what will happen, think it's already pre-builded with something.


----------



## balanga (Jun 23, 2016)

It was working with this parameter whe it was installed....

Ive just changed to `sysv` and then `none` and the same error occured.


----------



## ShelLuser (Jun 23, 2016)

Obvious question: is it possible that another copy of PostgeSQL is still running somewhere? Have you checked with both ps and pg_ctl?


----------



## SirDice (Jun 23, 2016)

What version of PostgreSQL (there are several available)? And is it running in a jail or not?


----------



## balanga (Jun 23, 2016)

SirDice said:


> What version of PostgreSQL (there are several available)? And is it running in a jail or not?




```
/usr/local/pgsql/data # postgres --version
postgres (PostgreSQL) 9.3.12
```

And no - not in a jail.


----------



## balanga (Jun 23, 2016)

ShelLuser said:


> Obvious question: is it possible that another copy of PostgeSQL is still running somewhere? Have you checked with both ps and pg_ctl?



Can't see anything...


----------



## ab2k (Jun 23, 2016)

Hi again, make sure you have 1 instance of that variable in your config file and try to comment it out with a `#`. (last time you set it up to `none`).

Small update: can you please post config file.


----------



## balanga (Jun 24, 2016)

I have commented out that line and tried a restart. Now I get this weird error:-


```
pg_ctl: another server might be running; trying to start server anyway
FATAL:  database files are incompatible with server
DETAIL:  The data directory was initialized by PostgreSQL version 9.4, which is not compatible with this version 9.3.12.
pg_ctl: could not start server
Examine the log output.
```

I installed postgresql using `pkg install`.  It took very little setting up and I don't recall changing the config.file.

It worked straight away so  I can't understand this version incompatibility.

I would reinstall, but am worried that I might lose the database I have already created.


----------



## ab2k (Jun 24, 2016)

Well, now everything getting clear, somehow PostreSQL was updated to a new version (9.4). You may deinstall this version and install 9.3.xx, hope that trick will work with your current database files, as PostgreSQL 9.4 don't want to touch it, without it get updated. Or you may try to update database files to a new version and make it work this way.


----------



## balanga (Jun 24, 2016)

Is there some `pkg info` option which will tell me what was installed and when?

I can't imagine how PostgreSQL got updated.


----------



## ShelLuser (Jun 25, 2016)

balanga said:


> Is there some `pkg info` option which will tell me what was installed and when?


pkg-info(8) will tell you. But -f will show you the full information.


----------



## balanga (Dec 6, 2016)

ab2k said:


> Well, now everything getting clear, somehow PostreSQL was updated to a new version (9.4). You may deinstall this version and install 9.3.xx, hope that trick will work with your current database files, as PostgreSQL 9.4 don't want to touch it, without it get updated. Or you may try to update database files to a new version and make it work this way.



I've been unable to sort out these problems because  of lack of access to the server until now, but wondered if upgrading to a later version of PostgreSQL would be one way of getting things fixed...


----------

