CREATE TABLE ... LIKE composite type

Поиск
Список
Период
Сортировка
Искать

CREATE TABLE ... LIKE composite type

От:
Mark Gibson <gibsonm@cromwell.co.uk>
Дата:
Hi,   Is there any reason that the following shouldn't work:

CREATE TABLE my_new_table (LIKE my_composite_type);

I get the following error (in 7.4.2):

ERROR:  "my_composite_type" is a composite type

With the improved handling of composite types,
will this work in 7.5?

Cheers
-- 
Mark Gibson 
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.

Re: CREATE TABLE ... LIKE composite type

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Mark Gibson  writes:
> Is there any reason that the following shouldn't work:

> CREATE TABLE my_new_table (LIKE my_composite_type);

Probably not.  I can think of reasons why we might not want to let you
INHERIT from a composite type, but LIKE is just a one-time copy-the-
row-descriptor thing, so it doesn't seem like there should be a problem.

Most likely this is happening because LIKE and INHERITS share a lot of
code.  Anyone feel like looking into it?  (I'm not gonna, have too much
else to do...)
		regards, tom lane

FAQ