Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2009-01-21 Thread Bruce Momjian
FYI, I tested your query in 8.3.X CVS and it worked so this fix will in the next 8.3 minor release. --- Corey Horton wrote: > Is there any known workaround to get this the elements of the > histogram_bounds anyarray in 8.3.

Re: [HACKERS] Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2008-12-14 Thread Corey Horton
Fantastic - I'll just if/else the query based on db version. Thanks! Corey Tom Lane wrote: Corey Horton writes: Is there any known workaround to get this the elements of the histogram_bounds anyarray in 8.3.5. It appears that you could explicitly cast to text and thence to text[]: s

Re: [HACKERS] Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2008-12-14 Thread Tom Lane
Corey Horton writes: > Is there any known workaround to get this the elements of the > histogram_bounds anyarray in 8.3.5. It appears that you could explicitly cast to text and thence to text[]: select array_to_string(histogram_bounds::text::text[], '-') from ... but this might be too ugly for

Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2008-12-14 Thread Corey Horton
Is there any known workaround to get this the elements of the histogram_bounds anyarray in 8.3.5. If not, when might I expect a fix? Just trying to plan our testing/release schedule of rolling out to 8.3 around this problem. Thanks, Corey Tom Lane wrote: I wrote: While we could probabl

Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2008-12-14 Thread Tom Lane
I wrote: > While we could probably revert just enough of the changes to > enforce_generic_type_consistency to allow this case again, I wonder > just how safe that'd really be. It would amount to expecting that > functions that take anyarray but don't take or return anyelement to > not only work on

Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2008-12-13 Thread Tom Lane
Greg Stark writes: > Huh, I didn't realize that ever worked in the past. I thought the way > to do what the op describes was to cast it to text[] or whatever > datatype you from out-of-band knowledge to expect. We don't seem to allow that either ... regression=# select array_to_string(histog

Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2008-12-13 Thread Greg Stark
Huh, I didn't realize that ever worked in the past. I thought the way to do what the op describes was to cast it to text[] or whatever datatype you from out-of-band knowledge to expect. -- Greg On 13 Dec 2008, at 19:38, Tom Lane wrote: Corey Horton writes: I'm trying to use array_to_st

Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2008-12-13 Thread Tom Lane
Corey Horton writes: > I'm trying to use array_to_string on the pg_stats column > histogram_bounds... > test83=# select array_to_string(histogram_bounds::anyarray, '-') from > pg_stats where attname = 'id' and tablename = 'widgets'; > ERROR: argument declared "anyarray" is not an array but type

[SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2008-12-13 Thread Corey Horton
Help! I'm trying to use array_to_string on the pg_stats column histogram_bounds... test83=# select array_to_string(histogram_bounds::anyarray, '-') from pg_stats where attname = 'id' and tablename = 'widgets'; ERROR: argument declared "anyarray" is not an array but type anyarray In 8.1, it

Re: [SQL] array_to_string

2007-06-18 Thread Sabin Coanda
"Tom Lane" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Sabin Coanda" <[EMAIL PROTECTED]> writes: >> I used the function array_to_string, and I found it ignores NULL values, >> e.g. array_to_string( 'ARRAY[1,NULL,3]', ',' ) returns '1,3'. > > Do you have a better idea? > > regar

Re: [SQL] array_to_string

2007-03-27 Thread Richard Huxton
Tom Lane wrote: Richard Huxton writes: Tom Lane wrote: "Sabin Coanda" <[EMAIL PROTECTED]> writes: I used the function array_to_string, and I found it ignores NULL values, e.g. array_to_string( 'ARRAY[1,NULL,3]', ',' ) returns '1,3'. Do you have a better idea? If you're being strict it shou

Re: [SQL] array_to_string

2007-03-27 Thread Tom Lane
Richard Huxton writes: > Tom Lane wrote: >> "Sabin Coanda" <[EMAIL PROTECTED]> writes: >>> I used the function array_to_string, and I found it ignores NULL values, >>> e.g. array_to_string( 'ARRAY[1,NULL,3]', ',' ) returns '1,3'. >> >> Do you have a better idea? > If you're being strict it shou

Re: [SQL] array_to_string

2007-03-27 Thread Richard Huxton
Tom Lane wrote: "Sabin Coanda" <[EMAIL PROTECTED]> writes: I used the function array_to_string, and I found it ignores NULL values, e.g. array_to_string( 'ARRAY[1,NULL,3]', ',' ) returns '1,3'. Do you have a better idea? If you're being strict it should presumably return NULL for the whole

Re: [SQL] array_to_string

2007-03-27 Thread Tom Lane
"Sabin Coanda" <[EMAIL PROTECTED]> writes: > I used the function array_to_string, and I found it ignores NULL values, > e.g. array_to_string( 'ARRAY[1,NULL,3]', ',' ) returns '1,3'. Do you have a better idea? regards, tom lane ---(end of broadcast

[SQL] array_to_string

2007-03-26 Thread Sabin Coanda
Hi there, I used the function array_to_string, and I found it ignores NULL values, e.g. array_to_string( 'ARRAY[1,NULL,3]', ',' ) returns '1,3'. The function documentation doesn't explain this case. So please tell me: is it the normal behavior or a bug ? TIA, Sabin -