[PATCH] Skip ALTER x SET SCHEMA if the schema didn't change - Mailing list pgsql-hackers

From Marti Raudsepp
Subject [PATCH] Skip ALTER x SET SCHEMA if the schema didn't change
Date
Msg-id CABRT9RCy8kvXFSdNPQjKr9tC9CMfepTtds1A8w2PG6Sg3CbmYQ@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Skip ALTER x SET SCHEMA if the schema didn't change  (Haribabu Kommi <kommi.haribabu@gmail.com>)
List pgsql-hackers
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.

Regards,
Marti

Attachment

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: BRIN Scan: Optimize memory allocation in function 'bringetbitmap'
Next
From: Tom Lane
Date:
Subject: Re: Doubt in pgbench TPS number