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

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: 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:14:07
Message-ID: 20080101211407.GB11262@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jan 01, 2008 at 08:11:01PM +0000, Ion wrote:
> Email address: sorry_not_for_spam(at)yahoo(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2008-01-01 21:29:47 Re: BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist
Previous Message Ion 2008-01-01 20:11:01 BUG #3848: function pg_catalog.substring(date, integer, integer) does not exist