Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collation changes can result in bad SQL commands #293

Open
jsonn opened this issue Mar 30, 2023 · 0 comments
Open

Collation changes can result in bad SQL commands #293

jsonn opened this issue Mar 30, 2023 · 0 comments

Comments

@jsonn
Copy link

jsonn commented Mar 30, 2023

Before:

CREATE COLLATION public."de-u-co-phonebk-x-icu" (provider = icu, locale = 'de-u-co-phonebk');
CREATE TABLE testtable (
    name text PRIMARY KEY
);

After:

CREATE COLLATION public."de-u-co-phonebk-x-icu" (provider = icu, locale = 'de-u-co-phonebk');

CREATE TABLE testtable (
    name text COLLATE public."de-u-co-phonebk-x-icu" PRIMARY KEY
);

Generated diff from 2.7.0:

ALTER TABLE testtable
        ALTER COLUMN name TYPE text COLLATE public."de-u-co-phonebk-x-icu" PRIMARY KEY USING name::text COLLATE public."de-u-co-phonebk-x-icu" PRIMARY KEY /* TYPE change - table: testtable original: text primary key new: text COLLATE public."de-u-co-phonebk-x-icu" PRIMARY KEY */;

Variations with NOT NULL instead of PRIMARY KEY also trigger invalid SQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant