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

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Corey Horton <chorton1(at)austin(dot)rr(dot)com>, pgsql-sql(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3
Date: 2008-12-14 18:16:03
Message-ID: 26729.1229278563@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-sql
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 any array type, but to be always prepared for the
> input element type to change on-the-fly (since that's exactly what
> would happen when scanning pg_statistic).  Quite a lot of the built-in
> anyarray functions are prepared to do that, but I'm not sure they all
> are.

I went and looked, and found that none of the thirty or so built-in
functions that accept ANYARRAY are coded to make unsafe assumptions
about the input array type remaining the same across calls.  So at least
as of CVS HEAD, it seems safe to relax this back to the way it was
pre-8.3.

I'm still worried about the possibility of extension functions or future
core functions failing to follow this coding rule; but as long as people
are lazy and copy-and-paste from the existing models, it should be okay.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Corey HortonDate: 2008-12-14 19:26:05
Subject: Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3
Previous:From: Robert HaasDate: 2008-12-14 18:06:57
Subject: Re: Sync Rep: First Thoughts on Code

pgsql-sql by date

Next:From: Louis-David MitterrandDate: 2008-12-14 19:22:13
Subject: optimizing a query
Previous:From: Tom LaneDate: 2008-12-14 01:10:09
Subject: Re: array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

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