Thread: BUG #3913: pg_dump -T option not recognised

BUG #3913: pg_dump -T option not recognised

From
"David Dunwoody"
Date:
The following bug has been logged online:

Bug reference:      3913
Logged by:          David Dunwoody
Email address:      david.dunwoody@gmail.com
PostgreSQL version: 8.2.6
Operating system:   SuSE 8.2.6
Description:        pg_dump -T option not recognised
Details:

When running pg_dump, the -T option for table exclusion is ignored, but
--exclude-table does work.

Compiled from source.

Re: BUG #3913: pg_dump -T option not recognised

From
Zdenek Kotala
Date:
David Dunwoody wrote:
> The following bug has been logged online:
>
> Bug reference:      3913
> Logged by:          David Dunwoody
> Email address:      david.dunwoody@gmail.com
> PostgreSQL version: 8.2.6
> Operating system:   SuSE 8.2.6
> Description:        pg_dump -T option not recognised
> Details:
>
> When running pg_dump, the -T option for table exclusion is ignored, but
> --exclude-table does work.
>
> Compiled from source.

It works for me. Can you recheck it again?

        Zdenek

Re: BUG #3913: pg_dump -T option not recognised

From
Zdenek Kotala
Date:
Hmm, strange. Can you reproduce it on different machine/system? It seems more
problem with getopt in your installation. Check if you have installed updated
version of (g)libc.

            Zdenek

David Dunwoody wrote:
> Checked several times, and I was working in a pair, so I have a witness.
> :) It is, of course, possible that it's peculiar to something during the
> compile on my machine, but I've reproduced this on a clean install from
> source (./configure && make && make install).
>
> Seems remarkable that it really is a bug, as I find it hard to believe
> I'm the first person to use the short opt, but thought it best to report it!
>
> Cheers,
>
> David
>
>
>
> On 30/01/2008, *Zdenek Kotala* <Zdenek.Kotala@sun.com
> <mailto:Zdenek.Kotala@sun.com>> wrote:
>
>     David Dunwoody wrote:
>      > The following bug has been logged online:
>      >
>      > Bug reference:      3913
>      > Logged by:          David Dunwoody
>      > Email address:      david.dunwoody@gmail.com
>     <mailto:david.dunwoody@gmail.com>
>      > PostgreSQL version: 8.2.6
>      > Operating system:   SuSE 8.2.6
>      > Description:        pg_dump -T option not recognised
>      > Details:
>      >
>      > When running pg_dump, the -T option for table exclusion is
>     ignored, but
>      > --exclude-table does work.
>      >
>      > Compiled from source.
>
>     It works for me. Can you recheck it again?
>
>                     Zdenek
>
>

Re: BUG #3913: pg_dump -T option not recognised

From
Tom Lane
Date:
Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:
> David Dunwoody wrote:
>> When running pg_dump, the -T option for table exclusion is ignored, but
>> --exclude-table does work.

> It works for me. Can you recheck it again?

Works for me too, on Fedora 8.  But could you give a complete example?
Maybe there's some other contributing factor in the particular case
you're trying.

            regards, tom lane

Re: BUG #3913: pg_dump -T option not recognised

From
"David Dunwoody"
Date:
OK, just reproduced with 8.2.6 compiled from source on Ubuntu 7.10 (all
updates applied as a couple of hours ago).

Steps to reproduce.  Forgive any typos, this isn't all from bash_history,
but was done on a machine that never had postgresql on it before
(specifically, my laptop).

Command output is shown between ... characters.

** Basic install and clean DB setup:

wget http://mirror/postgresql-8.2.6.tar.gz
tar zxvf postgres-8.2.6.tar.gz
cd postgresql-8.2.6
./configure --prefix=/opt/postgres
make
sudo make install
sudo lndir /opt/postgres/bin /usr/local/bin
sudo mkdir /opt/postgres/data
sudo chown postgres /opt/postgres/data
sudo adduser postgres
sudo su - postgres
initdb -D /opt/postgres/data
postgres -D /opt/postgres/data > logfile 2>&1 &
createdb test
psql test

** Create test tables:

create table a ( col1 date, col2 date );
create table b ( col1 date, col2 date );
create table c ( col1 date, col2 date );

exit psql

** Sanity check psql:

pg_dump -v test > /dev/null

...
pg_dump: creating TABLE a
pg_dump: creating TABLE b
pg_dump: creating TABLE c
...

As expected

** Check --exclude-table option:

pg_dump -v --exclude-table=b test > /dev/null

...
pg_dump: creating TABLE a
pg_dump: creating TABLE c
...

As expected

** Check -T option:

pg_dump -v -T=b test > /dev/null

...
pg_dump: creating TABLE a
pg_dump: creating TABLE b
pg_dump: creating TABLE c
...

Silently ignores -T


I hope I'm an idiot, but that looks like a bug according to pg_dump --help
which says:

...
-T, --exclude-table=TABLE   do NOT dump the named table(s)
...


Hope that helps you reproduce it.

Cheers,

David



On 30/01/2008, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:
> > David Dunwoody wrote:
> >> When running pg_dump, the -T option for table exclusion is ignored, but
> >> --exclude-table does work.
>
> > It works for me. Can you recheck it again?
>
> Works for me too, on Fedora 8.  But could you give a complete example?
> Maybe there's some other contributing factor in the particular case
> you're trying.
>
>                         regards, tom lane
>

Re: BUG #3913: pg_dump -T option not recognised

From
"Kevin Grittner"
Date:
>>> On Wed, Jan 30, 2008 at 12:33 PM, in message
<f6956c7a0801301033w59c26c1eg18afe5358490a1c5@mail.gmail.com>, "David Dunwo=
ody"
<david.dunwoody@gmail.com> wrote:=20
=20
> pg_dump -v -T=3Db test > /dev/null
=20
Get rid of the equals sign.  Not used for single-letter form.
=20
pg_dump -v -T b test > /dev/null
=20
-Kevin
=20

=20

Re: BUG #3913: pg_dump -T option not recognised

From
Rodriguez Fernando
Date:
David Dunwoody wrote:
> OK, just reproduced with 8.2.6 compiled from source on Ubuntu 7.10
> (all updates applied as a couple of hours ago).
>
> Steps to reproduce.  Forgive any typos, this isn't all from
> bash_history, but was done on a machine that never had postgresql on
> it before (specifically, my laptop).
>
> Command output is shown between ... characters.
>
> ** Basic install and clean DB setup:
>
> wget http://mirror/postgresql-8.2.6.tar.gz
> tar zxvf postgres-8.2.6.tar.gz
> cd postgresql-8.2.6
> ./configure --prefix=/opt/postgres
> make
> sudo make install
> sudo lndir /opt/postgres/bin /usr/local/bin
> sudo mkdir /opt/postgres/data
> sudo chown postgres /opt/postgres/data
> sudo adduser postgres
> sudo su - postgres
> initdb -D /opt/postgres/data
> postgres -D /opt/postgres/data > logfile 2>&1 &
> createdb test
> psql test
>
> ** Create test tables:
>
> create table a ( col1 date, col2 date );
> create table b ( col1 date, col2 date );
> create table c ( col1 date, col2 date );
>
> exit psql
>
> ** Sanity check psql:
>
> pg_dump -v test > /dev/null
>
> ...
> pg_dump: creating TABLE a
> pg_dump: creating TABLE b
> pg_dump: creating TABLE c
> ...
>
> As expected
>
> ** Check --exclude-table option:
>
> pg_dump -v --exclude-table=b test > /dev/null
>
> ...
> pg_dump: creating TABLE a
> pg_dump: creating TABLE c
> ...
>
> As expected
>
> ** Check -T option:
>
> pg_dump -v -T=b test > /dev/null
>
> ...
> pg_dump: creating TABLE a
> pg_dump: creating TABLE b
> pg_dump: creating TABLE c
> ...
>
> Silently ignores -T
>
>
> I hope I'm an idiot, but that looks like a bug according to pg_dump
> --help which says:
>
> ...
> -T, --exclude-table=TABLE   do NOT dump the named table(s)
> ...
>
>
> Hope that helps you reproduce it.
>
> Cheers,
>
> David
>
>
>
> On 30/01/2008, *Tom Lane* <tgl@sss.pgh.pa.us
> <mailto:tgl@sss.pgh.pa.us>> wrote:
>
>     Zdenek Kotala <Zdenek.Kotala@Sun.COM
>     <mailto:Zdenek.Kotala@Sun.COM>> writes:
>     > David Dunwoody wrote:
>     >> When running pg_dump, the -T option for table exclusion is
>     ignored, but
>     >> --exclude-table does work.
>
>     > It works for me. Can you recheck it again?
>
>     Works for me too, on Fedora 8.  But could you give a complete example?
>     Maybe there's some other contributing factor in the particular case
>     you're trying.
>
>                             regards, tom lane
>
>
Hola, hasta donde veo lo que esta de mas es el igual (=) -T=b debe decir
-T b

Saludos Fernando

Re: BUG #3913: pg_dump -T option not recognised

From
"David Dunwoody"
Date:
Aha!  My pair and I are fools.

Thanks!

David

On 30/01/2008, Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:
>
> >>> On Wed, Jan 30, 2008 at 12:33 PM, in message
> <f6956c7a0801301033w59c26c1eg18afe5358490a1c5@mail.gmail.com>, "David
> Dunwoody"
> <david.dunwoody@gmail.com> wrote:
>
> > pg_dump -v -T=b test > /dev/null
>
> Get rid of the equals sign.  Not used for single-letter form.
>
> pg_dump -v -T b test > /dev/null
>
> -Kevin
>
>
>
>
>
>