Strange DOMAIN behavior
От | David G. Johnston |
---|---|
Тема | Strange DOMAIN behavior |
Дата | |
Msg-id | CAKFQuwYOZQ22qNtPe0m4w047DLhnDati8+Yqhcd6S2SOYL2GDQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Strange DOMAIN behavior (Alex Ignatov <a.ignatov@postgrespro.ru>) |
Ответы |
Re: Strange DOMAIN behavior
|
Список | pgsql-sql |
On Thursday, July 9, 2015, Alex Ignatov <a.ignatov@postgrespro.ru> wrote:
Hello everyone!!!
Got strange DOMAIN behavior in the following plpgsql code:
But i expect that lex = abc!
So default value of DOMAIN type is not set in pgplsql block but:
Is this correct behavior??
If you read the create domain sql command documentation carefully the default clause is only used when inserting into a table that has a column of the domain type that is not explicitly provided a value. Each language deals with domains differently and the behavior you expect is not currently implemented in pl/pgsql. If you want a default inside the procedure you need to declare one explicitly.
David J.
В списке pgsql-sql по дате отправления: