Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1IgD-0002pf-DB for pgsql-bugs@arkaria.postgresql.org; Wed, 17 Dec 2014 17:46:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y1IgC-0004CD-TB for pgsql-bugs@arkaria.postgresql.org; Wed, 17 Dec 2014 17:46:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y1IgC-0004C7-5D for pgsql-bugs@postgresql.org; Wed, 17 Dec 2014 17:46:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y1Ig8-0005Rl-Mk for pgsql-bugs@postgresql.org; Wed, 17 Dec 2014 17:46:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sBHHkNiC004095; Wed, 17 Dec 2014 12:46:23 -0500 From: Tom Lane To: fcs1@poczta.onet.pl cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12259: Bug in restore Serial definition In-reply-to: <20141217125117.1322.75705@wrigleys.postgresql.org> References: <20141217125117.1322.75705@wrigleys.postgresql.org> Comments: In-reply-to fcs1@poczta.onet.pl message dated "Wed, 17 Dec 2014 12:51:17 +0000" Date: Wed, 17 Dec 2014 12:46:23 -0500 Message-ID: <4094.1418838383@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org fcs1@poczta.onet.pl writes: > I have two schemas: public and blob01. > In blob01 schema I have only one table "blob" with primary index ID defined > as > nextval('blob01.osr_blob_id_seq'::regclass) > After restoring by PG_restore the definition is changed to > nextval('osr_blob_id_seq'::regclass), the schema definition is dropped. > Due to this the sequence is not accessible because it is in blob01 schema, > not in public schema. This report doesn't prove there's anything wrong. A regclass constant is not ordinarily displayed with a schema unless the target object wouldn't be found in the current search path. For example: regression=# create schema blob01; CREATE SCHEMA regression=# create sequence blob01.osr_blob_id_seq; CREATE SEQUENCE regression=# create table blob01.blob(f1 int default nextval('blob01.osr_blob_id_seq')); CREATE TABLE regression=# \d blob01.blob Table "blob01.blob" Column | Type | Modifiers --------+---------+----------------------------------------------------- f1 | integer | default nextval('blob01.osr_blob_id_seq'::regclass) regression=# set search_path = blob01; SET regression=# \d blob01.blob Table "blob01.blob" Column | Type | Modifiers --------+---------+---------------------------------------------- f1 | integer | default nextval('osr_blob_id_seq'::regclass) When I pg_dump this, I get output like SET search_path = blob01, pg_catalog; -- -- Name: osr_blob_id_seq; Type: SEQUENCE; Schema: blob01; Owner: postgres -- CREATE SEQUENCE osr_blob_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE osr_blob_id_seq OWNER TO postgres; -- -- Name: blob; Type: TABLE; Schema: blob01; Owner: postgres; Tablespace: -- CREATE TABLE blob ( f1 integer DEFAULT nextval('osr_blob_id_seq'::regclass) ); ALTER TABLE blob OWNER TO postgres; which will work just fine because of the search_path setting. There may indeed be some bug in this vicinity, but you'll need to provide a complete self-contained test case to prove it. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs