pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6318: pg_dump for non-template languages is broken
3+ messages / 3 participants
[nested] [flat]

* BUG #6318: pg_dump for non-template languages is broken
@ 2011-12-02 11:06  laurenz.albe@wien.gv.at
  0 siblings, 1 reply; 3+ messages in thread

From: laurenz.albe@wien.gv.at @ 2011-12-02 11:06 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      6318
Logged by:          Laurenz Albe
Email address:      laurenz.albe@wien.gv.at
PostgreSQL version: 9.1.1
Operating system:   Linux (RHEL 3)
Description:        

How to reproduce:

postgres=# CREATE DATABASE dumpme;
postgres=# \c dumpme postgres
dumpme=# CREATE LANGUAGE mylang HANDLER plpgsql_call_handler INLINE
plpgsql_inline_handler VALIDATOR plpgsql_validator;
dumpme=# \q

$ pg_dump -C -F p -f dumpme.sql dumpme

$ psql -c 'DROP DATABASE dumpme'

$ psql -f dumpme.sql
[...]
psql:dumpme.sql:32: ERROR:  unsupported language "mylang"
HINT:  The supported languages are listed in the pg_pltemplate system
catalog.
psql:dumpme.sql:35: ERROR:  language "mylang" does not exist
[...]

The reason is that the dump contains:

--
-- Name: mylang; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: advpg
--

CREATE OR REPLACE PROCEDURAL LANGUAGE mylang;


ALTER PROCEDURAL LANGUAGE mylang OWNER TO advpg;

Yours,
Laurenz Albe




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #6318: pg_dump for non-template languages is broken
@ 2011-12-02 17:28  Tom Lane <tgl@sss.pgh.pa.us>
  parent: laurenz.albe@wien.gv.at
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2011-12-02 17:28 UTC (permalink / raw)
  To: laurenz.albe@wien.gv.at; +Cc: pgsql-bugs

laurenz.albe@wien.gv.at writes:
> dumpme=# CREATE LANGUAGE mylang HANDLER plpgsql_call_handler INLINE
> plpgsql_inline_handler VALIDATOR plpgsql_validator;

I don't think this is a particularly interesting use-case.  The reason
it doesn't work for you is that it's depending on support functions
that are in pg_catalog, and as the comment in pg_dump.c says:

    /*
     * Try to find the support function(s).  It is not an error if we don't
     * find them --- if the functions are in the pg_catalog schema, as is
     * standard in 8.1 and up, then we won't have loaded them. (In this case
     * we will emit a parameterless CREATE LANGUAGE command, which will
     * require PL template knowledge in the backend to reload.)
     */

An actual add-on procedural language would not fall foul of this.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #6318: pg_dump for non-template languages is broken
@ 2011-12-03 10:55  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Albe Laurenz @ 2011-12-03 10:55 UTC (permalink / raw)
  To: Tom Lane *EXTERN* <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs

Tom Lane wrote:
>> dumpme=# CREATE LANGUAGE mylang HANDLER plpgsql_call_handler INLINE
>> plpgsql_inline_handler VALIDATOR plpgsql_validator;

> I don't think this is a particularly interesting use-case.  The reason
> it doesn't work for you is that it's depending on support functions
> that are in pg_catalog, and as the comment in pg_dump.c says:

> An actual add-on procedural language would not fall foul of this.

Oh I see. Sorry for the noise.

Yours,
Laurenz Albe




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2011-12-03 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-12-02 11:06 BUG #6318: pg_dump for non-template languages is broken laurenz.albe@wien.gv.at
2011-12-02 17:28 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-12-03 10:55   ` Albe Laurenz <laurenz.albe@wien.gv.at>

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