Re: pg_dump not including custom CAST?

Lists: pgsql-general
From: "D(dot) Dante Lorenso" <dante(at)lorenso(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_dump not including custom CAST?
Date: 2007-11-17 01:29:54
Message-ID: 473E4412.2010105@lorenso.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

All,

I did this in my database:

CREATE CAST (VARCHAR AS BYTEA) WITHOUT FUNCTION;

But when I use pg_dump to dump the database and use pg_restore to bring
it back on a freshly created database, the CAST is the only part of the
restore which is missing.

I'm using PostgreSQL 8.2.4 for both the dump and restore database. Why
doesn't the CAST dump and restore?

-- Dante


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "D(dot) Dante Lorenso" <dante(at)lorenso(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump not including custom CAST?
Date: 2007-11-17 05:36:35
Message-ID: 10056.1195277795@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

"D. Dante Lorenso" <dante(at)lorenso(dot)com> writes:
> I did this in my database:
> CREATE CAST (VARCHAR AS BYTEA) WITHOUT FUNCTION;

> I'm using PostgreSQL 8.2.4 for both the dump and restore database. Why
> doesn't the CAST dump and restore?

pg_dump thinks it's a built-in system object.

regards, tom lane


From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "D(dot) Dante Lorenso" <dante(at)lorenso(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump not including custom CAST?
Date: 2007-11-17 14:49:36
Message-ID: 3882B95B-6FB3-4A79-8D68-4A4A35E22227@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


On Nov 17, 2007, at 0:36 , Tom Lane wrote:

> "D. Dante Lorenso" <dante(at)lorenso(dot)com> writes:
>> I did this in my database:
>> CREATE CAST (VARCHAR AS BYTEA) WITHOUT FUNCTION;
>
>> I'm using PostgreSQL 8.2.4 for both the dump and restore
>> database. Why
>> doesn't the CAST dump and restore?
>
> pg_dump thinks it's a built-in system object.

What other objects might be susceptible to this? Operators? Operator
classes?

Michael Glaesemann
grzm seespotcode net


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Glaesemann <grzm(at)seespotcode(dot)net>
Cc: "D(dot) Dante Lorenso" <dante(at)lorenso(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump not including custom CAST?
Date: 2007-11-17 16:01:27
Message-ID: 17086.1195315287@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Michael Glaesemann <grzm(at)seespotcode(dot)net> writes:
> On Nov 17, 2007, at 0:36 , Tom Lane wrote:
>> pg_dump thinks it's a built-in system object.

> What other objects might be susceptible to this? Operators? Operator
> classes?

It's just casts. They're a bit of a problem since they have neither
owners nor schemas, so there's not anything very concrete to base a
dump-or-don't-dump decision on. The rule pg_dump uses is to dump it
if at least one of the three underlying objects (source type, dest type,
or function) is dumpable. Here you've got 2 builtin types and
no function, so you lose.

regards, tom lane