Re: [HACKERS] Question about casts

2006-05-18 Thread Tom Lane
Martijn van Oosterhout writes: > Every cast costs space and lookup time. Actually, we could probably have a net time savings here if the text cast cases were hard-wired into parse_coerce.c. The reason is that about 10% of the default entries in pg_cast are "retail" implementations of text-to-or-

Re: [HACKERS] Question about casts

2006-05-18 Thread Tom Lane
Thomas Hallgren <[EMAIL PROTECTED]> writes: > I would have thought that casting into the > string types was something that could be hardwired since the backing > functions are mandatory. This has been proposed before, and seems reasonable to me (as long as the casts are explicit-only), and I thi

Re: [HACKERS] Question about casts

2006-05-18 Thread Thomas Hallgren
Martijn van Oosterhout wrote: On Thu, May 18, 2006 at 05:41:14PM +0200, Thomas Hallgren wrote: 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

Re: [HACKERS] Question about casts

2006-05-18 Thread Martijn van Oosterhout
On Thu, May 18, 2006 at 05:41:14PM +0200, Thomas Hallgren wrote: > 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 var

[HACKERS] Question about casts

2006-05-18 Thread Thomas Hallgren
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","