Re: [HACKERS] string_to_array has to be stable?

2010-07-29 Thread Tom Lane
Jeff Davis pg...@j-davis.com writes: On Wed, 2010-07-28 at 20:25 -0400, Tom Lane wrote: I can't remember offhand whether there are any volatile type output functions, but if there were we'd really need to mark array_to_string() as volatile. That would be unpleasant for performance though.

Re: [HACKERS] string_to_array has to be stable?

2010-07-29 Thread Pavel Stehule
2010/7/29 Tom Lane t...@sss.pgh.pa.us: Jeff Davis pg...@j-davis.com writes: On Wed, 2010-07-28 at 20:25 -0400, Tom Lane wrote: I can't remember offhand whether there are any volatile type output functions, but if there were we'd really need to mark array_to_string() as volatile.  That would

Re: [HACKERS] string_to_array has to be stable?

2010-07-29 Thread Tom Lane
I wrote: BTW, the situation on the input side is a bit different: record_in is volatile because domain_in is, and I think we'd better leave that alone since it's not too hard to believe that a domain might have volatile CHECK expressions. If we had arrays of domains, anyarray_in would have

Re: [HACKERS] string_to_array has to be stable?

2010-07-29 Thread Robert Haas
On Thu, Jul 29, 2010 at 1:00 PM, Tom Lane t...@sss.pgh.pa.us wrote: I wrote: BTW, the situation on the input side is a bit different: record_in is volatile because domain_in is, and I think we'd better leave that alone since it's not too hard to believe that a domain might have volatile CHECK

Re: [HACKERS] string_to_array has to be stable?

2010-07-29 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Thu, Jul 29, 2010 at 1:00 PM, Tom Lane t...@sss.pgh.pa.us wrote: Or we could decide that volatile domain CHECK expressions are un-sensible and just relabel all these input functions as stable, which would make everything consistent.  Thoughts?

Re: [HACKERS] string_to_array has to be stable?

2010-07-29 Thread Robert Haas
On Thu, Jul 29, 2010 at 1:10 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Thu, Jul 29, 2010 at 1:00 PM, Tom Lane t...@sss.pgh.pa.us wrote: Or we could decide that volatile domain CHECK expressions are un-sensible and just relabel all these input functions

Re: [HACKERS] string_to_array has to be stable?

2010-07-28 Thread Jeff Davis
On Tue, 2010-07-20 at 11:31 +0200, Pavel Stehule wrote: Hello I am working on to_array, to_string functions and I am looking on string_to_array function. I am surprised so this function is marked as immutable postgres=# select array_to_string(array[current_date],','); array_to_string

Re: [HACKERS] string_to_array has to be stable?

2010-07-28 Thread Tom Lane
Jeff Davis pg...@j-davis.com writes: On Tue, 2010-07-20 at 11:31 +0200, Pavel Stehule wrote: I am working on to_array, to_string functions and I am looking on string_to_array function. I am surprised so this function is marked as immutable What's wrong with that? current_date is the part

Re: [HACKERS] string_to_array has to be stable?

2010-07-28 Thread Jeff Davis
On Wed, 2010-07-28 at 20:25 -0400, Tom Lane wrote: string_to_array() seems fine to me: it's a predictable transformation from text to text. However, I think that there really is an issue with array_to_string(), because that takes an anyarray and invokes the array element's type output

Re: [HACKERS] string_to_array has to be stable?

2010-07-20 Thread Thom Brown
On 20 July 2010 10:31, Pavel Stehule pavel.steh...@gmail.com wrote: Hello I am working on to_array, to_string functions and I am looking on string_to_array function. I am surprised so this function is marked as immutable postgres=# select array_to_string(array[current_date],',');