Re: [GENERAL] ERROR: functions in index expression must be markedIMMUTABLE - Mailing list pgsql-general

From Sven R. Kunze
Subject Re: [GENERAL] ERROR: functions in index expression must be markedIMMUTABLE
Date
Msg-id f23081c9-a0d1-d913-548c-bfd083f38a11@mail.de
Whole thread Raw
In response to Re: [GENERAL] ERROR: functions in index expression must be markedIMMUTABLE  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: [GENERAL] ERROR: functions in index expression must be markedIMMUTABLE  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On 27.02.2017 18:17, Adrian Klaver wrote:
Yes, but is not about timezone dependency, it is about the other dependencies listed in the second and third points. Namely the datestyle setting and magic strings e.g. 'now'

I am sorry, I still don't understand. to_date and to_timestamp require datestyle settings per se and magic strings don't work.


=# -- required datestyle
=# select to_date('2000-01-01');
ERROR:  function to_date(unknown) does not exist
LINE 1: select to_date('2000-01-01');
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.


=# -- magic strings don't work
=# select to_date('');

ERROR:  invalid value "epoc" for "YYYY"
DETAIL:  Value must be an integer.
=# select to_date('epoch', 'YYYY-MM-DD');
ERROR:  invalid value "epoc" for "YYYY"
DETAIL:  Value must be an integer.
=# select to_date('infinity', 'YYYY-MM-DD');

ERROR:  invalid value "infi" for "YYYY"
DETAIL:  Value must be an integer.
=# select to_date('-infinity', 'YYYY-MM-DD');
ERROR:  invalid value "-inf" for "YYYY"
DETAIL:  Value must be an integer.
=# select to_date('now', 'YYYY-MM-DD');
ERROR:  invalid value "now" for "YYYY"
DETAIL:  Value must be an integer.
=# select to_date('today', 'YYYY-MM-DD');
ERROR:  invalid value "toda" for "YYYY"
DETAIL:  Value must be an integer.
=# select to_date('tomorrow', 'YYYY-MM-DD');
ERROR:  invalid value "tomo" for "YYYY"
DETAIL:  Value must be an integer.
=# select to_date('yesterday', 'YYYY-MM-DD');
ERROR:  invalid value "yest" for "YYYY"
DETAIL:  Value must be an integer.
=# select to_date('allballs', 'YYYY-MM-DD');
ERROR:  invalid value "allb" for "YYYY"
DETAIL:  Value must be an integer.

Regards,
Sven

pgsql-general by date:

Previous
From: Johann Spies
Date:
Subject: [GENERAL] is (not) distinct from
Next
From: Lisandro
Date:
Subject: [GENERAL] Re: GMT FATAL: remaining connection slots are reserved fornon-replication superuser connections, but I'm using pgBouncer forconnection pooling