Re: clone_schema function
От | Melvin Davidson |
---|---|
Тема | Re: clone_schema function |
Дата | |
Msg-id | CANu8FiwoTpcmPE52z57w+rrwC5id2kOdc28=dAez2sY9C_70iQ@mail.gmail.com обсуждение исходный текст |
Ответ на | clone_schema function (Melvin Davidson <melvin6925@gmail.com>) |
Список | pgsql-general |
Good catch. Thank you very much!
On Fri, Oct 23, 2015 at 10:50 AM, Predrag Maric <predrag4@gmail.com> wrote:
The script is generating foreign keys which reference tables in the source schema.I had to change219 SELECT 'ALTER TABLE ' || quote_ident(dest_schema) || '.' || quote_ident(rn.relname)220 || ' ADD CONSTRAINT ' || quote_ident(ct.conname) || ' ' || pg_get_constraintdef(ct.oid) || ';'to219 SELECT 'ALTER TABLE ' || quote_ident(dest_schema) || '.' || quote_ident(rn.relname)220 || ' ADD CONSTRAINT ' || quote_ident(ct.conname) || ' ' || replace(pg_get_constraintdef(ct.oid), quote_ident(source_schema) || '.', quote_ident(dest_schema) || '.') || ';'I'm attaching the updated script.
--
Melvin Davidson
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

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