Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B999B1337B47 for ; Tue, 3 May 2011 03:48:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 63636-01 for ; Tue, 3 May 2011 06:48:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id 64FDA133798E for ; Tue, 3 May 2011 03:48:20 -0300 (ADT) Received: from [192.168.10.3] (ASte-Genev-Bois-153-1-24-129.w83-112.abo.wanadoo.fr [83.112.204.129]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id CAA143B909; Tue, 3 May 2011 08:48:19 +0200 (CEST) Message-ID: <4DBFA533.6080700@lelarge.info> Date: Tue, 03 May 2011 08:48:19 +0200 From: Guillaume Lelarge User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110419 Thunderbird/3.1.9 MIME-Version: 1.0 To: Tom Hartnett CC: pgsql-admin@postgresql.org Subject: Re: simple question about using an empty string building a partial index References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201105/14 X-Sequence-Number: 37451 On 05/03/2011 05:52 AM, Tom Hartnett wrote: > can it be done? > > create index my_idx on my_table(col1) where col1=''; > > ERROR: invalid input syntax for integer: "" > > Seems simple enough but I don't know what the trick is. > col1 is an integer, not a string. And you cannot check for empty string in an integer column. -- Guillaume http://www.postgresql.fr http://dalibo.com