Re: Using unnest - Mailing list pgsql-general

From Jeff Davis
Subject Re: Using unnest
Date
Msg-id 1248556492.6158.313.camel@jdavis
Whole thread Raw
In response to Re: Using unnest  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: Using unnest
List pgsql-general
On Sat, 2009-07-25 at 22:54 +0200, Thomas Kellerer wrote:
> Do I understand this correctly that by casting it first to text, I effectively create a new array
> the same way I create one, when I supply a literal like '{1,2,3}'::text[]

Similar, but not quite the same. '{1,2,3}'::text[] is actually
constructing from the cstring type using the type input function.
Cstring is not a normal type, it is what things are before they have a
normal type.

So, my strategy will only work if the array type you're trying to cast
to has a cast from text.

There aren't separate input functions for each array type, so it's hard
to make this work without depending on a cast from text. Perhaps someone
else has a better idea, though.

Regards,
    Jeff Davis


pgsql-general by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: where is pg_resetxlog ?
Next
From: Tom Lane
Date:
Subject: Re: where is pg_resetxlog ?