X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 641F4D7226 for ; Thu, 3 Nov 2005 03:50:26 -0400 (AST) 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 49825-08 for ; Thu, 3 Nov 2005 07:50:23 +0000 (GMT) Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by svr1.postgresql.org (Postfix) with ESMTP id 7AA74D7101 for ; Thu, 3 Nov 2005 03:50:24 -0400 (AST) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 16803417E7B; Thu, 3 Nov 2005 07:50:20 +0000 (GMT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 9EDF515EDA; Thu, 3 Nov 2005 07:48:48 +0000 (GMT) Received: from mainbox.archonet.com ([127.0.0.1]) by localhost (mainbox [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 16211-02; Thu, 3 Nov 2005 07:48:46 +0000 (GMT) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 26B4015ED9; Thu, 3 Nov 2005 07:48:46 +0000 (GMT) Message-ID: <4369C0DD.60608@archonet.com> Date: Thu, 03 Nov 2005 07:48:45 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ashok.Agrawal@Sun.COM Cc: pgsql-sql@postgresql.org, tgl@sss.pgh.pa.us Subject: Re: User input in psql References: <43694E71.4080208@Sun.COM> In-Reply-To: <43694E71.4080208@Sun.COM> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.034 required=5 tests=[AWL=0.034] X-Spam-Score: 0.034 X-Spam-Level: X-Archive-Number: 200511/38 X-Sequence-Number: 23290 Ashok Agrawal wrote: > Hi . > > Just wanted to know what is equivalent of "Oracle &" in postgresql. > > select count(*) from table1 where id =&1 where sqlplus plus will > prompt to enter value for 1. I would like to do the same in psql. There isn't an equivalent feature, I'm afraid. There are variables you can use, but no interactive prompting. \set myvar foo SELECT count(*) FROM table1 WHERE id = :foo; -- Richard Huxton Archonet Ltd