Re: [GENERAL] Dump and restore problem

2008-06-22 Thread David
On Sun, Jun 22, 2008 at 3:11 AM, Stuart Luppescu <[EMAIL PROTECTED]> wrote:
> On 木, 2008-06-19 at 11:57 +0200, David wrote:
>> > pg_restore: [tar archiver] could not open TOC file for input: No
>> such
>> > file or directory
>>
>> It sounds like the tar file is no longer being created.
>>
>> Try manually running the commands, and verify that the dump, restore,
>> and rsync still work correctly at each step.
>
> It looks like it's working:
> file postgresql_database-db-backup
> postgresql_database-db-backup: tar archive
>
> tar tfv postgresql_database-db-backup
> -rw--- 2048/1024 62764 2008-06-20 03:00 toc.dat
> -rw--- 2048/1024   4590795 2008-06-20 03:00 1765.dat
> -rw--- 2048/1024391040 2008-06-20 03:00 1771.dat
> -rw--- 2048/1024   1262932 2008-06-20 03:00 1770.dat
> -rw--- 2048/1024  4472 2008-06-20 03:00 1769.dat
> -rw--- 2048/1024 5 2008-06-20 03:00 1796.dat
> -rw--- 2048/1024 5 2008-06-20 03:00 1787.dat
> -rw--- 2048/1024  5456 2008-06-20 03:00 1762.dat
> -rw--- 2048/1024435981 2008-06-20 03:00 1767.dat
> -rw--- 2048/1024 54185 2008-06-20 03:00 1774.dat
> -rw--- 2048/1024   109 2008-06-20 03:00 1764.dat
>
> etc.
>
> This only weird thing is the ownership is weird. Where did that
> 2048/1024 come from?
>

I'm not sure about that. But if your manual process is working, then
your script should work fine too. Try adding more logging & error
checking/capturing to your mirroring scripts to check where the
problem is occurring. Debug lines like 'echo "TESTING ($LINENO) -
"' to trace which parts of the scripts get run when can
also help.

David.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Dump and restore problem

2008-06-21 Thread Martin


Most files systems allocate in 1k(1024) block(s)
If the resource requests more.. the OS FS allocates one more 1024 block 
(thus the display of 2048 allocation..)


hope this makes sense,
Martin
- Original Message - 
From: "Stuart Luppescu" <[EMAIL PROTECTED]>

To: 
Sent: Saturday, June 21, 2008 9:11 PM
Subject: Re: [GENERAL] Dump and restore problem


On 木, 2008-06-19 at 11:57 +0200, David wrote:

> pg_restore: [tar archiver] could not open TOC file for input: No
such
> file or directory

It sounds like the tar file is no longer being created.

Try manually running the commands, and verify that the dump, restore,
and rsync still work correctly at each step.


It looks like it's working:
file postgresql_database-db-backup
postgresql_database-db-backup: tar archive

tar tfv postgresql_database-db-backup
-rw--- 2048/1024 62764 2008-06-20 03:00 toc.dat
-rw--- 2048/1024   4590795 2008-06-20 03:00 1765.dat
-rw--- 2048/1024391040 2008-06-20 03:00 1771.dat
-rw--- 2048/1024   1262932 2008-06-20 03:00 1770.dat
-rw--- 2048/1024  4472 2008-06-20 03:00 1769.dat
-rw--- 2048/1024 5 2008-06-20 03:00 1796.dat
-rw--- 2048/1024 5 2008-06-20 03:00 1787.dat
-rw--- 2048/1024  5456 2008-06-20 03:00 1762.dat
-rw--- 2048/1024435981 2008-06-20 03:00 1767.dat
-rw--- 2048/1024 54185 2008-06-20 03:00 1774.dat
-rw--- 2048/1024   109 2008-06-20 03:00 1764.dat

etc.

This only weird thing is the ownership is weird. Where did that
2048/1024 come from?

--
Stuart Luppescu -=- s-luppescu .at. uchicago.edu
University of Chicago (^_^)/ CCSR
才文と智奈美の父 -=-=- Kernel 2.6.23-gentoo-r
War is never imperative.   -- McCoy, "Balance of
Terror", stardate 1709.2





--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Dump and restore problem

