Skip site navigation (1) Skip section navigation (2)

Re: Bug

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Thiago Braga Nobre <thiagobraganobre(at)gmail(dot)com>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-docs(at)postgresql(dot)org
Subject: Re: Bug
Date: 2012-01-27 17:30:08
Message-ID: CA+TgmoaH8-AcXAVOAE7F_sOiebFRMufw2wAFFfwiPOU98FzKww@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-docs
On Tue, Jan 3, 2012 at 7:40 PM, Thiago Braga Nobre
<thiagobraganobre(at)gmail(dot)com> wrote:
> A practical example is the scheme substring (text, integer, integer), if
> I step substring (row ['name'], start, end) but for some reason they start
> and end string causes an exception, thesubstring function should not perform
> the conversion from string to integer?

Eh... maybe the other way around?

It has long bothered me that, beginning in 8.3, we can't figure out
that substring(123456, 2, 2) isn't intended to cast 123456 to text.
There just aren't that many other sensible things for that to mean.
It's not exactly clear what to do about it, though, since as far as
the backend knows we could have intended to call substring(bit,
integer, integer) or substring(bytea, integer, integer) rather than
substring(text, integer, integer).  How do we make a principled
decision to prefer text?  I don't know, but I wish we had a way.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

  • Re: Bug at 2012-01-04 00:40:18 from Thiago Braga Nobre

Responses

  • Re: Bug at 2012-01-29 10:12:24 from Thiago Braga Nobre

pgsql-docs by date

Next:From: Robert HaasDate: 2012-01-27 17:43:35
Subject: Re: docs update for count(*) and index-only scans
Previous:From: Robert HaasDate: 2012-01-27 17:19:44
Subject: Re: Cannot build docs on Ubuntu 10.04?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group