Adding "on delete cascade" after table creation ? - Mailing list pgsql-general

From Peter Alberer
Subject Adding "on delete cascade" after table creation ?
Date
Msg-id 000401c25fbd$380255d0$5be0d089@ekelhardt
Whole thread Raw
Responses Re: Adding "on delete cascade" after table creation ?
List pgsql-general
Hi there,

i have a table that SHOULD look like this:

create table lr_object_usage (
    lr_object_usage_id      integer
                            constraint
lr_object_usage_lr_object_usage_id_pk
                            primary key,
    lr_object_id            integer
                            constraint lr_object_usage_lr_object_id_fk
                            references lr_objects(lr_object_id)
                            on delete cascade,
    access_time             timestamp,
    user_id                 integer
                            constraint lr_object_usage_user_id_fk
                            references users(user_id),
    status                  varchar(11),
    context                 integer
                            constraint lr_object_usage_context_fk
                            references
lr_object_usage(lr_object_usage_id)
                            ___ON DELETE CASCADE___
);

unfortunately i think that the table was created without the delete
cascade in the last line (for the constraint
lr_object_usage_context_fk). Is it somehow possible to add the delete
cascade without recreating the table?

TIA, peter


pgsql-general by date:

Previous
From: frbn
Date:
Subject: Re: Database uptime?
Next
From: Jean-Christian Imbeault
Date:
Subject: Deadlock error!?