how can i mark date function like iscachable

Started by eroblesover 16 years ago4 messagesgeneral
Jump to latest
#1erobles
erobles@sensacd.com.mx

erobles wrote:

Show quoted text

Hello there!

i tried to create an functional index like this:

create index estdistfecha on estadist (date(fecha));

but only get the next message:
ERROR: DefineIndex: index function must be marked iscachable.

So, How can i mark the date function iscachable ? :-)

i hope your anwsers, anyway thanks to read this !

#2erobles
erobles@sensacd.com.mx
In reply to: erobles (#1)
Re: how can i mark date function like iscachable

another thing i tried to do was:

create or replace function lafecha(timestamp with time zone) returns date
as 'select date($1);'
language 'SQL'
with iscachable;

But i got the message: ERROR parser: parse error at or near "iscachable";
if avoid "with iscachable" string the fucntion was created succesfully.

erobles wrote:

Show quoted text

erobles wrote:

Hello there!

i tried to create an functional index like this:

create index estdistfecha on estadist (date(fecha));

but only get the next message:
ERROR: DefineIndex: index function must be marked iscachable.

So, How can i mark the date function iscachable ? :-)

i hope your anwsers, anyway thanks to read this !

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: erobles (#2)
Re: how can i mark date function like iscachable

Hello

2009/8/3 erobles <erobles@sensacd.com.mx>:

another thing i tried to do was:

create or replace function lafecha(timestamp with time zone) returns date
as 'select date($1);'
language 'SQL'
with iscachable;

try to use IMMUTABLE

Pavel

Show quoted text

But  i got the message: ERROR parser: parse error at or near "iscachable";
if  avoid   "with iscachable"  string  the fucntion was created succesfully.

erobles wrote:

erobles wrote:

Hello there!

i tried to  create an functional index  like this:

create index estdistfecha on estadist (date(fecha));

but only get the  next message:
ERROR: DefineIndex: index function must be marked iscachable.

So, How can i mark the date function iscachable ? :-)

i hope your anwsers, anyway thanks to read this !

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: erobles (#1)
Re: how can i mark date function like iscachable

erobles <erobles@sensacd.com.mx> writes:

i tried to create an functional index like this:
create index estdistfecha on estadist (date(fecha));

but only get the next message:
ERROR: DefineIndex: index function must be marked iscachable.

Egad, what are you running? That message hasn't been spelled that way
since PG 7.2. Get yourself onto a more modern PG release, before that
one eats your data.

regards, tom lane