pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedValidade dump file
4+ messages / 4 participants
[nested] [flat]
* Validade dump file
@ 2010-10-05 03:28 Fábio Gibon - Comex System <gibon@comexsystem.com.br>
2010-10-05 06:39 ` Re: Validade dump file Guillaume Lelarge <guillaume@lelarge.info>
0 siblings, 1 reply; 4+ messages in thread
From: Fábio Gibon - Comex System @ 2010-10-05 03:28 UTC (permalink / raw)
To: pgsql-admin
Hi everybody,
are there some tool or internal program that read a dump file (created by pg_dump) and list all tables and number of tuples (without
restore) in this file?
And too, are there some tool to check the physical file integrity? (S.O. Windows)
thanks
Fábio Henrique Gibon
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Validade dump file
2010-10-05 03:28 Validade dump file Fábio Gibon - Comex System <gibon@comexsystem.com.br>
@ 2010-10-05 06:39 ` Guillaume Lelarge <guillaume@lelarge.info>
2010-10-05 14:39 ` Re: Validade dump file Willy-Bas Loos <willybas@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Guillaume Lelarge @ 2010-10-05 06:39 UTC (permalink / raw)
To: Fábio Gibon - Comex System <gibon@comexsystem.com.br>; +Cc: pgsql-admin
Le 05/10/2010 05:28, Fábio Gibon - Comex System a écrit :
> [...]
> are there some tool or internal program that read a dump file (created by pg_dump) and list all tables and number of tuples (without
> restore) in this file?
>
That command should give you the number of tables in your plain dump:
grep "CREATE TABLE" your_dump_file | wc -l
If you have a binary dump (ie, tar or custom), you should do this:
pg_restore -s your_dump_file | grep "CREATE TABLE" | wc -l
There's no easy way to get the number of tuples in each table.
> And too, are there some tool to check the physical file integrity? (S.O. Windows)
notepad? :)
I mean, with a SQL file, this is just a bunch of SQL queries. So there's
no real way to check the file integrity without restoring it.
On a binary dump, you can do a "pg_restore your_dump_file > /dev/null".
It should warn you if you have an integrity issue.
--
Guillaume
http://www.postgresql.fr
http://dalibo.com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Validade dump file
2010-10-05 03:28 Validade dump file Fábio Gibon - Comex System <gibon@comexsystem.com.br>
2010-10-05 06:39 ` Re: Validade dump file Guillaume Lelarge <guillaume@lelarge.info>
@ 2010-10-05 14:39 ` Willy-Bas Loos <willybas@gmail.com>
2010-10-05 15:35 ` Re: Validade dump file Kevin Grittner <Kevin.Grittner@wicourts.gov>
0 siblings, 1 reply; 4+ messages in thread
From: Willy-Bas Loos @ 2010-10-05 14:39 UTC (permalink / raw)
To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: Fábio Gibon - Comex System <gibon@comexsystem.com.br>; pgsql-admin
cool actually.
any idea for the number of tuples?
count all lines after COPY .* ) FROM stdin;
until \.
(but how?)
on a side note: what's the difference between the admin list and the general
list?
--
"Patriotism is the conviction that your country is superior to all others
because you were born in it." -- George Bernard Shaw
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Validade dump file
2010-10-05 03:28 Validade dump file Fábio Gibon - Comex System <gibon@comexsystem.com.br>
2010-10-05 06:39 ` Re: Validade dump file Guillaume Lelarge <guillaume@lelarge.info>
2010-10-05 14:39 ` Re: Validade dump file Willy-Bas Loos <willybas@gmail.com>
@ 2010-10-05 15:35 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
0 siblings, 0 replies; 4+ messages in thread
From: Kevin Grittner @ 2010-10-05 15:35 UTC (permalink / raw)
To: Willy-Bas Loos <willybas@gmail.com>; Guillaume Lelarge <guillaume@lelarge.info>; +Cc: gibon@comexsystem.com.br; pgsql-admin
Willy-Bas Loos <willybas@gmail.com> wrote:
> any idea for the number of tuples?
Your best bet would be to use whatever scripting language you like
which has decent support for regular expressions. Expect to tweak
your expressions a bit as you discover the corner cases where you're
not getting the count you expect.
> on a side note: what's the difference between the admin list and
> the general list?
This thread is OK on admin -- which is targeted toward operational
issues. If in doubt, general can include just about anything. It
gets traffic about equal to all the more specific lists combined, so
it's a bit much for some of us to follow. Some people (like me) who
can't absorb the volume of traffic on general follow a few more
specialized lists where we feel we're best able to help. If
discussion on one list dies out without a satisfactory resolution,
it's OK to try another likely-looking list -- particularly if
there's no further repsonse on the initial list for a few days.
While there's a fair amount of overlap, you will get a somewhat
different set of people tracking each list.
-Kevin
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2010-10-05 15:35 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-10-05 03:28 Validade dump file Fábio Gibon - Comex System <gibon@comexsystem.com.br>
2010-10-05 06:39 ` Guillaume Lelarge <guillaume@lelarge.info>
2010-10-05 14:39 ` Willy-Bas Loos <willybas@gmail.com>
2010-10-05 15:35 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox