Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B996D4758C9 for ; Thu, 9 Jan 2003 07:41:27 -0500 (EST) Received: from aldratech.com (unknown [213.154.158.58]) by postgresql.org (Postfix) with ESMTP id 79245474E61 for ; Thu, 9 Jan 2003 07:41:26 -0500 (EST) Received: from rpopescu ([192.168.0.6]) by aldratech.com for with eXtremail; Thu, 9 Jan 2003 15:42:16 +2GMT Message-ID: <00a501c2b7dc$a5c626b0$0600a8c0@rpopescu> From: "Radu-Adrian Popescu" To: References: <008f01c2b7d0$3733fdf0$0600a8c0@rpopescu> <3E1D6362.80701@klaster.net> Subject: Re: SQL function parse error ? Date: Thu, 9 Jan 2003 14:43:02 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/122 X-Sequence-Number: 10987 I'm perfectly aware of the fact that a space solves the issue here. What I'm saying is that it is not natural nor common to take some whitespace into account when parsing, since this is not bash language, nor python, as it shouldn't be ! This is SQL, and people who are using PostgreSql write SQL, not whitespace-sensitive SQL, bash or whatever. And besides, like I have already pointed out, look at php's language parser (behavior, not source) : the statement if(100>$a) is perfectly legal, as it should be. Is there any operator named >$ ? Anyone who has used anything from Mysql to Oracle will get quite annoyed on this one. Hope the people in charge of the parser will get to the bottom of this... ... and please forgive my caustic tone. ===== Radu-Adrian Popescu CSA, DBA, Developer Aldratech Ltd. ----- Original Message ----- From: "Tomasz Myrta" To: "Radu-Adrian Popescu" Cc: Sent: Thursday, January 09, 2003 1:56 PM Subject: Re: [SQL] SQL function parse error ? Radu-Adrian Popescu wrote: > > Take the following for example: > create or replace function testfunc1(int) returns setof test as > ' > select * from test where age>$1; > ' ^^^^^^ > language sql; I didn't find it in documentation, but sql functions are like bash (you forgot about space character): create or replace function testfunc1(int) returns setof test as ' select * from test where age > $1; ' works fine. Postgresql thinks that >$ is an operator instead of > Tomasz Myrta ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org