| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | gezeala(at)gmail(dot)com |
| Cc: | pgsql-bugs(at)postgresql(dot)org |
| Subject: | Re: BUG #14862: create table with missing sequence bug |
| Date: | 2017-10-19 17:46:33 |
| Message-ID: | 28340.1508435193@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
gezeala(at)gmail(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | mgbii bax | 2017-10-19 18:33:38 | Re: BUG #14862: create table with missing sequence bug |
| Previous Message | gezeala | 2017-10-19 17:04:24 | BUG #14862: create table with missing sequence bug |