Re: CTAS not honoring NOT NULL, DEFAULT modifiers
От | Nikhil Sontakke |
---|---|
Тема | Re: CTAS not honoring NOT NULL, DEFAULT modifiers |
Дата | |
Msg-id | i2ja301bfd91004190534v18e8d924r99d8e0c792d7389e@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: CTAS not honoring NOT NULL, DEFAULT modifiers (Magnus Hagander <magnus@hagander.net>) |
Ответы |
Re: CTAS not honoring NOT NULL, DEFAULT modifiers
|
Список | pgsql-hackers |
>> Was wondering what are the standards for CTAS. Oracle seems to honor >> the NOT NULL modifier. This might be a bug if we do not honor >> modifiers in CTAS. > > Given that CREATE TABLE AS creates a table based on the result of a > query, it seems pretty logical that constraints wouldn't be copied > over - they're part of the table, they're not visible in a query > result. > Yeah agreed, it is just a SELECT query afterall. > The documentation pretty clearly says you should use CREATE TABLE LIKE > if you want to copy the constraints over, if you look at the CREATE > TABLE manpage (not on the CREATE TABLE AS though - perhaps a note > should be added there?) > I think the semantics should be pretty ok as is. But I saw another DB honoring the NOT NULL modifiers and hence the wonder if there is something about this in the standards. Regards, Nikhils -- http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: