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

Cannot use boolean literal as default value with psqldef #177

Closed
yuku opened this issue Dec 29, 2021 · 1 comment
Closed

Cannot use boolean literal as default value with psqldef #177

yuku opened this issue Dec 29, 2021 · 1 comment

Comments

@yuku
Copy link
Contributor

yuku commented Dec 29, 2021

--export output

CREATE TABLE public.test (
    "col" boolean DEFAULT true
);

Input SQL

CREATE TABLE test (
  "col" BOOLEAN DEFAULT FALSE
);

Current output

Fail with unsupported default value type (valueType: '7').

Note that migrating from falsetrue also fails with the same error.

Expected output

Successfully migrate the schema.

Workaround

Using string representations for the boolean works as expected:

CREATE TABLE test (
  "col" BOOLEAN DEFAULT 'false' -- or 'no', 'off', '0'
);

ref: https://www.postgresql.org/docs/14/datatype-boolean.html

@k0kubun
Copy link
Collaborator

k0kubun commented Dec 29, 2021

Thanks for the report. Fixed in v0.11.16.

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

2 participants