Re: indexing date_part - Mailing list pgsql-general

From Tom Lane
Subject Re: indexing date_part
Date
Msg-id 26002.1109624711@sss.pgh.pa.us
Whole thread Raw
In response to Re: indexing date_part  (Jeff Davis <jdavis-pgsql@empires.org>)
List pgsql-general
Jeff Davis <jdavis-pgsql@empires.org> writes:
> In this case you just have a syntax error in your function. You have
> tried to use a single-quoted string inside of a single-quoted string.
> Escape the single quotes by writing "''" instead of "'" inside the
> function definition.

BTW, if you were working in a more recent version of Postgres, you
wouldn't need the wrapper function in the first place.  This works
fine in 7.4 and later:

regression=# create table foo(f1 date);
CREATE TABLE
regression=# create index fooi on foo(date_part('month', f1));
CREATE INDEX
regression=#

            regards, tom lane

pgsql-general by date:

Previous
From: "Markus Wollny"
Date:
Subject: Re: Problems with pgcrypto and special characters
Next
From: Shachar Shemesh
Date:
Subject: Re: Unicode support on Win32