Search Postgresql Archives

Re: Installing PL/pgSQL by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tom Lane wrote:
> Bruce Momjian <bruce@xxxxxxxxxx> writes:
> > I installed PL/pgSQL by default via initdb with the attached patch.  The
> > only problem is that pg_dump still dumps out the language creation:
> > 	CREATE PROCEDURAL LANGUAGE plpgsql;
> > 	ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;
> > What is odd is that I used the same process that initdb uses to create
> > other objects.  Does anyone know why this is happening?
> 
> I think pg_dump pays attention to what schema the objects are in,
> and that's most likely creating them in PUBLIC.  Try adding
> "set search_path = pg_catalog".
> 
> It's not impossible that we'll have to tweak pg_dump a bit; it's
> never had to deal with languages that shouldn't be dumped ...

I found that pg_dump tests for pg_language.lanispl == true, which is
true for all the stored procedure languages.  I can easily special case
plpgsql, or check for FirstNormalObjectId, though I don't see that used
in pg_dump currently.

A more difficult issue is whether we should preserve the fact that
plpgsql was _removed_ in the pg_dump output, i.e, if someone removes
plpgsql from a database, do we issue a DROP LANGUAGE in pg_dump?  I
don't remember us having to deal with anything like this before.

-- 
  Bruce Momjian  <bruce@xxxxxxxxxx>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux