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

Re: BUG #4362: Casts from base types to composite types don't work.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrej Podzimek" <andrej(at)podzimek(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4362: Casts from base types to composite types don't work.
Date: 2008-08-17 15:07:40
Message-ID: 20126.1218985660@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Andrej Podzimek" <andrej(at)podzimek(dot)org> writes:
> select cast (text 'blabla' as pxgt_xid);
> ERROR:  malformed record literal: "blabla"
> DETAIL:  Missing left parenthesis.

Works for me, after fixing the obvious typo in your CREATE CAST command:

regression=# CREATE TYPE pxgt_xid AS (xid bigint, xname text);
CREATE TYPE
regression=# CREATE FUNCTION pxgt_xid(text) RETURNS pxgt_xid AS
$BODY$ select cast ( null as bigint ), $1; $BODY$
LANGUAGE 'sql' IMMUTABLE;
CREATE FUNCTION
regression=# CREATE CAST (text AS pxgt_xid) WITH FUNCTION pxgt_xid(text) AS IMPLICIT;
CREATE CAST
regression=# select cast (text 'blabla' as pxgt_xid);
 pxgt_xid  
-----------
 (,blabla)
(1 row)


			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Alvaro HerreraDate: 2008-08-18 21:56:51
Subject: Re: BUG #4340: SECURITY: Is SSL Doing Anything?
Previous:From: Hiroshi SaitoDate: 2008-08-17 02:44:55
Subject: Re: BUG #4361: ODBC Driver 08030200 Hangs Excel

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