Search Postgresql Archives

Re: indexing date_part

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff Davis <jdavis-pgsql@xxxxxxxxxxx> 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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux