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

Support for ON UPDATE/DELETE SET DEFAULT #798

Open
fulghum opened this issue Oct 2, 2024 · 0 comments
Open

Support for ON UPDATE/DELETE SET DEFAULT #798

fulghum opened this issue Oct 2, 2024 · 0 comments

Comments

@fulghum
Copy link
Contributor

fulghum commented Oct 2, 2024

Doltgres supports adding constraints through ALTER TABLE, but the ON DELETE and ON UPDATE clauses don't support the SET DEFAULT option. Dolt supports parsing the ON DELETE/UPDATE SET DEFAULT syntax, but GMS does not implement the logic for it.

CREATE TABLE public.hn_stories (
    id integer NOT NULL,
    title text NOT NULL,
    date timestamp with time zone NOT NULL,
    score numeric NOT NULL,
    hn_username text,
    website_url text
);

CREATE TABLE public.websites (
    url text NOT NULL,
    title text,
    description text,
    twitter_username text,
    github_username text
);

ALTER TABLE ONLY public.hn_stories
    ADD CONSTRAINT hn_stories_website_url_fkey FOREIGN KEY (website_url) REFERENCES public.websites(url) ON UPDATE CASCADE ON DELETE SET DEFAULT;

Discovered while testing Hasura dump loading

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

No branches or pull requests

1 participant