I'm using libpq and the PQexec function. I am trying to figure out if I
execute a delete query on a table that has dependent tables with on
delete cascade set. Will the result return before or after the cascade
is finished?

I'm not having any luck finding anything in the docs as I am not sure on
the right terminology to use for this.

Thanks for any help!

Brad

Search Discussions

  • Tom Lane at Dec 11, 2006 at 4:30 pm

    "Bradley Russell" <bradley.russell@npcinternational.com> writes:
    I'm using libpq and the PQexec function. I am trying to figure out if I
    execute a delete query on a table that has dependent tables with on
    delete cascade set. Will the result return before or after the cascade
    is finished?
    After, unless you have the constraint set to "deferred", in which case
    the cascade happens at COMMIT.

    regards, tom lane
  • Philippe Salama at Dec 11, 2006 at 5:25 pm
    I am just a beginner with SQL and pgsql, but one of my textbooks suggests
    that, if the table is not too large, one may make a copy of it, and test
    such things as deletes, before one does the delete on the live table. And I
    think there is a way to do it as a transaction, and not complete it until
    you are certain of the results. Hope these suggestions from a beginner are
    of some help.



    _____

    From: pgsql-novice-owner@postgresql.org
    On Behalf Of Bradley Russell
    Sent: Monday, December 11, 2006 11:27 AM
    To: pgsql-novice@postgresql.org
    Subject: [NOVICE] delete cascade question



    I'm using libpq and the PQexec function. I am trying to figure out if I
    execute a delete query on a table that has dependent tables with on delete
    cascade set. Will the result return before or after the cascade is finished?



    I'm not having any luck finding anything in the docs as I am not sure on the
    right terminology to use for this.



    Thanks for any help!



    Brad

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedDec 11, '06 at 4:25p
activeDec 11, '06 at 5:25p
posts3
users3
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase