Re: pg_dump and quoted identifiers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump and quoted identifiers
Date: 2016-12-15 17:10:04
Message-ID: 869.1481821804@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer <spam_eater(at)gmx(dot)net> writes:
> Tom Lane schrieb am 15.12.2016 um 16:20:
>> Hmm. It might shed some light if you put "echo" in front of that
>> to see what gets printed:
>> $ echo pg_dump -d postgres -t "\"Statuses\""
>> pg_dump -d postgres -t "Statuses"

> Same here:
> -bash-4.1$ echo pg_dump -d postgres -t "\"Statuses\""
> pg_dump -d postgres -t "Statuses"

So no light there ... next step would be to set log_statement = all
and see what pg_dump's last few queries before failing are.
I see this with correct quoting:

2016-12-15 12:06:15.211 EST [693] LOG: statement: SELECT c.oid
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind in ('r', 'S', 'v', 'm', 'f', 'P')
AND c.relname ~ '^(Statuses)$'
AND pg_catalog.pg_table_is_visible(c.oid)

and this if I omit quotes:

2016-12-15 12:07:19.735 EST [741] LOG: statement: SELECT c.oid
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind in ('r', 'S', 'v', 'm', 'f', 'P')
AND c.relname ~ '^(statuses)$'
AND pg_catalog.pg_table_is_visible(c.oid)

(This test is on HEAD; I suppose the 'P' case is pretty new...)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-12-15 18:01:18 Re: PostgreSQL mirroring from RPM install to Source install
Previous Message Jan de Visser 2016-12-15 17:04:43 Re: pg_dump and quoted identifiers