Thread: Feature request
View Single Post

   
  #2 (permalink)  
Old 05-07-2008, 10:17 AM
Pavel Stehule
 
Posts: n/a
Default Re: Feature request

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

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply With Quote