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.