Re: clone_schema function

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: clone_schema function
Дата
Msg-id 03928174-78b8-409e-9ab1-04775b34b673@mm
обсуждение исходный текст
Ответ на clone_schema function  (Melvin Davidson <melvin6925@gmail.com>)
Ответы Re: clone_schema function
Список pgsql-general
    Melvin Davidson wrote:

> I've added error checking and verified that it now copies the
> current sequnce values, table data, views and functions.

The code dealing with functions is seriously flawed.

Consider that part:
     SELECT pg_get_functiondef(func_oid) INTO qry;
     SELECT replace(qry, source_schema, dest_schema) INTO dest_qry;
     EXECUTE dest_qry;

It suggests that to duplicate a function in schema A to B,
every letter A in the entire function definition should be replaced
by B, garbling everything along the way.
For example CREATE FUNCTION would become CREBTE FUNCTION,
DECLARE would become DECLBRE and so on.

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: clone_schema function
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: clone_schema function