Strange DOMAIN behavior - Mailing list pgsql-sql

From David G. Johnston
Subject Strange DOMAIN behavior
Date
Msg-id CAKFQuwYOZQ22qNtPe0m4w047DLhnDati8+Yqhcd6S2SOYL2GDQ@mail.gmail.com
Whole thread Raw
In response to Strange DOMAIN behavior  (Alex Ignatov <a.ignatov@postgrespro.ru>)
Responses Re: Strange DOMAIN behavior
List 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 by date:

Previous
From: Alex Ignatov
Date:
Subject: Strange DOMAIN behavior
Next
From: Alex Ignatov
Date:
Subject: Re: Strange DOMAIN behavior