2008-06-21 Thread Stuart Luppescu
On 木, 2008-06-19 at 11:57 +0200, David wrote:
> > pg_restore: [tar archiver] could not open TOC file for input: No
> such
> > file or directory
> 
> It sounds like the tar file is no longer being created.
> 
> Try manually running the commands, and verify that the dump, restore,
> and rsync still work correctly at each step.

It looks like it's working:
file postgresql_database-db-backup
postgresql_database-db-backup: tar archive

tar tfv postgresql_database-db-backup
-rw--- 2048/1024 62764 2008-06-20 03:00 toc.dat
-rw--- 2048/1024   4590795 2008-06-20 03:00 1765.dat
-rw--- 2048/1024391040 2008-06-20 03:00 1771.dat
-rw--- 2048/1024   1262932 2008-06-20 03:00 1770.dat
-rw--- 2048/1024  4472 2008-06-20 03:00 1769.dat
-rw--- 2048/1024 5 2008-06-20 03:00 1796.dat
-rw--- 2048/1024 5 2008-06-20 03:00 1787.dat
-rw--- 2048/1024  5456 2008-06-20 03:00 1762.dat
-rw--- 2048/1024435981 2008-06-20 03:00 1767.dat
-rw--- 2048/1024 54185 2008-06-20 03:00 1774.dat
-rw--- 2048/1024   109 2008-06-20 03:00 1764.dat

etc.

This only weird thing is the ownership is weird. Where did that
2048/1024 come from?

-- 
Stuart Luppescu -=- s-luppescu .at. uchicago.edu
University of Chicago (^_^)/ CCSR 
才文と智奈美の父 -=-=- Kernel 2.6.23-gentoo-r
War is never imperative.   -- McCoy, "Balance of
 Terror", stardate 1709.2 
 
 
 


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Dump and restore problem

2008-06-19 Thread David
On Wed, Jun 18, 2008 at 11:41 PM, Stuart Luppescu <[EMAIL PROTECTED]> wrote:

[...]

> pg_restore: [tar archiver] could not open TOC file for input: No such
> file or directory

It sounds like the tar file is no longer being created.

Try manually running the commands, and verify that the dump, restore,
and rsync still work correctly at each step.

David.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Dump and restore problem

2008-06-18 Thread Stuart Luppescu
Hello, I had a very nice system where I mirrored everything to another
machine each night, so in case of disaster, I could easily switch over
to the mirror.

The backup script uses a line like this:

pg_dump -b -F t -h $postgresql_hostname $i > "$location_backup_dir/`date
+%B-%Y`/$date_info/postgresql_database-$i-backup"

I transfer the backup files by rsync and then run this on the mirror:

pg_restore -c -U dbuser -d dbname -F t postgresql_database-db-backup

This worked fine for months until I upgraded postgres on the main
machine from 8.0.13 to 8.0.15. From then on I started getting these
messages:

pg_restore: [tar archiver] could not open TOC file for input: No such
file or directory

The funny thing is that this started when I upgraded postgres on the
main main machine a little over a week ago, but I had already upgraded
from 8.0.13 to 8.0.15 on the mirror machine back in January (and the
error happens when I try to restore the backup on the mirror). 

If anyone can help, I would be very appreciative.

-- 
Stuart Luppescu -=- slu .at. ccsr.uchicago.edu
University of Chicago -=- CCSR 
才文と智奈美の父 -=-Kernel 2.6.24-gentoo-r8
Is knowledge knowable?  If not, how do we know
 that? 
 
 
 

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] dump and restore a single table containing large objects

2005-04-27 Thread John Liu
Is there a clean way to dump/restore a single table which contains large
objects instead of the entire DB? 
In Pg version=7.4 -
pg_dump: Large object output is not supported for a single table.
pg_dump: Use all tables or a full dump instead.

Does version 8.0's pg_dump support a single table dump containing Lo?

Thanks.
John

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [GENERAL] Dump and Restore

2004-08-24 Thread Oliver Elphick
On Tue, 2004-08-24 at 17:36, Eduardo S. Fontanetti wrote:
> I am using pg_dump.
> 
> It means that I can't restore to a different name
> database??

If you use pg_dump[all] without other options it will dump to a text
file.  Just edit the database name.

-- 
Oliver Elphick  [EMAIL PROTECTED]
Isle of Wight  http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
 
 "I saw in the night visions, and, behold, one like the 
  Son of man came with the clouds of heaven, and came to
  the Ancient of days, and they brought him near before 
  him. And there was given him dominion, and glory, and 
  a kingdom, that all people, nations, and languages, 
  should serve him; his dominion is an everlasting 
  dominion, which shall not pass away, and his kingdom 
  that which shall not be destroyed." 
Daniel 7:13,14


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [GENERAL] Dump and Restore

2004-08-24 Thread Eduardo S. Fontanetti
I am using pg_dump.

It means that I can't restore to a different name
database??

Eduardo S. Fontanetti

 --- Paul Thomas <[EMAIL PROTECTED]> escreveu: 
> 
> On 24/08/2004 14:40 Eduardo S. Fontanetti wrote:
> > How can I do a test if my dumping is really
> working, I
> > can't apply the dump in my database, because it
> will
> > overwrite a lot of data. I was thinking about
> restore
> > in another database name, but I can't, it always
> > restore on the original database.
> > 
> > Somebody have a cooking recipe about to test if my
> > backup is working fine, and will help if I need
> > sometime?
> 
> Are you using pg_dump or pg_dumpall? I just use
> pg_dump on individual 
> databases (pg_dumpall works on the whole cluster)
> and can restore that to 
> any database.
> 
> 
> HTH
> 
> -- 
> Paul Thomas
>
+--+-+
> | Thomas Micro Systems Limited | Software Solutions
> for 
> Business |
> | Computer Consultants | 
> http://www.thomas-micro-systems-ltd.co.uk   |
>
+--+-+
>  





___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! 
http://br.acesso.yahoo.com/

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


Re: [GENERAL] Dump and Restore

2004-08-24 Thread Ron St-Pierre
Eduardo S. Fontanetti wrote:
How can I do a test if my dumping is really working, I
can't apply the dump in my database, because it will
overwrite a lot of data. I was thinking about restore
in another database name, but I can't, it always
restore on the original database.
Somebody have a cooking recipe about to test if my
backup is working fine, and will help if I need
sometime?
 


OK here's a recipe:
If you're using  pg_dump as in:
   pg_dump dbName > fileName
create your new database:
  createdb myNewDB (don't forget your encoding)
and then restore from the dump:
  psql -d myNewDB -f fileName
Ron
---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [ADMIN] [GENERAL] Dump and Restore

2004-08-24 Thread Thilina Gunasekara
Assuming you're using Unix Box
1. Dump your database DB_X
pg_dump -v -U postgresUsername DB_X | gzip -f - > DB_X.gz

2.Create database DB_Y
psql -U postgresUsername template1
CREATE DATABASE DB_Y
\q

3. zcat DB_X.gz | psql -U postgresUsername -f - DB_Y

Thilina


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Paul Thomas
Sent: 24 August 2004 16:30
To: Eduardo S . Fontanetti
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [ADMIN] [GENERAL] Dump and Restore



On 24/08/2004 14:40 Eduardo S. Fontanetti wrote:
> How can I do a test if my dumping is really working, I
> can't apply the dump in my database, because it will
> overwrite a lot of data. I was thinking about restore
> in another database name, but I can't, it always
> restore on the original database.
>
> Somebody have a cooking recipe about to test if my
> backup is working fine, and will help if I need
> sometime?

Are you using pg_dump or pg_dumpall? I just use pg_dump on individual
databases (pg_dumpall works on the whole cluster) and can restore that to
any database.


HTH

--
Paul Thomas
+--+
-+
| Thomas Micro Systems Limited | Software Solutions for
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk   |
+--+
-+

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [GENERAL] Dump and Restore

2004-08-24 Thread Paul Thomas
On 24/08/2004 14:40 Eduardo S. Fontanetti wrote:
How can I do a test if my dumping is really working, I
can't apply the dump in my database, because it will
overwrite a lot of data. I was thinking about restore
in another database name, but I can't, it always
restore on the original database.
Somebody have a cooking recipe about to test if my
backup is working fine, and will help if I need
sometime?
Are you using pg_dump or pg_dumpall? I just use pg_dump on individual 
databases (pg_dumpall works on the whole cluster) and can restore that to 
any database.

HTH
--
Paul Thomas
+--+-+
| Thomas Micro Systems Limited | Software Solutions for 
Business |
| Computer Consultants | 
http://www.thomas-micro-systems-ltd.co.uk   |
+--+-+

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]