Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-06-03 Thread Bruce Momjian
Bruce Momjian wrote: > Robert Haas wrote: > > On Mon, May 31, 2010 at 10:11 AM, Bruce Momjian wrote: > > > Robert Haas wrote: > > >> On Sat, May 29, 2010 at 5:00 PM, Bruce Momjian wrote: > > >> > I have updated the patch, attached, to clarify that this returns text > > >> > arrays, and that you c

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-06-01 Thread Bruce Momjian
Robert Haas wrote: > On Mon, May 31, 2010 at 10:11 AM, Bruce Momjian wrote: > > Robert Haas wrote: > >> On Sat, May 29, 2010 at 5:00 PM, Bruce Momjian wrote: > >> > I have updated the patch, attached, to clarify that this returns text > >> > arrays, and that you can force it to always return one

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-06-01 Thread Bruce Momjian
Tom Lane wrote: > Robert Haas writes: > > But actually here's an even simpler workaround, which is IMHO less > > ugly than the original one: > > > SELECT foo, bar, (SELECT regexp_matches(bar, pattern)) FROM table; > > Doesn't that blow up if the subselect returns more than one row? > > I think

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-06-01 Thread Tom Lane
Robert Haas writes: > But actually here's an even simpler workaround, which is IMHO less > ugly than the original one: > SELECT foo, bar, (SELECT regexp_matches(bar, pattern)) FROM table; Doesn't that blow up if the subselect returns more than one row? I think you could make it work by wrapping

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-06-01 Thread Robert Haas
On Mon, May 31, 2010 at 10:11 AM, Bruce Momjian wrote: > Robert Haas wrote: >> On Sat, May 29, 2010 at 5:00 PM, Bruce Momjian wrote: >> > I have updated the patch, attached, to clarify that this returns text >> > arrays, and that you can force it to always return one row using >> > COALESCE() and

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-05-31 Thread Bruce Momjian
Daniele Varrazzo wrote: > On Sun, May 30, 2010 at 4:45 AM, Robert Haas wrote: > > On Sat, May 29, 2010 at 5:00 PM, Bruce Momjian wrote: > >> I have updated the patch, attached, to clarify that this returns text > >> arrays, and that you can force it to always return one row using > >> COALESCE()

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-05-31 Thread Bruce Momjian
Robert Haas wrote: > On Sat, May 29, 2010 at 5:00 PM, Bruce Momjian wrote: > > I have updated the patch, attached, to clarify that this returns text > > arrays, and that you can force it to always return one row using > > COALESCE() and a '|' pattern (the later suggested by Daniele Varrazzo). > >

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-05-30 Thread Daniele Varrazzo
On Sun, May 30, 2010 at 4:45 AM, Robert Haas wrote: > On Sat, May 29, 2010 at 5:00 PM, Bruce Momjian wrote: >> I have updated the patch, attached, to clarify that this returns text >> arrays, and that you can force it to always return one row using >> COALESCE() and a '|' pattern (the later sugge

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-05-29 Thread Robert Haas
On Sat, May 29, 2010 at 5:00 PM, Bruce Momjian wrote: > I have updated the patch, attached, to clarify that this returns text > arrays, and that you can force it to always return one row using > COALESCE() and a '|' pattern (the later suggested by Daniele Varrazzo). I don't find this part to be s

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-05-29 Thread Bruce Momjian
I have updated the patch, attached, to clarify that this returns text arrays, and that you can force it to always return one row using COALESCE() and a '|' pattern (the later suggested by Daniele Varrazzo). --- Bruce Momjian

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-05-28 Thread Bruce Momjian
Daniele Varrazzo wrote: > "If there is no match to the pattern, the function returns no rows" is > easily overlooked as "it returns null", or some other behaviour that > don't change the returned set. The point is, because the function is > listed in the string function, you would expect the functi

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-05-26 Thread Robert Haas
On Wed, May 26, 2010 at 7:58 AM, Daniele Varrazzo wrote: >> I'm not sure that it's very productive to refer to the behavior of our >> code as insane.  We do document this in section 9.7.3, pretty >> explicitly: >> >> "The regexp_matches function returns all of the captured substrings >> resulting

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-05-26 Thread Daniele Varrazzo
On Wed, May 26, 2010 at 4:51 AM, Robert Haas wrote: > On Mon, May 24, 2010 at 9:16 AM, Daniele Varrazzo > wrote: >> regexp_matches() has been recently discussed >> (http://archives.postgresql.org/pgsql-bugs/2010-04/msg00026.php): it is a >> setof function and as such it can drop results. >> >> Un

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-05-25 Thread Mark Kirkwood
On 26/05/10 15:51, Robert Haas wrote: I'm not sure that it's very productive to refer to the behavior of our code as insane. Not meaning to single you out Robert, but typically folk are honest with their impression of the code without worrying about feather ruffling too much e.g: searchi

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-05-25 Thread Robert Haas
On Mon, May 24, 2010 at 9:16 AM, Daniele Varrazzo wrote: > regexp_matches() has been recently discussed > (http://archives.postgresql.org/pgsql-bugs/2010-04/msg00026.php): it is a > setof function and as such it can drop results. > > Unfortunately it is an useful function to newcomers who use SQL,

[BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-05-24 Thread Daniele Varrazzo
The following bug has been logged online: Bug reference: 5469 Logged by: Daniele Varrazzo Email address: daniele.varra...@gmail.com PostgreSQL version: 8.4 Operating system: any Description:regexp_matches() has poor behaviour and more poor documentation Details: reg