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

Re: string_to_array has to be stable?

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: string_to_array has to be stable?
Date: 2010-07-28 23:09:18
Message-ID: 1280358558.31397.2.camel@jdavis-ux.asterdata.local (view raw or flat)
Thread:
Lists: pgsql-hackers
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
> -----------------
>  2010-07-20
> (1 row)
> 
> postgres=# set datestyle to German ;
> SET
> postgres=# select array_to_string(array[current_date],',');
>  array_to_string
> -----------------
>  20.07.2010
> (1 row)
> 

What's wrong with that? "current_date" is the part that's changing, and
it's being passed as an argument to the function. If the argument
changes, an immutable function can return a different result.

Regards,
	Jeff Davis


In response to

Responses

pgsql-hackers by date

Next:From: Daniel FarinaDate: 2010-07-28 23:22:04
Subject: Re: documentation for committing with git
Previous:From: Robert HaasDate: 2010-07-28 22:58:38
Subject: Re: do we need to postpone beta4?

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