pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: shreeseva.it@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6660: losing schema name in pg_dump
Date: Tue, 22 May 2012 09:39:05 -0400
Message-ID: <28522.1337693945@sss.pgh.pa.us> (raw)
In-Reply-To: <E1SWjRN-0006yQ-Sx@wrigleys.postgresql.org>
References: <E1SWjRN-0006yQ-Sx@wrigleys.postgresql.org>

shreeseva.it@gmail.com writes:
> Many times I have to dump all objects from a schema (single schema holding
> only functions and views) in plain text format. It is found that pg_dump
> includes a set search_path statement at the beginning and drops all
> occurrences of the schema name (to which dumped object belongs) from
> function/view bodies even if they are explicitly defined while creating
> functions/views.

This is not a bug.  It's intentional behavior and is convenient more
often than not.

> This makes it problematic to maintain the software available for another
> RDBMS as for most other RDBMS we have to explicitly define schema names
> always. 

This claim seems quite baseless.  You certainly haven't offered any
actual evidence of a situation where omitting unnecessary schema names
is problematic.

More generally, though, pg_dump has never attempted to promise that its
output can be loaded into other DBMSes without pain, and it would be
practically impossible to make such a promise; there are too many subtle
differences in the various dialects of SQL.  If you have SQL that is
intended to work in multiple DBMSes, you would be best advised to
maintain it as text files (perhaps in an SCM) rather than hope that
pg_dump's output will still be useful for the other systems.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <28522.1337693945@sss.pgh.pa.us>
Permalink:  ../28522.1337693945@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28522.1337693945@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, shreeseva.it@gmail.com
  Subject: Re: BUG #6660: losing schema name in pg_dump
  In-Reply-To: <28522.1337693945@sss.pgh.pa.us>
  References: <E1SWjRN-0006yQ-Sx@wrigleys.postgresql.org> <28522.1337693945@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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