pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: buschmann@nidsa.net
To: pgsql-bugs@postgresql.org
Cc: buschmann@nidsa.net
Subject: BUG #14844: Failure/Duplicate key value with ALTER DATABASE set search_path
Date: Fri, 06 Oct 2017 11:04:19 +0000
Message-ID: <20171006110419.14642.67184@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      14844
Logged by:          Hans Buschmann
Email address:      buschmann@nidsa.net
PostgreSQL version: 10.0
Operating system:   Windows x64
Description:        


After pg_dump/pg_restore of individual databases from 9.6.5 to 10.0 I have
to set the search path for each database according to the schemas used (the
searchpath is not restored with pg_restore).

This is done with a cmd like 

ALTER DATABASE cpsdb SET search_path TO public,part1,part2,part3;

In the application I do not handle the search_path, but need access to all
mentioned schemas.

For one database this alter database cmd succeeded, the application works.

For the second database I also entered the command, but the search_path is
not set in the application.

When trying to change or reset the search path the following error occurs
(PG 10.0):

didisdb=# ALTER DATABASE xxxdb SET search_path TO public,xxxo,xxxp;
ERROR:  duplicate key value violates unique constraint
"pg_db_role_setting_databaseid_rol_index"
DETAIL:  Key (setdatabase, setrole)=(19084, 0) already exists.

Even resetting the search_path with 

alter database xxxb set search_path to "$user", public;
ERROR:  duplicate key value violates unique constraint
"pg_db_role_setting_databaseid_rol_index"
DETAIL:  Key (setdatabase, setrole)=(19084, 0) already exists.

produces the same error.
I never experienced duplicate key violations in postgres catalog
relations.

PS: setting the search_path with set in the psql session works, but is not
permanent...

What am I missing here?




-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


view thread (5+ messages)  latest in thread

Message-ID: <20171006110419.14642.67184@wrigleys.postgresql.org>
Permalink:  ../20171006110419.14642.67184@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20171006110419.14642.67184@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: buschmann@nidsa.net
  Subject: Re: BUG #14844: Failure/Duplicate key value with ALTER DATABASE set search_path
  In-Reply-To: <20171006110419.14642.67184@wrigleys.postgresql.org>
  References: <20171006110419.14642.67184@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox