Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5Eu8-0004jo-Fh for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Oct 2017 17:46:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e5Eu7-00048o-Rv for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Oct 2017 17:46:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e5Eu7-00048T-D4 for pgsql-bugs@postgresql.org; Thu, 19 Oct 2017 17:46:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e5Etw-0007EC-LF for pgsql-bugs@postgresql.org; Thu, 19 Oct 2017 17:46:46 +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 v9JHkXFw028341; Thu, 19 Oct 2017 13:46:33 -0400 From: Tom Lane To: gezeala@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14862: create table with missing sequence bug In-reply-to: <20171019170424.1471.41843@wrigleys.postgresql.org> References: <20171019170424.1471.41843@wrigleys.postgresql.org> Comments: In-reply-to gezeala@gmail.com message dated "Thu, 19 Oct 2017 17:04:24 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28339.1508435193.1@sss.pgh.pa.us> Date: Thu, 19 Oct 2017 13:46:33 -0400 Message-ID: <28340.1508435193@sss.pgh.pa.us> 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 gezeala@gmail.com writes: > --on a fresh db: > CREATE SCHEMA testschema; > --sequence is missing > --create table fails: > CREATE TABLE testschema.sometable1 ( > col1 bigint DEFAULT > nextval('missingschema.missingsequence_id1'::regclass) NOT NULL, > col2 text > ); > --sequence is missing > --create table works fine: > CREATE TABLE testschema.sometable2 ( > col1 bigint DEFAULT > nextval(('missingschema.missingsequence_id2'::text)::regclass) NOT NULL, > col2 text > ); > Only difference is sometable2 sequence definition has ::text::regclass. This looks like the expected and documented behavior to me. See the "Note" regarding early vs. late binding of sequence names at https://www.postgresql.org/docs/current/static/functions-sequence.html 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