| From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
|---|---|
| To: | Alex Ignatov <a(dot)ignatov(at)postgrespro(dot)ru> |
| Cc: | "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org> |
| Subject: | Strange DOMAIN behavior |
| Date: | 2015-07-09 12:49:30 |
| Message-ID: | CAKFQuwYOZQ22qNtPe0m4w047DLhnDati8+Yqhcd6S2SOYL2GDQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
On Thursday, July 9, 2015, Alex Ignatov <a(dot)ignatov(at)postgrespro(dot)ru
<javascript:_e(%7B%7D,'cvml','a(dot)ignatov(at)postgrespro(dot)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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Alex Ignatov | 2015-07-09 14:10:40 | Re: Strange DOMAIN behavior |
| Previous Message | Alex Ignatov | 2015-07-09 10:03:59 | Strange DOMAIN behavior |