Re: EXPLAIN on DELETE statements

From: Grant McLean <grant(at)catalyst(dot)net(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Cc: Janning Vygen <vygen(at)gmx(dot)de>
Subject: Re: EXPLAIN on DELETE statements
Date: 2004-08-01 21:38:35
Message-ID: 1091396315.1363.47.camel@putnam
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2004-07-28 at 23:41, Janning Vygen wrote:
> Hi,
>
> EXPLAIN on delete stamements works, but doesn't show me all the subsequent
> deletes or checks which has to be done because of foreign keys
> cascading/restricting.
>
> Is there a solution to show up which tables are checked and which scans the
> planner is going to use to check these related tables?

You could try enabling the 'log_statement' and related entries in the
postgresql.conf file and possibly the -d option for debugging on the
Postmaster. I know I get the referential integrity check queries
showing up in the PostgreSQL log (syslog actually) on my server but I'm
not exactly sure what I did to cause that :-). Here's an example:

LOG: statement: SELECT 1 FROM ONLY "public"."audit_type" x WHERE
"audit_type_id" = $1 FOR UPDATE OF x

Regards
Grant

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Browne 2004-08-01 22:06:15 Re: PostgreSQL, GnuCash
Previous Message Randy Yates 2004-08-01 21:14:39 Postgres and Tools Intro?