BUG #8128: pg_dump (>= 9.1) failed while dumping a scheme named "old" from PostgreSQL 8.4

From: Adrian(dot)Vondendriesch(at)credativ(dot)de
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #8128: pg_dump (>= 9.1) failed while dumping a scheme named "old" from PostgreSQL 8.4
Date: 2013-04-30 15:40:35
Message-ID: E1UXCfT-0006k7-K4@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

The following bug has been logged on the website:

Bug reference: 8128
Logged by: Adrian Vondendriesch
Email address: Adrian(dot)Vondendriesch(at)credativ(dot)de
PostgreSQL version: 9.1.9
Operating system: Debian GNU/Linux 7.0
Description:

Hi,

while browsing on bugs.debian.org I saw the following bug:
'pg_upgradecluster
fails with "OLD used in query that is not in a rule"'
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688960).

Because I don't found any reference to that report in pgsql-bugs I report it
by
my self.

Since I have tested it on my own I can confirm it is reproducible:

1. In a 8.4 cluster create a scheme called "old":
> CREATE SCHEME "old";

2. Create a test table:
> CREATE TABLE "old".test(id int);

3. insert some test data:
> INSERT INTO "old".test VALUES (1),(2),(3);

4. dump it with pg_dumpall (9.1):
/usr/lib/postgresql/9.1/bin/pg_dumpall -s > foo

This will produce the following error:
> pg_dump: SQL command failed
> pg_dump: Error message from server: ERROR: OLD used in query that is not
in a rule
> LINE 1: LOCK TABLE old.test IN ACCESS SHARE MODE
> ^
> pg_dump: The command was: LOCK TABLE old.test IN ACCESS SHARE MODE
> pg_dumpall: pg_dump failed on database "postgres", exiting

If pg_dumpall version 8.4 is used, the dump runs smoothly. This is because
pg_dump(all) in version 8.x uses quotes. (2013-04-30 16:24:49 CEST LOG:
statement: LOCK TABLE "old".test IN ACCESS SHARE MODE).

I think it's a bad idea to name a scheme 'old', but it's possible, so it
should be
supported. I saw no clue to resolve that issue in the pg_dump
documentation.

I'm running Debian Wheezy using the apt.postgresql.org repository.

Regards

- Adrian

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Adrian Vondendriesch 2013-04-30 15:52:33 Re: BUG #8128: pg_dump (>= 9.1) failed while dumping a scheme named "old" from PostgreSQL 8.4
Previous Message Bansal, Pradeep 2013-04-30 09:55:12 Re: ISSUE after upgrading to POSTGRES 8.4.8

Browse pgsql-hackers by date

  From Date Subject
Next Message Adrian Vondendriesch 2013-04-30 15:52:33 Re: BUG #8128: pg_dump (>= 9.1) failed while dumping a scheme named "old" from PostgreSQL 8.4
Previous Message Kevin Grittner 2013-04-30 15:35:32 Re: Remaining beta blockers