Bug #805: pg_dump examines all tables even with -t "table_name" speficied

Started by PostgreSQL Bugs Listover 23 years ago4 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Vitaliy Fuks (vitaliyfuks@yahoo.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
pg_dump examines all tables even with -t "table_name" speficied

Long Description
Running pg_dump -t table_name -vv shows pg_dump examining every table in the database. With many tables present (in hundreds) this can make the process of dumping just one table take a considerable amount of time.

With pg_dump -t specified it should go straight for the requested table and then figure what other dependent objects need to be examined.

Happens on pg_dump 7.2.3 under Linux (RedHat RPM) and i386 Solaris.

Are there some technical limitations forcing pg_dump to read everything? If not it seems that the logic behind is just not optimal.

Sample Code

No file was uploaded with this report

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #805: pg_dump examines all tables even with -t "table_name" speficied

pgsql-bugs@postgresql.org writes:

pg_dump examines all tables even with -t "table_name" speficied

7.3 is a little better. It's not that easy to determine in advance what
information is needed, though; consider inheritance for example.

regards, tom lane

#3Vitaliy Fuks
vitaliyfuks@yahoo.com
In reply to: Tom Lane (#2)
Re: Bug #805: pg_dump examines all tables even with -t "table_name" speficied

Hello,

Could there potentially be an option in addition to -t "table_name", to
either:

a) Examine all relationships and dump all dependant objects
b) Dump only table named "table_name"

One can argue that when asking for "a" table one really only wants that
table information, and nothing else. Some people of course can argue
that just a table by itself may not be usable by itself in some
situations - so that's why the option described above could cater both
situations.

I wish I could just give you a patch but there are probably people who
know pg_dump internals who could produce such patch in 10x less amount
of time.

--Vitaliy

--- Tom Lane <tgl@sss.pgh.pa.us> wrote:

pgsql-bugs@postgresql.org writes:

pg_dump examines all tables even with -t "table_name" speficied

7.3 is a little better. It's not that easy to determine in advance
what
information is needed, though; consider inheritance for example.

regards, tom lane

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

#4Bruce Momjian
bruce@momjian.us
In reply to: Vitaliy Fuks (#3)
Re: Bug #805: pg_dump examines all tables even with -t "table_name"

We are thinking of adding a per-schema dump option in 7.4. Would that
help?

---------------------------------------------------------------------------

Vitaliy Fuks wrote:

Hello,

Could there potentially be an option in addition to -t "table_name", to
either:

a) Examine all relationships and dump all dependant objects
b) Dump only table named "table_name"

One can argue that when asking for "a" table one really only wants that
table information, and nothing else. Some people of course can argue
that just a table by itself may not be usable by itself in some
situations - so that's why the option described above could cater both
situations.

I wish I could just give you a patch but there are probably people who
know pg_dump internals who could produce such patch in 10x less amount
of time.

--Vitaliy

--- Tom Lane <tgl@sss.pgh.pa.us> wrote:

pgsql-bugs@postgresql.org writes:

pg_dump examines all tables even with -t "table_name" speficied

7.3 is a little better. It's not that easy to determine in advance
what
information is needed, though; consider inheritance for example.

regards, tom lane

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073