Re: [GENERAL] Restoring a database dump from 9.0 to 9.2

2013-02-08 Thread Tom Lane
Jay McGaffigan writes: > So my first question. > If I can't use a psql 9.2.2 instance to create the backup. Are there > 'best' practices I should follow in creating the backup. All my googling > hasn't really been able to point to the best approach. We do recommend using the newer pg_dump in

Re: [GENERAL] Restoring a database dump from 9.0 to 9.2

2013-02-08 Thread Ben Madin
If Tom's suggestion doesn't work, can you do your text dump by schema, or for a subset of tables, and see if you can isolate the problem table. (using the -n or -t options) Have you changed the locale / languages settings between db versions? If you find a quoting problem in a very large table you

Re: [GENERAL] Restoring a database dump from 9.0 to 9.2

2013-02-08 Thread Tom Lane
Jay McGaffigan writes: > I've been trying to restore a fairly sizeable database dump from my > production server onto my dev box. > Recently upgraded to 9.2.2 and wanted to try it out. > So I grabbed a text dump of the database and tried the "Createdb dbname; > psql < dmpfile" way of restoring

Re: [GENERAL] Restoring a database dump from 9.0 to 9.2

2013-02-08 Thread Steve Crawford
On 02/08/2013 12:43 PM, Jay McGaffigan wrote: Hi, I've been trying to restore a fairly sizeable database dump from my production server onto my dev box. Recently upgraded to 9.2.2 and wanted to try it out. So I grabbed a text dump of the database and tried the "Createdb dbname; psql < dmpfi

[GENERAL] Restoring a database dump from 9.0 to 9.2

2013-02-08 Thread Jay McGaffigan
Hi, I've been trying to restore a fairly sizeable database dump from my production server onto my dev box. Recently upgraded to 9.2.2 and wanted to try it out. So I grabbed a text dump of the database and tried the "Createdb dbname; psql < dmpfile" way of restoring that's always worked for me be

Re: [GENERAL] restoring a database to its initial state

2010-03-16 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Lane ha scritto: > Pavel Stehule writes: >> 2010/3/13 Manlio Perillo : >>> Usually when I need to restore a database to its initial state, what I >>> do is to simply drop it, and then re-create it. >>> However on a shared hosting this is not possi

Re: [GENERAL] restoring a database to its initial state

2010-03-13 Thread Tom Lane
Pavel Stehule writes: > 2010/3/13 Manlio Perillo : >> Usually when I need to restore a database to its initial state, what I >> do is to simply drop it, and then re-create it. >> However on a shared hosting this is not possible. > Usually people use a install and a uninstall scripts. First create

Re: [GENERAL] restoring a database to its initial state

2010-03-13 Thread Adrian von Bidder
Hyho! On Saturday 13 March 2010 13.48:14 Manlio Perillo wrote: > Usually when I need to restore a database to its initial state, what I > do is to simply drop it, and then re-create it. > > However on a shared hosting this is not possible. Create a schema, modify your default search path so tha

Re: [GENERAL] restoring a database to its initial state

2010-03-13 Thread Pavel Stehule
Hello 2010/3/13 Manlio Perillo : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi. > > Usually when I need to restore a database to its initial state, what I > do is to simply drop it, and then re-create it. > > However on a shared hosting this is not possible. > > By initial state I mean:

[GENERAL] restoring a database to its initial state

2010-03-13 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. Usually when I need to restore a database to its initial state, what I do is to simply drop it, and then re-create it. However on a shared hosting this is not possible. By initial state I mean: The content of template1 database or The databa

[GENERAL] Restoring a database from original files (Was: Need help

2009-05-19 Thread Stephane Bortzmeyer
On Mon, May 18, 2009 at 11:33:03PM +0430, Zico wrote a message of 74 lines which said: > No, I don`t have any data of Postgres "data" directory. Next time, do not forget backups... > As far as i can remember, my postgre files were in /usr/share/postgresql/8.3 > > as i am using the Debian di

Re: [GENERAL] Restoring a database

2008-10-15 Thread Joshua D. Drake
Chris Henderson wrote: pg_dumpall archive. If you look at the backup file, you'll find that it's just straight SQL. If you want to restore a particular database out of it and not all of them, then you will need to edit the sql file to include only what you want to restore. Then you simply pass

Re: [GENERAL] Restoring a database

2008-10-15 Thread Chris Henderson
> pg_dumpall archive. If you look at the backup file, you'll find that > it's just straight SQL. If you want to restore a particular database > out of it and not all of them, then you will need to edit the sql file > to include only what you want to restore. Then you simply pass it > through psq

Re: [GENERAL] Restoring a database

2008-10-15 Thread Jeff Frost
Jeff Frost wrote: > Chris Henderson wrote: > >> I backup all my databases by using pg_dumpall - pg_dumpall > >> /tmp/postgres.backup.`hostname`. It should backup four DBs: analyze, >> postgres, template0 and template1 >> I guess this backs up the schemas as well. >> >> Now I want to restore o

Re: [GENERAL] Restoring a database

2008-10-15 Thread Jeff Frost
Chris Henderson wrote: > I backup all my databases by using pg_dumpall - pg_dumpall > > /tmp/postgres.backup.`hostname`. It should backup four DBs: analyze, > postgres, template0 and template1 > I guess this backs up the schemas as well. > > Now I want to restore one of the databases and schema fr

Re: [GENERAL] Restoring a database

2008-10-15 Thread Raymond O'Donnell
On 15/10/2008 22:19, Chris Henderson wrote: > I backup all my databases by using pg_dumpall - pg_dumpall > > /tmp/postgres.backup.`hostname`. It should backup four DBs: analyze, > postgres, template0 and template1 > I guess this backs up the schemas as well. > > Now I want to restore one of the d

Re: [GENERAL] Restoring a database

2008-10-15 Thread Scott Marlowe
On Wed, Oct 15, 2008 at 3:19 PM, Chris Henderson <[EMAIL PROTECTED]> wrote: > I backup all my databases by using pg_dumpall - pg_dumpall > > /tmp/postgres.backup.`hostname`. It should backup four DBs: analyze, > postgres, template0 and template1 > I guess this backs up the schemas as well. > > Now

[GENERAL] Restoring a database

2008-10-15 Thread Chris Henderson
I backup all my databases by using pg_dumpall - pg_dumpall > /tmp/postgres.backup.`hostname`. It should backup four DBs: analyze, postgres, template0 and template1 I guess this backs up the schemas as well. Now I want to restore one of the databases and schema from this backup dump file onto a di

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-28 Thread William Garrison
Thanks to everyone for for the myriad of informative replies on this. -- 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] Restoring a database from a file system snapshot

2008-08-28 Thread Shane Ambler
William Garrison wrote: We have a SAN volume, and we created a tablespace that that points to that SAN volume (Z: drive). This put all the table files on Z:. It was our assumption that the table files + the archived transaction would now be on the Z: drive, and that was enough to restore the

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-28 Thread Magnus Hagander
William Garrison wrote: > I have just come to a horrible realization about PostgreSQL that I'm > sure is supposed to be pre-requisite knowledge even going into this. So > everyone may laugh at me now. > > We have a SAN volume, and we created a tablespace that that points to > that SAN volume (Z:

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-28 Thread Scott Marlowe
On Wed, Aug 27, 2008 at 6:16 PM, William Garrison <[EMAIL PROTECTED]> wrote: > > I'm still reeling from the thought that there can > somehow be a single transaction log for multiple databases. How is that > even possible? Are the transaction ID numbers shared across databases too? Yes it's poss

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-27 Thread Craig Ringer
Alvaro Herrera wrote: > It is consistent only if it was taken when the postmaster was down. OR if you are able to take a point-in-time snapshot at the volume level, say using LVM or some SAN management tool. The effect is the same as if the server is hardware reset unexpectedly, in that it requir

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-27 Thread Richard Huxton
William Garrison wrote: [snip] > A database is not just tables - it is tables and > transaction logs. Why on earth would PostgreSQL put the tables > separately from the transaction logs? Because you told it to. If you want everything on Z:\postgresql you just initdb that location and point PG at

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-27 Thread William Garrison
I have just come to a horrible realization about PostgreSQL that I'm sure is supposed to be pre-requisite knowledge even going into this. So everyone may laugh at me now. We have a SAN volume, and we created a tablespace that that points to that SAN volume (Z: drive). This put all the table

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-27 Thread Alvaro Herrera
William Garrison wrote: > 1) I have a file system backup that *IS* consistent. So I should not > need any WAL files at all right? It is consistent only if it was taken when the postmaster was down. > **update** > I got it working. Here's how > 1) I have a file system snapshot. No WAL files

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-27 Thread William Garrison
Alvaro Herrera wrote: William Garrison wrote: I have a PostgreSQL database on Windows Server 2003, and the database is kept on a SAN that has the ability to make instantaneous snapshots. Once I have made such a snapshot, I am unclear how to re-attach it to another postgres database on a

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-27 Thread postgres Emanuel CALVO FRANCO
Sorry Alvaro, i sent to you the message ;P Is the same way (from snapshot) that use Mysql on ZFS. IF you don't change anything in the database, why it don't works? Then you restart the service with the same path. The problem it will be that you need to stop postgres BEFORE snapshot. -- Sent

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-27 Thread Alvaro Herrera
William Garrison wrote: > I have a PostgreSQL database on Windows Server 2003, and the database is > kept on a SAN that has the ability to make instantaneous snapshots. > Once I have made such a snapshot, I am unclear how to re-attach it to > another postgres database on another machine. Po

Re: [GENERAL] Restoring a database from a file system snapshot

2008-08-27 Thread Joao Ferreira gmail
> Any suggestions? Is my procedure correct? Would I need to also copy > the transaction logs or something like that? the 'by the book' procedure for this operation is to use pg_dumpall . > dump_file.sql and later psql -f dump_file.sql postgres pg_dumpall gives you a transaction

[GENERAL] Restoring a database from a file system snapshot

2008-08-27 Thread William Garrison
I have a PostgreSQL database on Windows Server 2003, and the database is kept on a SAN that has the ability to make instantaneous snapshots. Once I have made such a snapshot, I am unclear how to re-attach it to another postgres database on another machine. Postgres seems to create a directory

Re: [GENERAL] RESTORING A DATABASE WITH DIFFERENT TIMEZONES

2006-12-21 Thread Brandon Aiken
PROTECTED] Sent: Thursday, December 21, 2006 1:37 PM To: Brandon Aiken; 'Postgres general mailing list' Subject: RES: [GENERAL] RESTORING A DATABASE WITH DIFFERENT TIMEZONES Actually I want the server to behave in the time zone 'BRST' (this is already configured). But the ma

Re: RES: [GENERAL] RESTORING A DATABASE WITH DIFFERENT TIMEZONES

2006-12-21 Thread Richard Huxton
Rodrigo Sakai wrote: Actually I want the server to behave in the time zone 'BRST' (this is already configured). But the machine where the dump was done was with a time zone that is -2 from GMT! So I need to restore this dump in my server, but maintain the 00:00:00 at the hour part! Is ther

Re: [GENERAL] RESTORING A DATABASE WITH DIFFERENT TIMEZONES

2006-12-21 Thread Michael Glaesemann
On Dec 21, 2006, at 11:32 , Rodrigo Sakai wrote: But I have to restore it and maintain the same value of datetime! How can I do it? You should have no problem. A timestamp with time zone marks an absolute instant in time: the different time zones are different representations of the s

RES: [GENERAL] RESTORING A DATABASE WITH DIFFERENT TIMEZONES

2006-12-21 Thread Rodrigo Sakai
here a way??? -Mensagem original- De: Brandon Aiken [mailto:[EMAIL PROTECTED] Enviada em: quinta-feira, 21 de dezembro de 2006 14:00 Para: [EMAIL PROTECTED]; Postgres general mailing list Assunto: RE: [GENERAL] RESTORING A DATABASE WITH DIFFERENT TIMEZONES '2006-12-20 00:00:00-02' and '200

Re: [GENERAL] RESTORING A DATABASE WITH DIFFERENT TIMEZONES

2006-12-21 Thread Brandon Aiken
2:33 PM To: pgsql-general@postgresql.org Subject: [GENERAL] RESTORING A DATABASE WITH DIFFERENT TIMEZONES Hi all, I'm having some troubles with time zones! I have a database dump file that have the date fields stored as '2006-12-20 00:00:00-02'! And I have to restore it in a database that ha

[GENERAL] RESTORING A DATABASE WITH DIFFERENT TIMEZONES

2006-12-21 Thread Rodrigo Sakai
Hi all, I'm having some troubles with time zones! I have a database dump file that have the date fields stored as '2006-12-20 00:00:00-02'! And I have to restore it in a database that has the time zone configured as 'BRST' (-3 from GMT). So, when it is restored the value becomes '2006-12-19 2