public inbox for [email protected]  
help / color / mirror / Atom feed
From: Josh Kupershmidt <[email protected]>
To: Mike Toews <[email protected]>
Cc: [email protected]
Subject: Re: pg_dump -t '"Table"' for cmd.exe
Date: Tue, 13 Nov 2012 22:49:12 -0500
Message-ID: <CAK3UJRHi90DyuS0dUGMRf68fov82QB5Mb650kkms0eGzDd3e5g@mail.gmail.com> (raw)
In-Reply-To: <CAM2FmMo5YbxtAa_ZQhP99NqHod=UUyfXoCLrio2DJ344Wb81kQ@mail.gmail.com>
References: <CAM2FmMo5YbxtAa_ZQhP99NqHod=UUyfXoCLrio2DJ344Wb81kQ@mail.gmail.com>

On Mon, Nov 12, 2012 at 8:45 PM, Mike Toews <[email protected]> wrote:
> I'm not sure if this is worth documenting, but pg_dumping mixed-case tables
> with the '-t table' option appears to not be accurately documented for
> cmd.exe. Here are my four attempts, with only the last as success:

I believe this complaint is basically the same as this recent one:
  http://archives.postgresql.org/pgsql-bugs/2012-10/msg00044.php

and this behavior confused me recently as well. I agree the behavior
should be documented, though it should be documented for all our
utilities which accept a --table argument and pass it on as a
supposedly already-escaped identifier.

Incidentally, I'm really not fond of the existing behavior because it:
 a.) is counterintuitive
 b.) requires the user to escape table names themselves, and how were
they even supposed to have a chance of programmatically doing this
properly before we exposed PQescapeIdentifier()
 c.) opens possible SQL injection holes, e.g.
  reindexdb --table='foo; ALTER ROLE limited WITH superuser'

Josh




view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pg_dump -t '"Table"' for cmd.exe
  In-Reply-To: <CAK3UJRHi90DyuS0dUGMRf68fov82QB5Mb650kkms0eGzDd3e5g@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox