On Monday, February 27, 2012 11:44:09 am James B. Byrne wrote:
>
> 3. Why are these dependencies not owned by the database
> owner to begin with? Surely this code:
>
> CREATE EXTENSION plpgsql
> SCHEMA pg_catalog
> VERSION "1.0";
> ALTER EXTENSION plpgsql
> OWNER TO postgres;
>
> could just as easily specify the actual database owner
> instead?
I have not spent enough time with 9.1, exploring the change over to EXTENSIONs
to manage a language to give you a definitive answer. However it would seem you
can peg a LANGUAGE to a database owner:
http://www.postgresql.org/docs/9.1/interactive/sql-createlanguage.html
"
Ordinarily, the user must have the PostgreSQL superuser privilege to register a
new language. However, the owner of a database can register a new language
within that database if the language is listed in the pg_pltemplate catalog and
is marked as allowed to be created by database owners (tmpldbacreate is true).
The default is that trusted languages can be created by database owners, but
this can be adjusted by superusers by modifying the contents of pg_pltemplate.
The creator of a language becomes its owner and can later drop it, rename it, or
assign it to a new owner.
"
Not sure how that interacts with the EXTENSION mechanism though:(
--
Adrian Klaver
adrian.klaver@gmail.com