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

From Sam Mason
Subject Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist
Date
Msg-id 20080101211407.GB11262@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist  ("Ion" <sorry_not_for_spam@yahoo.fr>)
Responses Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist
List pgsql-bugs
On Tue, Jan 01, 2008 at 08:11:01PM +0000, Ion wrote:
> Email address:      sorry_not_for_spam@yahoo.fr

lets hope Ion is subscribed! :)

> I tested PostgreSQL 8.3 beta4 with tinyerp and I have this problem:
> pg_catalog.substring(date, integer, integer) does not exist

This is most likely a bug in tinyerp. substring has only ever been
defined for string data types and isn't valid for date types at all.

> I have not this problem with postgresql 8.2.5.

Prior to PG 8.3, all types would be silently coerced into TEXT types in
certain cases, leading to all sorts of strangeness.

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.


  Sam

pgsql-bugs by date:

Previous
From: "Ion"
Date:
Subject: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist
Next
From: Tom Lane
Date:
Subject: Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist