Re: clone_schema function

From: Igor Neyman <ineyman(at)perceptron(dot)com>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Daniel Verite <daniel(at)manitou-mail(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: clone_schema function
Date: 2015-09-15 13:55:58
Message-ID: A76B25F2823E954C9E45E32FA49D70ECCD516041@mail.corp.perceptron.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


That is correct. But table old will NOT be converted to new because
only the schema name is converted. And table "old" WILL exist because it will also be copied.
I have tested and it works properly.
Please do not provide hypothetical examples. Give me an actual working example that causes the problem.
This statement:
SELECT old.field FROM old.old;
selects column “field” from table “old” which is in schema “old”.
Your script converts it into:
SELECT new.field FROM new.old
which will try to select column “field” from table “old” in schema “new”.

Again:
SELECT new.field
means select column “field” from table “new”, which does not exists.
Not sure, what other example you need.
Regards,
Igor Neyman

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2015-09-15 15:10:22 Re: Exclusively locking parent tables while disinheriting children.
Previous Message Melvin Davidson 2015-09-15 13:44:30 Re: clone_schema function