Re: Partitioning/inherited tables vs FKs

From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Nicolas Barbier <nicolas(dot)barbier(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Dmitry Fefelov <fozzy(at)ac-sw(dot)com>, pgsql-hackers(at)postgresql(dot)org, Jaime Casanova <jaime(at)2ndquadrant(dot)com>, Boszormenyi Zoltan <zb(at)cybertec(dot)at>, Sándor Miglécz <sandor(at)cybertec(dot)at>, Hans-Juergen Schoenig <hs(at)cybertec(dot)at>
Subject: Re: Partitioning/inherited tables vs FKs
Date: 2010-05-11 12:59:00
Message-ID: 4BE95494.7080209@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This is getting way off topic, but:

On 5/11/10 3:55 PM +0300, Nicolas Barbier wrote:
> T2> SELECT i FROM a WHERE i = 1 FOR SHARE; -- Lock a with i = 1 FOR SHARE.
> i
> ---
> 1
> (1 Zeile)
>
> T2> SELECT a_id FROM b WHERE a_id = 1; -- Check whether it's got
> anything pointing to it.
> a_id
> ------
> (0 Zeilen)
>
> T2> DELETE FROM a WHERE i = 1; -- Nope, so delete a with i = 1 (this
> blocks, because T1 is still holding the lock).

Obviously you wouldn't delete anything with a SHARE lock.

Regards,
Marko Tiikkaja

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nicolas Barbier 2010-05-11 13:07:53 Re: Partitioning/inherited tables vs FKs
Previous Message Nicolas Barbier 2010-05-11 12:55:12 Re: Partitioning/inherited tables vs FKs