index on to_char(created, 'YYYY') doesn't work

Поиск
Список
Период
Сортировка
От Andreas Joseph Krogh
Тема index on to_char(created, 'YYYY') doesn't work
Дата
Msg-id 200301151137.05697.andreak@officenet.no
обсуждение исходный текст
Ответы Re: index on to_char(created, 'YYYY') doesn't work
Список pgsql-sql
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The following does not work:

create index session_u_idx on session (to_char(created, 'YYYY'));
ERROR:  parser: parse error at or near "'YYYY'" at character 57

Can I make a function to do this and index using the result of that funtion?
Do anyone have an example of such a function?

- --
Andreas Joseph Krogh <andreak@officenet.no>There will always be someone who agrees with youbut is, inexplicably, a
moron.

gpg public_key: http://dev.officenet.no/~andreak/public_key.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+JUfhUopImDh2gfQRAme7AJ4jDB+e97rvEicGrxBniD1ddQ1gZgCfbbGl
azbrt7/+xGJUuLSQC7fF+vQ=
=3pKN
-----END PGP SIGNATURE-----



В списке pgsql-sql по дате отправления:

Предыдущее
От: Achilleus Mantzios
Дата:
Сообщение: Re: Performance of request of type WHERE ... IN ( ... )
Следующее
От: Andreas Joseph Krogh
Дата:
Сообщение: Re: index on to_char(created, 'YYYY') doesn't work