Re: simple question about using an empty string building a partial index

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Tom Hartnett <tdhartnett(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: simple question about using an empty string building a partial index
Date: 2011-05-03 06:48:19
Message-ID: 4DBFA533.6080700@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Sam Stearns 2011-05-03 06:53:43 Unable to Insert Row
Previous Message Tom Hartnett 2011-05-03 03:52:04 simple question about using an empty string building a partial index