Re: [GENERAL] How to restore

2015-08-09 Thread Andomar
> > If I have taken any backup successfully through pg_dump? How can I restore > this pg_dump(Sql file) without use of pg_restore. > You can send the file to psql, the command line client: psql yourdb < yourbackup.sql Or: cat yourbackup.sql | psql yourdb Kind regards, Andomar --

Re: [GENERAL] How to restore

2015-08-09 Thread Guillaume Lelarge
Please keep the list in your answers. Le 10 août 2015 7:51 AM, "Sachin Srivastava" a écrit : > > Dear Guillaume, > > What is the syntax of this (psql), kindy confirm. > That can be: psql -f the_file the_database > Regards, > Sachin > > On Mon, Aug 10, 2015 at 11:18 AM, Guillaume Lelarge < guill

Re: [GENERAL] How to restore

2015-08-09 Thread Michael Paquier
On Mon, Aug 10, 2015 at 2:41 PM, Sachin Srivastava wrote: > Dear Team, > > If I have taken any backup successfully through pg_dump? How can I restore > this pg_dump(Sql file) without use of pg_restore. > There is any command line option or through psql, kindly inform to me. The way to restore a b

Re: [GENERAL] How to restore

2015-08-09 Thread Guillaume Lelarge
Hi, Le 10 août 2015 7:43 AM, "Sachin Srivastava" a écrit : > > Dear Team, > > If I have taken any backup successfully through pg_dump? How can I restore this pg_dump(Sql file) without use of pg_restore. > > There is any command line option or through psql, kindly inform to me. > If it's an SQL f

[GENERAL] How to restore

2015-08-09 Thread Sachin Srivastava
Dear Team, If I have taken any backup successfully through pg_dump? How can I restore this pg_dump(Sql file) without use of pg_restore. There is any command line option or through psql, kindly inform to me. Regards, Sachin

Re: [GENERAL] How to restore backup database

2014-09-08 Thread klo uo
On Mon, Sep 8, 2014 at 8:10 PM, Adrian Klaver wrote: > > You do not have to create a database in Postgres either. There are some > system databases already created for you, template0(read only best left > alone), template1 and postgres. You can connect to one of these(best > practices, use postgre

Re: [GENERAL] How to restore backup database

2014-09-08 Thread Adrian Klaver
On 09/08/2014 10:49 AM, klo uo wrote: Hi Adrian, I used pgAdmin backup command. However in the meantime I figured how to restore. I first have to create database, and then use restore option which becomes available if I right-click on a database. On MSSQL for example, I can restore database with

Re: [GENERAL] How to restore backup database

2014-09-08 Thread klo uo
Hi Adrian, I used pgAdmin backup command. However in the meantime I figured how to restore. I first have to create database, and then use restore option which becomes available if I right-click on a database. On MSSQL for example, I can restore database without creating database first, and I guess

Re: [GENERAL] How to restore backup database

2014-09-08 Thread Adrian Klaver
On 09/08/2014 09:04 AM, klo uo wrote: Hi, I use PostrgrSQL 9.3 for couple of months now, on Windows. I installed new Window OS, and before installing, I made tar backups of my PostgreSQL databases. What was the command you used? Now I want to restore these on my new OS, but I can't find such

[GENERAL] How to restore backup database

2014-09-08 Thread klo uo
Hi, I use PostrgrSQL 9.3 for couple of months now, on Windows. I installed new Window OS, and before installing, I made tar backups of my PostgreSQL databases. Now I want to restore these on my new OS, but I can't find such option in pgAdmin. In documentation (http://www.postgresql.org/docs/9.3/

Re: [GENERAL] How to restore some DBs to a new server?

2013-09-13 Thread John R Pierce
On 9/13/2013 2:03 PM, Bob Futrelle wrote: Running on my MacBook Pro, pgAdmin3 tells me I have four servers in "Server Groups", all local, no network involved. I have dumped two of my DBs from a current server using pg_dump. Then in pgAdmin3 I created another server, let's call it "New". I woul

[GENERAL] How to restore some DBs to a new server?

2013-09-13 Thread Bob Futrelle
Running on my MacBook Pro, pgAdmin3 tells me I have four servers in "Server Groups", all local, no network involved. I have dumped two of my DBs from a current server using pg_dump. Then in pgAdmin3 I created another server, let's call it "New". I would like to look at these earlier DBs while not

Re: [GENERAL] How to restore the table space tar files created by pg_basebackup?

2011-12-01 Thread Magnus Hagander
It will be that if you have the tablespaces in the actual directories. The question is how and why you ended up with the tablespaces in the actual directories there, and not symlinks. It seems rather pointless to have tablespaces if they go in there... //Magnus On Thu, Dec 1, 2011 at 13:35, Samba

Re: [GENERAL] How to restore the table space tar files created by pg_basebackup?

2011-12-01 Thread Samba
Hi Venkat, I verified that the tablespaces are located in actual directories and not any symbolic links. Another interesting thing is that the content in these additional tar.gz files is already present in the base.tar.gz file. Regards, Samba --

Re: [GENERAL] How to restore the table space tar files created by pg_basebackup?

2011-11-30 Thread Venkat Balaji
Do you have Tablespace directories with a softlink to the data directory ? Thanks VB On Wed, Nov 30, 2011 at 7:42 PM, Samba wrote: > Hi all, > > I have taken a base backup of my master server using pg_basebackup command > as below: > pg_basebackup -D /tmp/PostgresBackup/ -Ft -Z 9 -l masterback

[GENERAL] How to restore the table space tar files created by pg_basebackup?

2011-11-30 Thread Samba
Hi all, I have taken a base backup of my master server using pg_basebackup command as below: pg_basebackup -D /tmp/PostgresBackup/ -Ft -Z 9 -l masterbackup -h localhost -U replication -w The above created 4 tar files, namely: 16394.tar.gz 16395.tar.gz 16396.tar.gz base.tar.gz I do know that

Re: [GENERAL] How to restore a SQL-ASCII encoded database to a new UTF-8 db?

2011-10-09 Thread skmanji
You can do this by converting the characters in raw dump file directly. iconv -f 8859_1 -t UTF-8 backup.db.psql > backup.db.psql.utf8 Then convert the line in backup.db.psql.utf8 from: SET client_encoding = 'SQL_ASCII'; to: SET client_encoding = 'UTF8'; -- View this message in context: http:/

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Tom Lane
Adrian Klaver writes: > On 12/16/2010 08:47 AM, Andrus Moor wrote: >>> Loading a dump file into an older server may require manual editing of >>> the dump file to remove syntax not understood by the older server. " >> pg_restore ignores erros during restore (it only returns exit code 1). >> So "m

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Adrian Klaver
On 12/16/2010 08:47 AM, Andrus Moor wrote: Loading a dump file into an older server may require manual editing of the dump file to remove syntax not understood by the older server. " pg_restore ignores erros during restore (it only returns exit code 1). So "manual editing of the dump file to re

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Alban Hertroys
On 16 Dec 2010, at 9:16, Andrus Moor wrote: > How to fix this without distributing two copies of pg_dump/pg_restore ? > Is it reasonable to create database and plpgsql language manually before > running pg_restore ? In Are you sure that restoring dumps to your customers' sites is the best appro

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Andrus Moor
Loading a dump file into an older server may require manual editing of the dump file to remove syntax not understood by the older server. " pg_restore ignores erros during restore (it only returns exit code 1). So "manual editing of the dump file to remove syntax not understood" is never requi

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Adrian Klaver
On Thursday 16 December 2010 12:16:47 am Andrus Moor wrote: > > Another testimonial to the stability of Postgres :) > > We may be arguing semantics > > here but I would consider dump/restore an admin function. How do you > > handle a > > client restoring a database currently? > > Database is 8.0 co

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Robert Gravsjö
On 2010-12-16 11.21, Jayadevan M wrote: Hello, I don't know for sure, but I don't see why it should fail - it's only reading it, not writing data to it or making any changes. Probably it will fail... http://www.postgresql.org/docs/9.0/static/sql-createdatabase.html Although it is possible to

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Robert Gravsjö
On 2010-12-16 11.12, Andrus Moor wrote: Robert, I'm probably misunderstanding but "CREATE DATABASE foo TEMPLATE bar" will clone bar as foo including data. Of course this only works within the same cluster. Than you. You are genious I haven't never tought about this. Will this work if datab

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Jayadevan M
Hello, > I don't know for sure, but I don't see why it should fail - it's only > reading it, not writing data to it or making any changes. Probably it will fail... http://www.postgresql.org/docs/9.0/static/sql-createdatabase.html Although it is possible to copy a database other than template1 by

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Raymond O'Donnell
On 16/12/2010 10:12, Andrus Moor wrote: Robert, I'm probably misunderstanding but "CREATE DATABASE foo TEMPLATE bar" will clone bar as foo including data. Of course this only works within the same cluster. Than you. You are genious I haven't never tought about this. Will this work if databas

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Andrus Moor
Robert, I'm probably misunderstanding but "CREATE DATABASE foo TEMPLATE bar" will clone bar as foo including data. Of course this only works within the same cluster. Than you. You are genious I haven't never tought about this. Will this work if database bar is accessed by other users ? Proba

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Robert Gravsjö
On 2010-12-16 09.16, Andrus Moor wrote: Another requirement is to clone existing database in server with data. I posted question about it and it seems that PostgreSql does not have any capability to do this in server side in plpgsql fast. I'm probably misunderstanding but "CREATE DATABASE f

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-16 Thread Andrus Moor
Another testimonial to the stability of Postgres :) We may be arguing semantics here but I would consider dump/restore an admin function. How do you handle a client restoring a database currently? Database is 8.0 compliant. In this case 8.4 pg_dump/pg_restore is used to dump and restore with a

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Adrian Klaver
On Wednesday 15 December 2010 11:55:24 am Andrus Moor wrote: > > I got to thinking more about this. How are the databases administered? In > > other > > words how are they started/stopped, upgraded, logs read, etc? > > Databases are working many years in 24x7 mode without administration. > For ever

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Guillaume Lelarge
Le 15/12/2010 17:26, Adrian Klaver a écrit : > On 12/15/2010 07:34 AM, Andrus Moor wrote: >>> No, this is just pilot error. Any version of pg_dump will produce >>> output that is meant to be loaded into the matching server version >>> (or a later version). If you are intending to load back into 8.4

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Andrus Moor
I got to thinking more about this. How are the databases administered? In other words how are they started/stopped, upgraded, logs read, etc? Databases are working many years in 24x7 mode without administration. For every new new site newest PostgreSql was installed. Andrus. -- Sent via pg

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Tom Lane
"Andrus Moor" writes: >> No, this is just pilot error. Any version of pg_dump will produce >> output that is meant to be loaded into the matching server version >> (or a later version). If you are intending to load back into 8.4, >> use the 8.4 pg_dump. > Windows application needs to support ba

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Adrian Klaver
On Wednesday 15 December 2010 8:43:18 am Andrus Moor wrote: > > Why does it have that requirement? And why doesn't it use the pg_dump > > that came with the server? It seems pretty lame to assume that your app > > has to provide pg_dump and not any other part of the Postgres > > installation. > >

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Adrian Klaver
On 12/15/2010 08:43 AM, Andrus Moor wrote: Why does it have that requirement? And why doesn't it use the pg_dump that came with the server? It seems pretty lame to assume that your app has to provide pg_dump and not any other part of the Postgres installation. Application is like pg_admin. It i

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Andrus Moor
Why does it have that requirement? And why doesn't it use the pg_dump that came with the server? It seems pretty lame to assume that your app has to provide pg_dump and not any other part of the Postgres installation. Application is like pg_admin. It is typical client application which is used

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Adrian Klaver
On 12/15/2010 07:34 AM, Andrus Moor wrote: No, this is just pilot error. Any version of pg_dump will produce output that is meant to be loaded into the matching server version (or a later version). If you are intending to load back into 8.4, use the 8.4 pg_dump. You may have been reading the rec

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Andrus Moor
No, this is just pilot error. Any version of pg_dump will produce output that is meant to be loaded into the matching server version (or a later version). If you are intending to load back into 8.4, use the 8.4 pg_dump. You may have been reading the recommendation to use the later version's pg_

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Tom Lane
"Andrus Moor" writes: > I used only 9.0 dump and restore. I did the following: > 1. Created backup copy from 8.4.3 using 9.0 pg_dump > 2. Restored from this backup to 8.4.3 using 9.0 pg_restore > 9.0 pg_restore fails since 8.4.3 server reports invalid sql command in > create > language plpgsql

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Andrus Moor
Adrian, thank you. I am not sure I follow. Are you taking a pg_dump of a 9.0 database using a 9.0 version of pg_dump and trying to restore to a 8.4.3 database or are using the 9.0 pg_dump against the 8.4.3 server and then restoring back to it? In either case the problem you see above will proba

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Adrian Klaver
On Wednesday 15 December 2010 1:29:09 am Andrus Moor wrote: > Server is > > PostgreSQL 8.4.3 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian > 4.3.2-1.1) 4.3.2, 32-bit > > Backup is created using 9.0RC pg_dump.exe file > > Trying to restore from this backup to same server using 9.0RC >

Re: [GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread tuanhoanganh
You can test restore by change CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql; to CREATE PROCEDURAL LANGUAGE plpgsql; Tuan Hoang Anh 2010/12/15 Andrus Moor > Server is > > PostgreSQL 8.4.3 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian > 4.3.2-1.1) 4.3.2, 32-bit > > Backup is created

[GENERAL] How to restore from backup to 8.4.3 server using 9.0 dump/restore

2010-12-15 Thread Andrus Moor
Server is PostgreSQL 8.4.3 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2, 32-bit Backup is created using 9.0RC pg_dump.exe file Trying to restore from this backup to same server using 9.0RC pg_restore.exe causes error "..\pg_dump\pg_restore.exe" -h mysite.com -U

Re: [GENERAL] How to restore "postgres" database?

2010-10-01 Thread Craig Ringer
On 10/01/2010 10:40 PM, Alexander Farber wrote: Ouch! I've loaded my backup while being connected to the wrong database - to the dafeult "postgres" database. Is there a way to restore it? Sure. Just drop it and re-create it. The "postgres" database is just a convenience, and is typically empt

[GENERAL] How to restore "postgres" database?

2010-10-01 Thread Alexander Farber
Ouch! I've loaded my backup while being connected to the wrong database - to the dafeult "postgres" database. Is there a way to restore it? I currently have: postgres=# \l List of databases Name| Owner | Encoding ---+--+-- postgres | postgres | UTF8 ph

