pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_dump ignore CASTs when using --schema
3+ messages / 3 participants
[nested] [flat]
* pg_dump ignore CASTs when using --schema
@ 2016-03-04 06:56 Felix Ostmann <felix.ostmann@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Felix Ostmann @ 2016-03-04 06:56 UTC (permalink / raw)
To: pgsql-bugs
Hello,
we have a problem with pg_dump and CAST. After some digging and asking
someone pointed me to this email address.
Our server: postgresql-9.4 - 9.4.6-0+deb8u1
Our problem:
http://blog.endpoint.com/2015/02/postgres-pgdump-implicit-cast-problem.html?showComment=142417912648...
short example:
$ pg_dump -s --schema testschema testdatabase | grep CAST
$ pg_dump -s testdatabase | grep CAST
-- Name: CAST (text AS testschema.enum_users_title); Type: CAST; Schema:
pg_catalog; Owner:
CREATE CAST (text AS testschema.enum_users_title) WITH FUNCTION
testschema.cast_users_title(text) AS IMPLICIT;
Have a nice day
Felix Ostmann
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pg_dump ignore CASTs when using --schema
@ 2016-03-04 18:23 Tom Lane <tgl@sss.pgh.pa.us>
parent: Felix Ostmann <felix.ostmann@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2016-03-04 18:23 UTC (permalink / raw)
To: Felix Ostmann <felix.ostmann@gmail.com>; +Cc: pgsql-bugs
Felix Ostmann <felix.ostmann@gmail.com> writes:
> we have a problem with pg_dump and CAST.
Casts don't have names, therefore they don't have schemas, therefore
a dump that is restricted to a particular schema won't select them.
So this isn't a bug; it's operating as designed.
This is kind of unfortunate in many scenarios, but it's hard to see a
principled way around it. You might propose something like pretending
that a cast is in the same schema as its implementation function, but
what about casts that have no implementation function? Likewise,
tying it to the schema of either the input or the output datatype
seems arbitrary and about as likely to be wrong as right.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pg_dump ignore CASTs when using --schema
@ 2016-03-04 18:43 David G. Johnston <david.g.johnston@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: David G. Johnston @ 2016-03-04 18:43 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Felix Ostmann <felix.ostmann@gmail.com>; pgsql-bugs
On Fri, Mar 4, 2016 at 11:23 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Felix Ostmann <felix.ostmann@gmail.com> writes:
> > we have a problem with pg_dump and CAST.
>
> Casts don't have names, therefore they don't have schemas, therefore
> a dump that is restricted to a particular schema won't select them.
> So this isn't a bug; it's operating as designed.
>
> This is kind of unfortunate in many scenarios, but it's hard to see a
> principled way around it. You might propose something like pretending
> that a cast is in the same schema as its implementation function, but
> what about casts that have no implementation function? Likewise,
> tying it to the schema of either the input or the output datatype
> seems arbitrary and about as likely to be wrong as right.
>
>
​Begs the question - why don't we just name them and allow them to be
placed in a schema?
OR
They have to exist somewhere...can we add an explicit pg_dump option to
target them specifically?
i.e., pg_dump --dump-unnamed
David J.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2016-03-04 18:43 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-03-04 06:56 pg_dump ignore CASTs when using --schema Felix Ostmann <felix.ostmann@gmail.com>
2016-03-04 18:23 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-03-04 18:43 ` David G. Johnston <david.g.johnston@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox