Re: Reg: SQL Query for Postgres 8.4.3

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: Srinivas Naik <naik(dot)srinu(at)gmail(dot)com>, Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Reg: SQL Query for Postgres 8.4.3
Date: 2010-05-04 14:16:50
Message-ID: AANLkTikNOq_iGd2DmQOttL7nZuBbwtpu8ZNdAO34NF9y@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 4, 2010 at 10:08 AM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
> fwiw, results for all current postgres versions:
> [ only 9.0beta1 is different ]

It looks like the relevant commits are:

commit 822f2ac5a2ec7c6f10634f62a0b2dc6cc9929759
Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Date: Mon Jan 25 20:55:32 2010 +0000

Add get_bit/set_bit functions for bit strings, paralleling those for bytea,
and implement OVERLAY() for bit strings and bytea.

In passing also convert text OVERLAY() to a true built-in, instead of
relying on a SQL function.

Leonardo F, reviewed by Kevin Grittner

commit 75dea10196c31d98d98c0bafeeb576ae99c09b12
Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Date: Thu Jan 7 19:53:11 2010 +0000

Make bit/varbit substring() treat any negative length as meaning "all the re
of the string". The previous coding treated only -1 that way, and would
produce an invalid result value for other negative values.

We ought to fix it so that 2-parameter bit substring() is a different C
function and the 3-parameter form throws error for negative length, but
that takes a pg_proc change which is impractical in the back branches;
and in any case somebody might be relying on -1 working this way.
So just do this as a back-patchable fix.

I think the OP is probably running a version that doesn't include the
Jan 7 commit, which was effectively undone by the Jan 25 commit for
CVS HEAD. It looks like this was intentional based on spec behavior
of overlay(), but should we consider maintaining the historical
behavior instead?

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2010-05-04 14:24:45 Re: what is good solution for support NULL inside string_to_array function?
Previous Message Erik Rijkers 2010-05-04 14:08:30 Re: Reg: SQL Query for Postgres 8.4.3