| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | mroscio(at)tin(dot)it |
| Cc: | pgsql-bugs(at)postgresql(dot)org |
| Subject: | Re: BUG #14346: CREATE TABLE xxx (LIKE yyy INCLUDING ALL) fails |
| Date: | 2016-09-29 12:59:00 |
| Message-ID: | 4645.1475153940@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
mroscio(at)tin(dot)it writes:
> When yyy has no primary keys, all constraints are duly created on xxx.
> When yyy has a primary key named pk_yyy, a primary key named xxx_pkey is
> created, all other constraints are lost.
Works for me ...
regression=# create table yyy (f1 int constraint pk_yyy primary key, f2 int unique);
CREATE TABLE
regression=# \d yyy
Table "public.yyy"
Column | Type | Modifiers
--------+---------+-----------
f1 | integer | not null
f2 | integer |
Indexes:
"pk_yyy" PRIMARY KEY, btree (f1)
"yyy_f2_key" UNIQUE CONSTRAINT, btree (f2)
regression=# create table xxx (like yyy including all);
CREATE TABLE
regression=# \d xxx
Table "public.xxx"
Column | Type | Modifiers
--------+---------+-----------
f1 | integer | not null
f2 | integer |
Indexes:
"xxx_pkey" PRIMARY KEY, btree (f1)
"xxx_f2_key" UNIQUE CONSTRAINT, btree (f2)
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Geoghegan | 2016-09-29 13:15:47 | Re: BUG #14344: string_agg(DISTINCT ..) crash |
| Previous Message | Peter Geoghegan | 2016-09-29 12:10:04 | Re: BUG #14344: string_agg(DISTINCT ..) crash |