Re: [GENERAL] How to restore a Plan from a stored plan text?

2010-09-04 Thread Tom Lane
sunpeng writes: > Thanks for your help!The motivation is that I try to find the most used sub > plan ,and cach the sub plan's execution result and store sub plan itself on > disk. Even the sub plan's connection is closed, the consequent connection > with the same sub plan could utilize the stored

Re: [GENERAL] How to restore a Plan from a stored plan text?

2010-09-03 Thread sunpeng
Thanks for your help!The motivation is that I try to find the most used sub plan ,and cach the sub plan's execution result and store sub plan itself on disk. Even the sub plan's connection is closed, the consequent connection with the same sub plan could utilize the stored cached result. For examp

Re: [GENERAL] How to restore a Plan from a stored plan text?

2010-09-03 Thread Tom Lane
sunpeng writes: > I've used the following codes to translate the PlannedStmt node to a char > string: > PlannedStmt * pltl = (PlannedStmt *) linitial(plantree_list); > Plan *pl = pltl->planTree; > char *s; > s = nodeToString(pl); > How to restore from this s to Plan? You can't. The fact

[GENERAL] How to restore a Plan from a stored plan text?

2010-09-03 Thread sunpeng
I've used the following codes to translate the PlannedStmt node to a char string: PlannedStmt * pltl = (PlannedStmt *) linitial(plantree_list); Plan *pl = pltl->planTree; char *s; s = nodeToString(pl); How to restore from this s to Plan? I noticed using func parseNodeString() in /backends/

