Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 13E94475D12 for ; Wed, 15 Jan 2003 06:39:04 -0500 (EST) Received: from krogh.officenet.no (unknown [193.212.174.47]) by postgresql.org (Postfix) with ESMTP id 5EA95475C2B for ; Wed, 15 Jan 2003 06:39:03 -0500 (EST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by krogh.officenet.no (Postfix) with ESMTP id 158F5B544B for ; Wed, 15 Jan 2003 06:37:06 -0500 (EST) From: Andreas Joseph Krogh Organization: OfficeNet AS To: pgsql-sql@postgresql.org Subject: index on to_char(created, 'YYYY') doesn't work Date: Wed, 15 Jan 2003 11:37:05 +0000 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200301151137.05697.andreak@officenet.no> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/207 X-Sequence-Number: 11072 -----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= ?=20 Do anyone have an example of such a function? - --=20 Andreas Joseph Krogh There will always be someone who agrees with you but 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=3D =3D3pKN -----END PGP SIGNATURE-----