Re: BUG #2375: ALTER COLUMN TYPE on composite types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "George Barbarosie" <george(dot)barbarosie(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2375: ALTER COLUMN TYPE on composite types
Date: 2006-04-04 19:45:32
Message-ID: 13727.1144179932@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"George Barbarosie" <george(dot)barbarosie(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Euler Taveira de Oliveira 2006-04-05 02:10:35 Re: NLS vs error processing, again (was Re: Composite Type
Previous Message Tom Lane 2006-04-04 14:41:13 NLS vs error processing, again (was Re: Composite Type with Domain)