Re: [GENERAL] How to restore a SQL-ASCII encoded database to a new UTF-8 db?

2009-05-22 Thread Tommy Gildseth
Postgres User wrote: Hi, I have a database that was created with SQL-ASCII encoding (unfortunately). I ran pg_restore to load the struct and data into a new database with UTF-8 encoding but no surprise- I'm seeing this error for a number of tables: pg_restore: [archiver (db)] COPY failed: ERRO

Re: [GENERAL] How to restore a SQL-ASCII encoded database to a new UTF-8 db?

2009-05-21 Thread Albe Laurenz
> I have a database that was created with SQL-ASCII encoding > (unfortunately). I ran pg_restore to load the struct and data into a > new database with UTF-8 encoding but no surprise- I'm seeing this > error for a number of tables: > > pg_restore: [archiver (db)] COPY failed: ERROR: invalid byte

[GENERAL] How to restore a SQL-ASCII encoded database to a new UTF-8 db?

2009-05-21 Thread Postgres User
Hi, I have a database that was created with SQL-ASCII encoding (unfortunately). I ran pg_restore to load the struct and data into a new database with UTF-8 encoding but no surprise- I'm seeing this error for a number of tables: pg_restore: [archiver (db)] COPY failed: ERROR: invalid byte sequen

[GENERAL] How to restore my database ?

2007-08-27 Thread Franck Roubieu - AXCENTEO
Hello, We tried many things but didn’t succeed. Our DB crashed without any recent backup. We have 3 elements: - a backup we did in February, - 4 WAL files in the pg_xlog folder created in august, - the “base” folder (in which there are table files created in august) Q1 : Is it possible to cop

Re: [GENERAL] How to restore a dumbed file in postgreSQL

2006-11-25 Thread Yesh
Thanks for ur help guys. -- View this message in context: http://www.nabble.com/How-to-restore-a-dumbed-file-in-postgreSQL-tf2695735.html#a7535475 Sent from the PostgreSQL - general mailing list archive at Nabble.com. ---(end of broadcast)--- TI

Re: [GENERAL] How to restore a dumbed file in postgreSQL

2006-11-24 Thread Raymond O'Donnell
On 23 Nov 2006 at 20:13, Yesh wrote: > I am a newbie to postgreSQL. I need to know the command for > restoring a database that has been dumped. I am using postgreSQL8.1 If you dumped using the text format, simply use the resulting dumpfile as input to psql, something like this - psql -f - a

Re: [GENERAL] How to restore a dumbed file in postgreSQL

2006-11-24 Thread Richard Broersma Jr
> I am a newbie to postgreSQL. I need to know the command for restoring a > database that has been dumped. I am using postgreSQL8.1 version & am > running in windows environment. See. http://www.postgresql.org/docs/8.2/interactive/backup-dump.html#BACKUP-DUMP-RESTORE Also, you will find a weal

[GENERAL] How to restore a dumbed file in postgreSQL

2006-11-24 Thread Yesh
Hi, I am a newbie to postgreSQL. I need to know the command for restoring a database that has been dumped. I am using postgreSQL8.1 version & am running in windows environment. -- View this message in context: http://www.nabble.com/How-to-restore-a-dumbed-file-in-postgreSQL-tf2695735.html#a