Re: BUG #14346: CREATE TABLE xxx (LIKE yyy INCLUDING ALL) fails - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #14346: CREATE TABLE xxx (LIKE yyy INCLUDING ALL) fails
Date
Msg-id 4645.1475153940@sss.pgh.pa.us
Whole thread Raw
In response to BUG #14346: CREATE TABLE xxx (LIKE yyy INCLUDING ALL) fails  (mroscio@tin.it)
Responses Re: BUG #14346: CREATE TABLE xxx (LIKE yyy INCLUDING ALL) fails  ("M. Roscio" <mroscio@tin.it>)
List pgsql-bugs
mroscio@tin.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

pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #14344: string_agg(DISTINCT ..) crash
Next
From: Peter Geoghegan
Date:
Subject: Re: BUG #14344: string_agg(DISTINCT ..) crash