![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 (AT) gmail (DOT) com To: <Eugen.Konkov (AT) aldec (DOT) com Cc: <pgsql-bugs (AT) postgresql (DOT) org Sent: Monday, May 05, 2008 8:10 PM Subject: Re: [BUGS] Feature request Hello 2008/5/5 <Eugen.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 |
#3
| |||
| |||
|
|
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 (AT) gmail (DOT) com To: <Eugen.Konkov (AT) aldec (DOT) com Cc: <pgsql-bugs (AT) postgresql (DOT) org Sent: Monday, May 05, 2008 8:10 PM Subject: Re: [BUGS] Feature request Hello 2008/5/5 <Eugen.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 |
#4
| |||
| |||
|
|
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 (AT) gmail (DOT) com To: <Eugen.Konkov (AT) aldec (DOT) com Cc: <pgsql-bugs (AT) postgresql (DOT) org Sent: Monday, May 05, 2008 8:10 PM Subject: Re: [BUGS] Feature request Hello 2008/5/5 <Eugen.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 |
#5
| |||
| |||
|
|
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 (AT) gmail (DOT) com To: <Eugen.Konkov (AT) aldec (DOT) com Cc: <pgsql-bugs (AT) postgresql (DOT) org Sent: Monday, May 05, 2008 8:10 PM Subject: Re: [BUGS] Feature request Hello 2008/5/5 <Eugen.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 |
#6
| |||
| |||
|
|
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 (AT) gmail (DOT) com To: <Eugen.Konkov (AT) aldec (DOT) com Cc: <pgsql-bugs (AT) postgresql (DOT) org Sent: Monday, May 05, 2008 8:10 PM Subject: Re: [BUGS] Feature request Hello 2008/5/5 <Eugen.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 |
#7
| |||
| |||
|
|
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 (AT) gmail (DOT) com To: <Eugen.Konkov (AT) aldec (DOT) com Cc: <pgsql-bugs (AT) postgresql (DOT) org Sent: Monday, May 05, 2008 8:10 PM Subject: Re: [BUGS] Feature request Hello 2008/5/5 <Eugen.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 |
#8
| |||
| |||
|
|
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 (AT) gmail (DOT) com To: <Eugen.Konkov (AT) aldec (DOT) com Cc: <pgsql-bugs (AT) postgresql (DOT) org Sent: Monday, May 05, 2008 8:10 PM Subject: Re: [BUGS] Feature request Hello 2008/5/5 <Eugen.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 |
#9
| |||
| |||
|
|
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 (AT) gmail (DOT) com To: <Eugen.Konkov (AT) aldec (DOT) com Cc: <pgsql-bugs (AT) postgresql (DOT) org Sent: Monday, May 05, 2008 8:10 PM Subject: Re: [BUGS] Feature request Hello 2008/5/5 <Eugen.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 |
#10
| |||
| |||
|
|
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 (AT) gmail (DOT) com To: <Eugen.Konkov (AT) aldec (DOT) com Cc: <pgsql-bugs (AT) postgresql (DOT) org Sent: Monday, May 05, 2008 8:10 PM Subject: Re: [BUGS] Feature request Hello 2008/5/5 <Eugen.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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |