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

Export unique_idx error #284

Closed
ego opened this issue Sep 29, 2022 · 2 comments
Closed

Export unique_idx error #284

ego opened this issue Sep 29, 2022 · 2 comments

Comments

@ego
Copy link

ego commented Sep 29, 2022

psqldef with flag --export raise error:
found syntax error when parsing DDL "CREATE UNIQUE INDEX airline_confirmation_code_unique_idx ON public.airline_confirmation USING btree (airline_id, booking_id, lower((code)::text)) WHERE ((code IS NOT NULL) AND (airline_id IS NOT NULL))": syntax error at position 133

@k0kubun
Copy link
Collaborator

k0kubun commented Oct 3, 2022

When you report an issue, can you provide a working schema to reproduce it? Running the SQL fails on psql as well (ERROR: relation "public.airline_confirmation" does not exist).

@ego
Copy link
Author

ego commented Oct 4, 2022

Hi, check with this simple table and index:

CREATE TABLE public.airline_confirmation (
    airline_id bigint,
    code character varying(512),
    booking_id bigint NOT NULL
);

CREATE UNIQUE INDEX airline_confirmation_code_unique_idx 
    ON public.airline_confirmation 
    USING btree (airline_id, booking_id, lower((code)::text)) 
    WHERE ((code IS NOT NULL) AND (airline_id IS NOT NULL));

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