From: | Melvin Davidson <melvin6925(at)gmail(dot)com> |
---|---|
To: | Predrag Maric <predrag4(at)gmail(dot)com> |
Cc: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: clone_schema function |
Date: | 2015-10-23 14:52:01 |
Message-ID: | CANu8FiwoTpcmPE52z57w+rrwC5id2kOdc28=dAez2sY9C_70iQ@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Good catch. Thank you very much!
On Fri, Oct 23, 2015 at 10:50 AM, Predrag Maric <predrag4(at)gmail(dot)com> wrote:
> The script is generating foreign keys which reference tables in the source
> schema.
> I had to change
>
> 219 SELECT 'ALTER TABLE ' || quote_ident(dest_schema) || '.' ||
> quote_ident(rn.relname)
> 220 || ' ADD CONSTRAINT ' ||
> quote_ident(ct.conname) || ' ' || pg_get_constraintdef(ct.oid) || ';'
>
> to
>
> 219 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Day, David | 2015-10-23 15:23:21 | Re: strange connection problem. |
Previous Message | Predrag Maric | 2015-10-23 14:50:15 | Re: clone_schema function |