Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist
Date
Msg-id 20940.1199222987@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist  (Sam Mason <sam@samason.me.uk>)
Responses Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist
List pgsql-bugs
Sam Mason <sam@samason.me.uk> writes:
> I've just downloaded the source of tinyerp and had a look though and
> this practice seems pretty endemic.  They should really be using
>   to_char(date_exp, 'YYYY-MM')
> instead of
>   substring(date_exp FOR 7)
> in all their queries.

Or at least explicitly casting the date to text.  But your way is
better, since it won't break if the datestyle is something other
than ISO.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Sam Mason
Date:
Subject: Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist
Next
From: Sam Mason
Date:
Subject: Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist