ExecuteTruncate quirk: expects a unique list of relations - Mailing list pgsql-hackers

From Nikhils
Subject ExecuteTruncate quirk: expects a unique list of relations
Date
Msg-id d3c4af540806050751v788fb730hd3d790e4b8482f13@mail.gmail.com
Whole thread Raw
Responses Re: ExecuteTruncate quirk: expects a unique list of relations  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Hi, <br /><br />Consider this simple case:<br /><br />postgres=# TRUNCATE foo, foo; <br />ERROR:  cannot TRUNCATE "foo"
becauseit is being used by active queries in this session <br /><br />The above occurs because the ExecuteTruncate()
functioninvokes truncate_check_rel() in a loop. Since the same table name appears twice, the rd_refcnt for table "foo"
isbumped up to 2, causing the above failure.<br /><br clear="all" />We might want to add a step to ExecuteTruncate(),
orwhatever calls it, to make the list unique.<br /><br />Regards,<br />Nikhils<br />-- <br />EnterpriseDB <a
href="http://www.enterprisedb.com">http://www.enterprisedb.com</a>

pgsql-hackers by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: pg_dump restore time and Foreign Keys
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Overhauling GUCS