Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist
Date: 2008-01-01 21:29:47
Message-ID: 20940.1199222987@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Sam Mason <sam(at)samason(dot)me(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sam Mason 2008-01-01 21:39:41 Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist
Previous Message Sam Mason 2008-01-01 21:14:07 Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist