Re: BUG #2375: ALTER COLUMN TYPE on composite types - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2375: ALTER COLUMN TYPE on composite types
Date
Msg-id 13727.1144179932@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2375: ALTER COLUMN TYPE on composite types  ("George Barbarosie" <george.barbarosie@gmail.com>)
List pgsql-bugs
"George Barbarosie" <george.barbarosie@gmail.com> writes:
> CREATE TYPE composite AS (
>     label varchar(20),
>     data  varchar(1000) );

> CREATE TYPE composite2 AS (
>     label   varchar(20),
>     data    text );

> CREATE CAST (composite as composite2) WITHOUT FUNCTION AS IMPLICIT;

The above is invalid --- since values of composite types have their type
OID embedded in them, a coercion can't simply be a relabeling.  You've
used your superuser powers to break the system, as is all too easy with
binary casts :-(

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Rick Craft"
Date:
Subject: BUG #2374: Installation Error
Next
From: Euler Taveira de Oliveira
Date:
Subject: Re: NLS vs error processing, again (was Re: Composite Type