Version impacted : 14.7 15.2
Problem :
On a database created with AWS console in RDS Service, this command gives an error:
alter table if exists foo drop constraint if exists baz;
Where table foo does not exist and hence constraint baz does not exist.
The documentation says that this instruction issues a warning, not an error:
https://www.postgresql.org/docs/current/sql-altertable.html
IF EXISTS: Do not throw an error if the table does not exist. A notice is issued in this case.
On that database, the commande
gives
PostgreSQL 14.7 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-12), 64-bit
Building a docker with the same postgresql version (14.7) does not issue an error when invoking
alter table if exists foo drop constraint if exists baz;
and respects what the documention states. And
gives
PostgreSQL 14.7 (Debian 14.7-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
It then appears that différent compilation parameters could lead to a bug in that circontance.
We use to write defensive/idempotent scripts to prevent errors at runtime when staging. This bug force us to rewrite a lot of them.
Version impacted : 14.7 15.2
Problem :
On a database created with AWS console in RDS Service, this command gives an error:
Where table foo does not exist and hence constraint baz does not exist.
The documentation says that this instruction issues a warning, not an error:
https://www.postgresql.org/docs/current/sql-altertable.html
IF EXISTS: Do not throw an error if the table does not exist. A notice is issued in this case.
On that database, the commande
gives
Building a docker with the same postgresql version (14.7) does not issue an error when invoking
and respects what the documention states. And
gives
It then appears that différent compilation parameters could lead to a bug in that circontance.
We use to write defensive/idempotent scripts to prevent errors at runtime when staging. This bug force us to rewrite a lot of them.