Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 00A9E634B88 for ; Wed, 10 Jun 2009 12:13:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 27261-05 for ; Wed, 10 Jun 2009 12:13:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by mail.postgresql.org (Postfix) with ESMTP id 2ED5B6340DF for ; Wed, 10 Jun 2009 12:13:09 -0300 (ADT) Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtp (Exim 4.62) (envelope-from ) id 1MEPUM-0008Uc-Fx; Wed, 10 Jun 2009 09:13:18 -0600 Received: from [208.187.158.94] (helo=[172.16.1.231]) by in02.mta.xmission.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MEPU5-000835-Tt; Wed, 10 Jun 2009 09:13:02 -0600 Message-ID: <4A2FCD82.7000206@gmail.com> Date: Wed, 10 Jun 2009 09:13:06 -0600 From: Rob Sargent User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: pgsql-sql@postgresql.org References: <200906100519.34171.jfabiani@yolo.com> <347.1244643554@sss.pgh.pa.us> In-Reply-To: <347.1244643554@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-XM-SPF: eid=; ; ; mid=; ; ; hst=in02.mta.xmission.com; ; ; ip=208.187.158.94; ; ; frm=robjsargent@gmail.com; ; ; spf=neutral X-SA-Exim-Connect-IP: 208.187.158.94 X-SA-Exim-Rcpt-To: pgsql-sql@postgresql.org, robjsargent@gmail.com X-SA-Exim-Mail-From: robjsargent@gmail.com X-Spam-DCC: XMission; sa04 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;pgsql-sql@postgresql.org X-Spam-Relay-Country: Subject: Re: setting the where clause X-SA-Exim-Version: 4.2.1 (built Thu, 25 Oct 2007 00:26:12 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200906/47 X-Sequence-Number: 32652 Tom Lane wrote: > johnf writes: > >> I'm am programming in python using the Dabo modules. www.dabodev.com if your >> interested. Dabo is a framework that provides an easy way to build desktop >> app's. To clear a data entry form. I have been setting the where clause >> to "where 1=0". This of course retrieves 0 records and my form will display >> nothing. It has been suggested that it might be better to set the where >> clause to a primary key value that does not exist in the table "where PK >> = -9999999". >> > > Whoever said that doesn't know what they're talking about. It's not > faster (because it forces an actual index probe to happen) and it's not > safer (what if one day that PK value exists?). > > I'd personally go with "where false"; why not say what you mean rather > than forcing humans and computers to deduce that the condition is > constant false? > > regards, tom lane > > Of course you would do the world a favour if you wrote a client-side clear-the-screen routine that didn't pester the net and the server un-necessarily.