Re: CAST Within EXCLUSION constraint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: "David E(dot) Wheeler" <david(at)justatheory(dot)com>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CAST Within EXCLUSION constraint
Date: 2013-08-21 14:13:15
Message-ID: 4022.1377094395@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alexander Korotkov <aekorotkov(at)gmail(dot)com> writes:
> It seems reasonable to me to cast enum to oid. However, creating casts
> without function isn't allowed for enums.

> test=# create cast (source as oid) without function;
> ERROR: enum data types are not binary-compatible

The reason for that is you'd get randomly different results on another
installation. In this particular application, I think David doesn't
really care about what values he gets as long as they're distinct,
so this might be an OK workaround for him. But that's the reasoning
for the general prohibition.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-08-21 14:22:11 Re: PL/pgSQL, RAISE and error context
Previous Message Marko Tiikkaja 2013-08-21 13:00:00 Re: PL/pgSQL, RAISE and error context