Update existing system explicit cast to make it implicit

From: asia123321(at)op(dot)pl
To: pgsql-general(at)postgresql(dot)org
Subject: Update existing system explicit cast to make it implicit
Date: 2011-01-31 15:10:40
Message-ID: 15071159-1472d6ef22d3beab255eddf872ce34df@pkn5.m5r2.onet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am trying to use bit(1) datatype with existing application that used int datatype before.
So I tried to create implicit cast that will allow me not to make code modifications and wanted to create implicit cast "int2bit", but it turned out that there is already system cast.
Unfortunately this cast is explicit and I need to make it implicit (it can be made implicit only for one schema).

My question is that if there is any official way to overwrite this attribute instead of performing following query:

update pg_cast set castcontext = 'i' where oid in (
select c.oid
from pg_cast c
inner join pg_type src on src.oid = c.castsource
inner join pg_type tgt on tgt.oid = c.casttarget
where src.typname like 'int%' and tgt.typname like 'bit%')

Thank you in advance for advice.

Asia

Responses

Browse pgsql-general by date

  From Date Subject
Next Message dennis jenkins 2011-01-31 15:50:33 Re: Postgresql-8.4.6, 64bit, Solaris 10u9, dtrace
Previous Message Kenneth Buckler 2011-01-31 13:41:56 Autovacuum Issues?