[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] indexing date_part
From:       Tom Lane <tgl () sss ! pgh ! pa ! us>
Date:       2005-02-28 21:05:11
Message-ID: 26002.1109624711 () sss ! pgh ! pa ! us
[Download RAW message or body]

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

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic