Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pg_restore: [archiver (db)] SET row_security = off

Tags:

postgresql

I just installed a new postgresql 9.5 server on Windows

I have an error message when I'm trying to restore the DB.

pg_restore: [archiver (db)] Error while INITIALIZING: pg_restore: [archiver (db)] could not execute query: ERROR: unrecognized configuration parameter "row_security" Command was: SET row_security = off;

What causes this?

like image 638
Nick Kahn Avatar asked May 02 '16 15:05

Nick Kahn


2 Answers

The row_security configuration setting is new in 9.5, and that error indicates that you're restoring a database dump taken from a 9.5 database into an older version of PostgreSQL.

That combination is not supported, as new features can't work with old servers.

When developping on a local database and deploying to a remote database, development should happen on the same major version as the remote.
Up to version 10, Postgres uses an X.Y.Z convention, where X.Y is the major version, and Z a minor revision that adds only bugfixes to X.Y.
Starting with version 10, it's X.Z where X is the major version and Z the revision number.

like image 122
Daniel Vérité Avatar answered Oct 22 '22 12:10

Daniel Vérité


I was using pgAdmin3 from a new MS 10 desktop to edit a server running Postgres 9.3. The pgAdmin3 v1.22.1 produces this 'row security error'. I reinstalled the pgAdmin3 as v1.20.2 and the error no longer appeared.

like image 26
Elise Smith Avatar answered Oct 22 '22 13:10

Elise Smith