X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id F11279DC9A8 for ; Wed, 18 Jan 2006 05:18:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97468-06 for ; Wed, 18 Jan 2006 05:18:19 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web54314.mail.yahoo.com (web54314.mail.yahoo.com [206.190.49.124]) by postgresql.org (Postfix) with SMTP id 4084F9DC9E0 for ; Wed, 18 Jan 2006 05:18:14 -0400 (AST) Received: (qmail 83325 invoked by uid 60001); 18 Jan 2006 09:18:15 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=tRpghSHBOM/LVlogJBRvjsXjAsybd8U0eqNBAIERbEtaryUezy/e4JjRjT0+DjWAkDn4MINmsY4vYEImEzubIFaU3oBQDtX9I3Bs+h11dKhI1oXtYjKD0qrX0OBtpYKZMr3buOyYK7ieJXwnitLt/d/hTPnRQEBRRGkvtJKavH8= ; Message-ID: <20060118091815.83323.qmail@web54314.mail.yahoo.com> Received: from [213.91.244.26] by web54314.mail.yahoo.com via HTTP; Wed, 18 Jan 2006 01:18:15 PST Date: Wed, 18 Jan 2006 01:18:15 -0800 (PST) From: Emil Rachovsky Subject: bug with if ... then ... clause in views To: "pgsql-sql@postgresql.org" Cc: "pgsql-general@postgresql.org" MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.366 required=5 tests=[AWL=-0.113, DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.366 X-Spam-Level: X-Archive-Number: 200601/791 X-Sequence-Number: 89736 While trying to create some views I stumbled on some problem with using the if-then clause. Here is a simple example : CREATE OR REPLACE VIEW public.SomeView as select d.id, if (true) then d.DocNumber endif from public.Z_Documents as d; I get the following error : syntax error at or near "then" at character 72 I don't have a clue what is going on here. Any suggestions? Thanks in advance, Emil __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com