Question about casts

From: Thomas Hallgren <thomas(at)tada(dot)se>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Question about casts
Date: 2006-05-18 15:41:14
Message-ID: 446C959A.10208@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Just out of curiosity (and most likely, ignorance). Why can't I cast an
array of strings into a string? I.e.

thhal=# select ('{"a","b"}'::varchar[])::varchar;
ERROR: cannot cast type character varying[] to character varying

or a cstring into a varchar, i.e.

thhal=# select array_out('{"a","b"}'::varchar[])::varchar;
ERROR: cannot cast type cstring to character varying

ISTM, the implementation of such casts should be fairly simple and
straight forward and sometimes even useful. Every data type comes with
string coercion routines anyway right?

Regards,
Thomas Hallgren

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-05-18 15:52:59 Re: Question about casts
Previous Message Jonah H. Harris 2006-05-18 15:35:22 Re: Google and the Beta Freeze