X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8640A5549E for ; Thu, 24 Feb 2005 17:17:37 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18771-10 for ; Thu, 24 Feb 2005 17:17:34 +0000 (GMT) Received: from presinet-main.presinet.com (mail.presinet.com [209.53.156.1]) by svr1.postgresql.org (Postfix) with ESMTP id 9B9F45549A for ; Thu, 24 Feb 2005 17:17:32 +0000 (GMT) Received: from [10.10.1.151] (BRICK [10.10.1.151]) by presinet-main.presinet.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2658.3) id 1VVB7RFQ; Thu, 24 Feb 2005 09:15:54 -0800 Message-ID: <421E0C36.2030103@PresiNET.com> Date: Thu, 24 Feb 2005 09:17:42 -0800 From: Bricklen Anderson User-Agent: Debian Thunderbird 1.0 (X11/20050116) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Steve - DND Cc: pgsql-sql@postgresql.org Subject: Re: Junk queries with variables? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/314 X-Sequence-Number: 20424 Steve - DND wrote: >>I don't know about pgAdmin, but in psql you can use \set: >> >>\set id 1 >>SELECT * FROM foo WHERE id = :id; >> >>\set name '\'Some Name\'' >>SELECT * FROM foo WHERE name = :name; >> > > > Whenever I try the above I get an error at the backslash. Do I need to > create a different language for this? Right now I only have plpgsql > available. > > Thanks, > Steve > \set name text('Some Name') SELECT * FROM foo WHERE name = :name;