X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 17D64D1D38B for ; Wed, 31 Mar 2004 08:50:54 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 12466-07 for ; Wed, 31 Mar 2004 04:50:44 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id BF0ADD1B467 for ; Wed, 31 Mar 2004 04:50:42 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i2V8ogYn056565 for ; Wed, 31 Mar 2004 08:50:42 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i2V8oN0P056189 for pgsql-sql@postgresql.org; Wed, 31 Mar 2004 08:50:23 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.sql Subject: Re: plpgsql vs. SQL in stored procedures Date: Wed, 31 Mar 2004 03:31:01 -0500 Organization: cbbrowne Computing Inc Lines: 15 Message-ID: References: <20040331000808.7aaedc33@stige.webthatworks.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, linux) Cancel-Lock: sha1:OBl/t3LqSxtL2mR09XxNhaHCNKQ= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/268 X-Sequence-Number: 17367 mail@webthatworks.it (Ivan Sergio Borgonovo) wrote: > Is there a way to declare variables and use IF in plain SQL, not in > plpgsql inside stored procedures? The forthcoming support for recursive queries using a WITH clause might provide, after a fashion, a way to declare variables. As for IF, there is a functional equivalent to it in the form of the SQL standard CASE statement. -- select 'cbbrowne' || '@' || 'ntlug.org'; http://www.ntlug.org/~cbbrowne/linuxxian.html "How should I know if it works? That's what beta testers are for. I only coded it." (Attributed to Linus Torvalds, somewhere in a posting)