Re: Feature request - Mailing list pgsql-bugs

From Pavel Stehule
Subject Re: Feature request
Date
Msg-id 162867790805051010o1ab6b981wff1529517680e4f2@mail.gmail.com
Whole thread Raw
In response to Feature request  (<Eugen.Konkov@aldec.com>)
List pgsql-bugs
Hello

2008/5/5  <Eugen.Konkov@aldec.com>:
> So why I can do:
> insert into (id) values ( default )
> and can not do in my trigger:
> new.id = default
> Why?

it's not possible - because you cannot mix PL/pgSQL statement
(assignment) and SQL stetement.

syntax of assignment
:
variable := expression

expression is independent on variable, so there are not any "default"
expression. PL/pgSQL and SQL are independent environments. If you need
default values, simply don't change field.

Regards
Pavel Stehule

pgsql-bugs by date:

Previous
From:
Date:
Subject: Feature request
Next
From:
Date:
Subject: Re: Feature request