You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEpublic.bug_repro_values (
id bigintNOT NULL,
condition_category textNOT NULL,
condition_value integerNOT NULLCONSTRAINT contrived_condition_check CHECK (
CASE
WHEN (condition_category ='must_be_positive') THEN (condition_value >0)
WHEN (condition_category ='must_be_negative') THEN (condition_value <0)
ELSE true
END)
);
The following diff occurs, which correctly reorders condition_value integer and condition_category text, but incorrectly adds commas to the end of all the check constraint lines:
--- table_schema_for_repro.sql 2023-08-31 04:44:55.438589724 +0000+++ table_schema_for_repro_copy.sql 2023-08-31 04:53:12.714570483 +0000@@ -1,11 +1,11 @@
CREATE TABLE public.bug_repro_values (
id bigint NOT NULL,
+ condition_value integer NOT NULL,
condition_category text NOT NULL,
- condition_value integer NOT NULL- CONSTRAINT contrived_condition_check CHECK (-CASE- WHEN (condition_category = 'must_be_positive') THEN (condition_value > 0)- WHEN (condition_category = 'must_be_negative') THEN (condition_value < 0)- ELSE true+ CONSTRAINT contrived_condition_check CHECK (,+CASE,+ WHEN (condition_category = 'must_be_positive') THEN (condition_value > 0),+ WHEN (condition_category = 'must_be_negative') THEN (condition_value < 0),+ ELSE true,
END)
);
Multi-line check constraints incorrectly have commas after each line when reordering structure files.
Example:
The following diff occurs, which correctly reorders
condition_value integer
andcondition_category text
, but incorrectly adds commas to the end of all the check constraint lines:Full repro Dockerfile and supporting files: https://github.com/aristocrates/pg_column_byte_packer_comma_bug_repro
The text was updated successfully, but these errors were encountered: