Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Bugs > Re: Feature req...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 4 Topic 3749 of 4088
Post > Topic >>

Re: Feature request

by Eugen.Konkov@[EMAIL PROTECTED] May 5, 2008 at 08:26 PM

There is situation where I check values and if they do not satisfy some 
condition I need to set default.
What is the best way to do that?

----- Original Message ----- 
From: "Pavel Stehule" <pavel.stehule@[EMAIL PROTECTED]
>
To: <Eugen.Konkov@[EMAIL PROTECTED]
>
Cc: <pgsql-bugs@[EMAIL PROTECTED]
>
Sent: Monday, May 05, 2008 8:10 PM
Subject: Re: [BUGS] Feature request


> Hello
>
> 2008/5/5  <Eugen.Konkov@[EMAIL PROTECTED]
>:
>> 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@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
 




 4 Posts in Topic:
Feature request
Eugen.Konkov@[EMAIL PROTE  2008-05-05 19:39:38 
Re: Feature request
pavel.stehule@[EMAIL PROT  2008-05-05 19:10:00 
Re: Feature request
Eugen.Konkov@[EMAIL PROTE  2008-05-05 20:26:38 
Re: Feature request
pavel.stehule@[EMAIL PROT  2008-05-05 21:40:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 12:17:48 CDT 2008.