Re: Feature request

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: Eugen(dot)Konkov(at)aldec(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Feature request
Date: 2008-05-05 17:10:00
Message-ID: 162867790805051010o1ab6b981wff1529517680e4f2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello

2008/5/5 <Eugen(dot)Konkov(at)aldec(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Eugen.Konkov 2008-05-05 17:26:38 Re: Feature request
Previous Message Eugen.Konkov 2008-05-05 16:39:38 Feature request