Re: Dumping an Extension's Script

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Dumping an Extension's Script
Дата
Msg-id 20121205195457.GE4673@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Dumping an Extension's Script  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Dumping an Extension's Script
Список pgsql-hackers
Robert Haas escribió:

> I have no objection whatsoever to the concept of storing the SQL and
> control files somewhere that doesn't need access to the server
> filesystem - in fact, I think I previously proposed allowing those to
> be stored in a database table.  You could do that with something like:
>
> CREATE TEMPLATE yadda;
> ALTER TEMPLATE yadda ADD FILE 'yadda--1.0.sql' CONTENT $$...$$;
>
> ...or whatever.

This seems unnecessary to me.  What the patch at hand does is take the
file (actually, the contents of the file) and execute it directly,
without installing anything on disk.  The precise contents of the
extension is still tracked through pg_depend, so you can drop it without
having previously saved neither the control file or the SQL script.  (In
fact, that's how DROP EXTENSION works currently.)

There's also the pg_dump side of things; with your proposal we would be
forced to move over the yadda--1.0.sql file from the old server to the
new one; or, equivalently, put the whole ALTER TEMPLATE .. CONTENT
command in the dump, which is equivalent to what Dimitri's patch does;
so there doesn't seem to be a point.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: json accessors
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Dumping an Extension's Script