Re: [PATCH] Skip ALTER x SET SCHEMA if the schema didn't change

Поиск
Список
Период
Сортировка
От Haribabu Kommi
Тема Re: [PATCH] Skip ALTER x SET SCHEMA if the schema didn't change
Дата
Msg-id CAJrrPGcgp6=OJrSNcXtXpMow6Nz96eJK_Lgd_e-pHjUcMK7c3Q@mail.gmail.com
обсуждение исходный текст
Ответ на [PATCH] Skip ALTER x SET SCHEMA if the schema didn't change  (Marti Raudsepp <marti@juffo.org>)
Ответы Re: [PATCH] Skip ALTER x SET SCHEMA if the schema didn't change
Re: [PATCH] Skip ALTER x SET SCHEMA if the schema didn't change
Список pgsql-hackers
On Tue, Sep 29, 2015 at 12:17 AM, Marti Raudsepp <marti@juffo.org> wrote:
> Hi list
>
> The attached patch changes the behavior of multiple ALTER x SET SCHEMA
> commands, to skip, rather than fail, when the old and new schema is
> the same.
>
> The advantage is that it's now easier to write DDL scripts that are indempotent.
>
> This already matches the behavior of ALTER EXTENSION SET SCHEMA in
> earlier versions, as well as many other SET-ish commands, e.g. ALTER
> TABLE SET TABLESPACE, OWNER TO, CLUSTER ON, SET (storage_parameter...)
> etc. I don't see why SET SCHEMA should be treated any differently.
>
> The code is written such that object_access_hook is still called for
> each object.
>
> Regression tests included. I couldn't find any documentation that
> needs changing.

I went through the patch, following are my observations,

Patch applied with hunks and compiled with out warnings.
Basic tests are passed.

In AlterTableNamespaceInternal function, if a table or matview called
for set schema,
If the object contains any constraints, the constraint gets updated
with new schema.

In AlterTypeNamespaceInternal function, the InvokeObjectPostAlterHook function
doesn't get called if the type is of composite type, domain and array
types as because
it just returns from top of the function.


Regards,
Hari Babu
Fujitsu Australia



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

Предыдущее
От: Etsuro Fujita
Дата:
Сообщение: Re: Foreign join pushdown vs EvalPlanQual
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: extend pgbench expressions with functions