Re: [GENERAL] problem with pg_restore?

2009-07-23 Thread Greg Stark
On Thu, Jul 23, 2009 at 3:14 PM, Sam Mason wrote:
> On Thu, Jul 23, 2009 at 07:40:18AM -0600, Scott Marlowe wrote:
>> On Tue, Jul 14, 2009 at 5:47 PM, Jim Michaels wrote:
>> > could somebody rewrite pg_dumpall and pg_dump so that it makes editable
>> > dumps?
>> > most programmer's text editors can't handle more than 2000
>> > characters per line. and I want to be able to edit my dumps.

You need to get yourself a better editor.

>> When I need to make changes to large dumps I use tools like sed, awk
>> and diff, not a text editor.
>
> Indeed, but I still like to be able to use a text editor to verify that
> my code is doing the right thing.  Obviously for large files (i.e. a GB
> and over) it's not going to work, but I'd still expect tools to work
> ("less -n" seems to be my tool of choice at the moment).

Actually traditionally tools like sed, awk, etc had fixed-size line
buffers. If your system has a BSD-derived set of tools you may or may
not run into problems depending on whether they've been reimplemented
since. One of the main distinguishing features of the GNU tools was
specifically that they had a policy of choosing implementations that
removed arbitrary limits even if it meant less efficient
implementations.

-- 
greg
http://mit.edu/~gsstark/resume.pdf

-- 
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] problem with pg_restore?

2009-07-23 Thread Sam Mason
On Thu, Jul 23, 2009 at 07:40:18AM -0600, Scott Marlowe wrote:
> On Tue, Jul 14, 2009 at 5:47 PM, Jim Michaels wrote:
> > could somebody rewrite pg_dumpall and pg_dump so that it makes editable
> > dumps?
> > most programmer's text editors can't handle more than 2000
> > characters per line. and I want to be able to edit my dumps.
>
> When I need to make changes to large dumps I use tools like sed, awk
> and diff, not a text editor.

Indeed, but I still like to be able to use a text editor to verify that
my code is doing the right thing.  Obviously for large files (i.e. a GB
and over) it's not going to work, but I'd still expect tools to work
("less -n" seems to be my tool of choice at the moment).

-- 
  Sam  http://samason.me.uk/

-- 
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] problem with pg_restore?

2009-07-23 Thread Scott Marlowe
On Tue, Jul 14, 2009 at 5:47 PM, Jim Michaels wrote:
> I am having problems with pg_restore.  pg_restore
> --file=c:\pg-jmichae3-7-13-2009.sql --verbose --host=localhost --port=5432
> --username=postgres
>
> this just hangs.
> I am restoring from 8.3.7 to 8.4 - what did I do wrong?
>
> could somebody rewrite pg_dumpall and pg_dump so that it makes editable
> dumps?
> most programmer's text editors can't handle more than 2000 characters per
> line.
> and I want to be able to edit my dumps.

When I need to make changes to large dumps I use tools like sed, awk
and diff, not a text editor.

-- 
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] problem with pg_restore?

2009-07-23 Thread Sam Mason
On Thu, Jul 23, 2009 at 10:47:40AM +, Jasen Betts wrote:
> I find that jed is powerful, fast, and reasonably easy to use. and had
> no problem with 2.3MB lines. 
> 
> gnome-text-editor ("gedit") handles lines of tens of thousands of
> characters OK but seems to have problems displaying million character
> lines,
> 
> I expect ther big guns "vim" and "emacs" also have no problems with
> long lines. 

GNU Emacs is fine; just tried with a line consisting of a million copies
of "helloworld " and it was a bit slow with some operations but wasn't
as bad as I was expecting.

-- 
  Sam  http://samason.me.uk/

-- 
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] problem with pg_restore?

2009-07-23 Thread Jasen Betts
On 2009-07-14, Jim Michaels  wrote:
>
> --0-1060148048-1247615236=:84835
> Content-Type: text/plain; charset=us-ascii
>
> I am having problems with pg_restore.  pg_restore 
> --file=c:\pg-jmichae3-7-13-2009.sql --verbose --host=localhost --port=5432 
> --username=postgres
>
> this just hangs.
> I am restoring from 8.3.7 to 8.4 - what did I do wrong?


> could somebody rewrite pg_dumpall and pg_dump so that it makes editable dumps?
> most programmer's text editors can't handle more than 2000 characters per 
> line.

any text editor with a line length limit shorter than 1 megabyte is a
liability.  that said if you dump as inserts there's probably a way to
use sed to split the long strings and still have a loadable dump.

> and I want to be able to edit my dumps.

I find that jed is powerful, fast, and reasonably easy to use. and had
no problem with 2.3MB lines. 

gnome-text-editor ("gedit") handles lines of tens of thousands of
characters OK but seems to have problems displaying million character
lines,

I expect ther big guns "vim" and "emacs" also have no problems with
long lines. 


-- 
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] problem with pg_restore?

2009-07-14 Thread Thomas Kellerer

Jim Michaels, 15.07.2009 01:47:
most programmer's text editors can't handle more than 2000 characters 
per line.

and I want to be able to edit my dumps.


I don't know what you are using, but the following editors can certainly handle 
more than 2000 characters:

OpenSource and free:
http://www.pnotepad.org
http://www.pspad.com
http://notepad-plus.sourceforge.net

Commercial (but not expensive)
http://www.textpad.com

I have edited files with more than 1 characters per line in PNotepad, PSPad 
and Textpad

Thomas


--
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] problem with pg_restore?

2009-07-14 Thread Richard Huxton

Jim Michaels wrote:

I am having problems with pg_restore.  pg_restore 
--file=c:\pg-jmichae3-7-13-2009.sql --verbose --host=localhost --port=5432 
--username=postgres

this just hangs.
I am restoring from 8.3.7 to 8.4 - what did I do wrong?


Well, I don't see a database name, was that just an accident when you 
cut + pasted the line?


If so, do you see any activity at all? If you turn connection logging on 
at the server, does it see any connection attempts?



could somebody rewrite pg_dumpall and pg_dump so that it makes editable dumps?
most programmer's text editors can't handle more than 2000 characters per line.
and I want to be able to edit my dumps.


Might want to get a better editor. Just tried vi with 1000 character 
lines and it's perfectly happy. Can't imagine a proper editor 
complaining. Having said that, once your file gets into the gigabytes 
you'll want more specialised tools (either an on-disk editor or sed/perl).


--
  Richard Huxton
  Archonet Ltd

--
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] problem with pg_restore?

2009-07-14 Thread David Wilson
On Tue, Jul 14, 2009 at 7:47 PM, Jim Michaels wrote:
> could somebody rewrite pg_dumpall and pg_dump so that it makes editable
> dumps?
> most programmer's text editors can't handle more than 2000 characters per
> line.
> and I want to be able to edit my dumps.

You're going to have better luck finding a decent editor than finding
someone to rewrite pg_dump and pg_dumpall just for you.


-- 
- David T. Wilson
david.t.wil...@gmail.com

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


[GENERAL] problem with pg_restore?

2009-07-14 Thread Jim Michaels
I am having problems with pg_restore.  pg_restore 
--file=c:\pg-jmichae3-7-13-2009.sql --verbose --host=localhost --port=5432 
--username=postgres

this just hangs.
I am restoring from 8.3.7 to 8.4 - what did I do wrong?

could somebody rewrite pg_dumpall and pg_dump so that it makes editable dumps?
most programmer's text editors can't handle more than 2000 characters per line.
and I want to be able to edit my dumps.

 


Jim Michaels
jmich...@yahoo.com
http://JesusnJim.com


  

[GENERAL] Problem with pg_restore in windows VISTA

2009-05-07 Thread Anamika Saini
Hello,
I have an problem with using pg_restore in windows VISTA. I created the 
pgpass.conf file and copied it into the APPDATA of user currently logged in. 
The pgpass.conf file has all the rights of postgres service account.
Well its perfectly working on Windows XP but when i try it on VISTA it givex me 
error that ' no password supplied during the pg_restore command'.
Please can some one tell me how it works on VISTA?

I got to know from some post that the file should be under APPDATA of postgres 
service account. Well if the file has full rights of servive account.Still is 
there any need to put it there? and how to access APPDATA of service account?
any suggestions?

Regards,
Anamika



  

Re: [GENERAL] Problem with pg_restore into new database

2008-11-17 Thread Mr. John
Thanks Raymond
"pg_restore.exe"  -h 192.168.1.1 -p 5432 -U postgres -d "postgres"  -C 
"stru.tar"   2>>log_resto.txt 
 echo %errorlevel% >err_resto.txt

created and  restored my database  with the name saved in backup
Thanks a lot.



From: Raymond O'Donnell <[EMAIL PROTECTED]>
To: Mr. John <[EMAIL PROTECTED]>
Cc: pgsql-general@postgresql.org
Sent: Monday, November 17, 2008 1:49:17 PM
Subject: Re: [GENERAL] Problem with pg_restore into new database

On 17/11/2008 11:26, Mr. John wrote:
> I read pg_restore documentation and what I understood is that  using 
> pg_restore.exe with -C will create  the database named in backup archive
> or specified with -d

You have to connect to *some* database, as Postgres doesn't have the
concept of just connecting to the server without connecting to a database.

Postgres has a maintenance database called "postgres" which is empty,
and it's normal to use this for initial connections if you haven't
already got a specific database to work with. In psql, there's a \c
command with changes the database to which you're connected, and you'll
see this command used in the output from pg_dump to connect to the
database being dumped.

HTH,

Ray.


--
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
[EMAIL PROTECTED]
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
--

-- 
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] Problem with pg_restore into new database

2008-11-17 Thread Raymond O'Donnell
On 17/11/2008 11:26, Mr. John wrote:
> I read pg_restore documentation and what I understood is that  using 
> pg_restore.exe with -C will create  the database named in backup archive
> or specified with -d

You have to connect to *some* database, as Postgres doesn't have the
concept of just connecting to the server without connecting to a database.

Postgres has a maintenance database called "postgres" which is empty,
and it's normal to use this for initial connections if you haven't
already got a specific database to work with. In psql, there's a \c
command with changes the database to which you're connected, and you'll
see this command used in the output from pg_dump to connect to the
database being dumped.

HTH,

Ray.


--
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
[EMAIL PROTECTED]
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
--

-- 
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] Problem with pg_restore into new database

2008-11-17 Thread Mr. John
thanks for answer Richard 
I'm new with Postgre,my version is 8.3
I read pg_restore documentation and what I understood is that  using  
pg_restore.exe with -C will create  the database named in backup archive or 
specified with -d
How exactly do I have to run pg_restore to create my database and then restore 
it as in your suggestion no.2
(2. Get pg_restore to create the database for you then switch to it,
while connecting with "-d" to an existing database.)

Thanks.





From: Richard Huxton <[EMAIL PROTECTED]>
To: Mr. John <[EMAIL PROTECTED]>
Cc: pgsql-general@postgresql.org
Sent: Monday, November 17, 2008 12:08:00 PM
Subject: Re: [GENERAL] Problem with pg_restore into new database

Mr. John wrote:
> tanks for reply.
> 
> Why should I connect to a existing database to restore another one ?

How do you issue a "CREATE DATABASE" command without being connected to
something?

> from documentation,pg_restore seems to can do this :
> http://www.postgresql.org/docs/8.0/interactive/app-pgrestore.html

Ideally, you don't want to be running 8.0 on Windows - it was the first
release on that platform and you'll find a lot of improvements if you
can set aside the time to upgrade to a more recent version. If you are
running 8.0, make sure it's 8.0.19 to get all the latest bug fixes.

> -C
> --create
> Create the database before restoring into it. (When this option is
> used, the database named with -d is used only to issue the initial
> CREATE DATABASE command. All data is restored into the database name
> that appears in the archive.) 

> in my first attempt was no -d,no error and
> ... NO database

If you're not connecting to a database, where do you think the output
goes? Hint - it can't be the database server since you're not connected
to a database.

> @echo off
>  "pg_restore.exe"  -h 192.168.1.1 -p 5432 -U postgres  -C -v "stru.tar"   
> 2>>log_resto.txt 
>  echo %errorlevel% >err_resto.txt
> 
> log file is :
> pg_restore: creating DATABASE _struct_fis_
> pg_restore: connecting to new database "_struct_fis_"
> pg_restore: creating SCHEMA pos
> pg_restore: creating SCHEMA public
> pg_restore: creating COMMENT SCHEMA public
> pg_restore: creating PROCEDURAL LANGUAGE plpgsql

At a guess, you can't see STDOUT while you're doing this, can you?

Your options are:

1. Create the database and restore directly into it with "-d"
2. Get pg_restore to create the database for you then switch to it,
while connecting with "-d" to an existing database.
3. Have pg_restore output to STDOUT and pipe that to psql with whatever
connection settings you want (which is just duplicating option 2).

-- 
  Richard Huxton
  Archonet Ltd



  

Re: [GENERAL] Problem with pg_restore into new database

2008-11-17 Thread Richard Huxton
Mr. John wrote:
> tanks for reply.
> 
> Why should I connect to a existing database to restore another one ?

How do you issue a "CREATE DATABASE" command without being connected to
something?

> from documentation,pg_restore seems to can do this :
> http://www.postgresql.org/docs/8.0/interactive/app-pgrestore.html

Ideally, you don't want to be running 8.0 on Windows - it was the first
release on that platform and you'll find a lot of improvements if you
can set aside the time to upgrade to a more recent version. If you are
running 8.0, make sure it's 8.0.19 to get all the latest bug fixes.

> -C
> --create
> Create the database before restoring into it. (When this option is
> used, the database named with -d is used only to issue the initial
> CREATE DATABASE command. All data is restored into the database name
> that appears in the archive.) 

> in my first attempt was no -d,no error and
> ... NO database

If you're not connecting to a database, where do you think the output
goes? Hint - it can't be the database server since you're not connected
to a database.

> @echo off
>  "pg_restore.exe"  -h 192.168.1.1 -p 5432 -U postgres  -C -v "stru.tar"   
> 2>>log_resto.txt 
>  echo %errorlevel% >err_resto.txt
> 
> log file is :
> pg_restore: creating DATABASE _struct_fis_
> pg_restore: connecting to new database "_struct_fis_"
> pg_restore: creating SCHEMA pos
> pg_restore: creating SCHEMA public
> pg_restore: creating COMMENT SCHEMA public
> pg_restore: creating PROCEDURAL LANGUAGE plpgsql

At a guess, you can't see STDOUT while you're doing this, can you?

Your options are:

1. Create the database and restore directly into it with "-d"
2. Get pg_restore to create the database for you then switch to it,
while connecting with "-d" to an existing database.
3. Have pg_restore output to STDOUT and pipe that to psql with whatever
connection settings you want (which is just duplicating option 2).

-- 
  Richard Huxton
  Archonet Ltd

-- 
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] Problem with pg_restore into new database

2008-11-17 Thread Mr. John
tanks for reply.

Why should I connect to a existing database to restore another one ?
from documentation,pg_restore seems to can do this :
http://www.postgresql.org/docs/8.0/interactive/app-pgrestore.html

-C
--create
Create the database before restoring into it.  (When this option is 
used, the database named with -d is used only to issue the initial 
CREATE DATABASE command.  All data is restored into the database name that  
   appears in the archive.) in my first attempt was no -d,no error and ... NO 
database 
@echo off
 "pg_restore.exe"  -h 192.168.1.1 -p 5432 -U postgres  -C -v "stru.tar"   
2>>log_resto.txt 
 echo %errorlevel% >err_resto.txt

log file is :
pg_restore: creating DATABASE _struct_fis_
pg_restore: connecting to new database "_struct_fis_"
pg_restore: creating SCHEMA pos
pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating PROCEDURAL LANGUAGE plpgsql
.







From: Richard Huxton <[EMAIL PROTECTED]>
To: Mr. John <[EMAIL PROTECTED]>
Cc: pgsql-general@postgresql.org
Sent: Monday, November 17, 2008 11:31:28 AM
Subject: Re: [GENERAL] Problem with pg_restore into new database

Mr. John wrote:
> but on the server is no database called _struct_fis_
> err_resto.txt file contents only "0".
> 
> If I add -d
> @echo off
>  "pg_restore.exe"  -h 192.168.1.1 -p 5432 -U postgres -d "_struct_fis_" -C -v 
> "stru.tar"   2>>log_resto.txt 
>  echo %errorlevel% >err_resto.txt
> 
> error is "1" and log file  :
> 
>pg_restore: connecting to database for restore
> pg_restore: [archiver (db)] connection to database "_struct_fis_" failed: 
> FATAL:  database "_struct_fis_" does not exist
> pg_restore: *** aborted because of error

I'm not sure I understand your problem fully, but this is because you
are trying to connect (-d ...) to database _struct_fis_ before it's
created. Connect to a database you know exists (template1 or postgres
for example) and then let the restore create the database.


-- 
  Richard Huxton
  Archonet Ltd

-- 
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] Problem with pg_restore into new database

2008-11-17 Thread Richard Huxton
Mr. John wrote:
> but on the server is no database called _struct_fis_
> err_resto.txt file contents only "0".
> 
> If I add -d
> @echo off
>  "pg_restore.exe"  -h 192.168.1.1 -p 5432 -U postgres -d "_struct_fis_" -C -v 
> "stru.tar"   2>>log_resto.txt 
>  echo %errorlevel% >err_resto.txt
> 
> error is "1" and log file  :
> 
>pg_restore: connecting to database for restore
> pg_restore: [archiver (db)] connection to database "_struct_fis_" failed: 
> FATAL:  database "_struct_fis_" does not exist
> pg_restore: *** aborted because of error

I'm not sure I understand your problem fully, but this is because you
are trying to connect (-d ...) to database _struct_fis_ before it's
created. Connect to a database you know exists (template1 or postgres
for example) and then let the restore create the database.


-- 
  Richard Huxton
  Archonet Ltd

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


[GENERAL] Problem with pg_restore into new database

2008-11-17 Thread Mr. John
Hi.
I use latest version of Postgre in windows XP
I try to restore a database from .tar backup,into a new database.Using EMS 
Manager 
it works fine,my database is creating and restoring succesfully.
My application creates a .bat file and run it,restore is unsuccesfully
 
but file is :

 @echo off
 "pg_restore.exe"  -h 192.168.1.1 -p 5432 -U postgres  -C -v "stru.tar"   
2>>log_resto.txt 
 echo %errorlevel% >err_resto.txt

log file is :
pg_restore: creating DATABASE _struct_fis_
pg_restore: connecting to new database "_struct_fis_"
pg_restore: creating SCHEMA pos
pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating PROCEDURAL LANGUAGE plpgsql
pg_restore: creating TABLE SALI
pg_restore: creating TABLE comenzi
pg_restore: creating TABLE comenzi_desf
pg_restore: creating TABLE mese
pg_restore: creating TABLE operatori
pg_restore: creating TABLE societati
pg_restore: creating SEQUENCE comenzi_desf_idcomanda_seq
pg_restore: executing SEQUENCE SET comenzi_desf_idcomanda_seq
pg_restore: creating SEQUENCE comenzi_desf_poz_seq
pg_restore: creating SEQUENCE OWNED BY comenzi_desf_poz_seq
pg_restore: executing SEQUENCE SET comenzi_desf_poz_seq
pg_restore: creating SEQUENCE comenzi_id_masa_seq
pg_restore: executing SEQUENCE SET comenzi_id_masa_seq
pg_restore: creating SEQUENCE comenzi_id_sala_seq
pg_restore: executing SEQUENCE SET comenzi_id_sala_seq
pg_restore: creating SEQUENCE comenzi_id_seq
pg_restore: creating SEQUENCE OWNED BY comenzi_id_seq
pg_restore: executing SEQUENCE SET comenzi_id_seq
pg_restore: creating SEQUENCE mese_id_sali_seq
pg_restore: executing SEQUENCE SET mese_id_sali_seq
pg_restore: creating SEQUENCE mese_id_seq
pg_restore: executing SEQUENCE SET mese_id_seq
pg_restore: creating SEQUENCE operatori_id_seq
pg_restore: executing SEQUENCE SET operatori_id_seq
pg_restore: creating SEQUENCE sali_id_seq
pg_restore: executing SEQUENCE SET sali_id_seq
pg_restore: creating DEFAULT id
pg_restore: creating DEFAULT poz
pg_restore: restoring data for table "SALI"
pg_restore: restoring data for table "comenzi"
pg_restore: restoring data for table "comenzi_desf"
pg_restore: restoring data for table "mese"
pg_restore: restoring data for table "operatori"
pg_restore: restoring data for table "societati"
pg_restore: creating CONSTRAINT SALI_pkey
pg_restore: creating CONSTRAINT comenzi_desf_IdComanda_key
pg_restore: creating CONSTRAINT comenzi_desf_pkey
pg_restore: creating CONSTRAINT comenzi_id_masa_key
pg_restore: creating CONSTRAINT comenzi_id_sala_key
pg_restore: creating CONSTRAINT comenzi_pkey
pg_restore: creating CONSTRAINT mese_id_Sali_key
pg_restore: creating CONSTRAINT mese_pkey
pg_restore: creating CONSTRAINT operatori_pkey
pg_restore: creating CONSTRAINT societati_pkey
pg_restore: creating FK CONSTRAINT comenzi_desf_fk
pg_restore: creating FK CONSTRAINT comenzi_fk
pg_restore: creating FK CONSTRAINT comenzi_fk1
pg_restore: creating FK CONSTRAINT comenzi_fk2
pg_restore: creating FK CONSTRAINT mese_fk
pg_restore: setting owner and privileges for DATABASE _struct_fis_
pg_restore: setting owner and privileges for SCHEMA pos
pg_restore: setting owner and privileges for SCHEMA public
pg_restore: setting owner and privileges for COMMENT SCHEMA public
pg_restore: setting owner and privileges for ACL public
pg_restore: setting owner and privileges for PROCEDURAL LANGUAGE plpgsql
pg_restore: setting owner and privileges for TABLE SALI
pg_restore: setting owner and privileges for TABLE comenzi
pg_restore: setting owner and privileges for TABLE comenzi_desf
pg_restore: setting owner and privileges for TABLE mese
pg_restore: setting owner and privileges for TABLE operatori
pg_restore: setting owner and privileges for TABLE societati
pg_restore: setting owner and privileges for SEQUENCE comenzi_desf_idcomanda_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_desf_poz_seq
pg_restore: setting owner and privileges for SEQUENCE OWNED BY 
comenzi_desf_poz_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_id_masa_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_id_sala_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_id_seq
pg_restore: setting owner and privileges for SEQUENCE OWNED BY comenzi_id_seq
pg_restore: setting owner and privileges for SEQUENCE mese_id_sali_seq
pg_restore: setting owner and privileges for SEQUENCE mese_id_seq
pg_restore: setting owner and privileges for SEQUENCE operatori_id_seq
pg_restore: setting owner and privileges for SEQUENCE sali_id_seq
pg_restore: setting owner and privileges for DEFAULT id
pg_restore: setting owner and privileges for DEFAULT poz
pg_restore: setting owner and privileges for CONSTRAINT SALI_pkey
pg_restore: setting owner and privileges for CONSTRAINT 
comenzi_desf_IdComanda_key
pg_restore: setting owner and privileges for CONSTRAINT comenzi_desf_pkey
pg_restore: setting owner and privileges for CONSTRAINT comenzi_id_masa_key
pg_restore: setting owner and privileges 

[GENERAL] problem with pg_restore

2006-05-19 Thread jayati . biswas
I am working with postgres 8.0.3 on suse linux 9.3.I want to restore data
from pg_dump backup.Previously it was working fine with the same dump.
But now it is giving the following error...

pg_restore: [archiver (db)] could not execute query: ERROR:  relation
"sw_4904.operatorjob" does not exist
Command was: ALTER TABLE sw_4904.operatorjob OWNER TO postgres;
pg_restore: creating TABLE operatorjobhistory
pg_restore: [archiver (db)] Error from TOC entry 7577; 1259 11430376 TABLE
operatorjobhistory postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  could not
create directory "/usr/local/pgsql/data/pg_tblspc/17231/108986168": No
such file or directory
Command was: CREATE TABLE operatorjobhistory (
operatorid integer DEFAULT 0 NOT NULL,
operatorlotid integer DEFAULT 0 NOT NULL,
 ...
pg_restore: [archiver (db)] could not execute query: ERROR:  relation
"sw_4904.operatorjobhistory" does not exist
Command was: ALTER TABLE sw_4904.operatorjobhistory OWNER TO postgres;
pg_restore: creating TABLE operatorlotmaster
pg_restore: [archiver (db)] Error from TOC entry 7573; 1259 11430364 TABLE
operatorlotmaster postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  could not
create directory "/usr/local/pgsql/data/pg_tblspc/17231/108986168": No
such file or directory
Command was: CREATE TABLE operatorlotmaster (
operatorlotid serial NOT NULL,
createdtime timestamp without time zone,
current...
pg_restore: [archiver (db)] could not execute query: ERROR:  relation
"sw_4904.operatorlotmaster" does not exist
Command was: ALTER TABLE sw_4904.operatorlotmaster OWNER TO postgres;
pg_restore: executing SEQUENCE SET operatorlotmaster_operatorlotid_seq
pg_restore: [archiver (db)] Error from TOC entry 19889; 0 0 SEQUENCE SET
operatorlotmaster_operatorlotid_seq postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  relation
"operatorlotmaster" does not exist
Command was: SELECT
pg_catalog.setval(pg_catalog.pg_get_serial_sequence('operatorlotmaster',
'operatorlotid'), 40, true);
pg_restore: creating TABLE samplelotmaster
pg_restore: [archiver (db)] Error from TOC entry 7575; 1259 11430371 TABLE
samplelotmaster postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  could not
create directory "/usr/local/pgsql/data/pg_tblspc/17231/108986168": No
such file or directory
Command was: CREATE TABLE samplelotmaster (
samplelotid serial NOT NULL,
createdtime timestamp without time zone,
createdby b...
pg_restore: [archiver (db)] could not execute query: ERROR:  relation
"sw_4904.samplelotmaster" does not exist
Command was: ALTER TABLE sw_4904.samplelotmaster OWNER TO postgres;
pg_restore: executing SEQUENCE SET samplelotmaster_samplelotid_seq
pg_restore: [archiver (db)] Error from TOC entry 19890; 0 0 SEQUENCE SET
samplelotmaster_samplelotid_seq postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  relation
"samplelotmaster" does not exist
Command was: SELECT
pg_catalog.setval(pg_catalog.pg_get_serial_sequence('samplelotmaster',
'samplelotid'), 5, true);
pg_restore: creating TABLE samplelotqcone
pg_restore: [archiver (db)] Error from TOC entry 7578; 1259 11430382 TABLE
samplelotqcone postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  could not
create directory "/usr/local/pgsql/data/pg_tblspc/17231/108986168": No
such file or directory
Command was: CREATE TABLE samplelotqcone (
imagedetailid bigint DEFAULT 0 NOT NULL,
defectstatus smallint DEFAULT 0 NOT NULL,
   ...
pg_restore: [archiver (db)] could not execute query: ERROR:  relation
"sw_4904.samplelotqcone" does not exist
Command was: ALTER TABLE sw_4904.samplelotqcone OWNER TO postgres;
pg_restore: creating TABLE sampleoperatorjob
pg_restore: [archiver (db)] Error from TOC entry 7579; 1259 11430388 TABLE
sampleoperatorjob postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  could not
create directory "/usr/local/pgsql/data/pg_tblspc/17231/108986168": No
such file or directory
Command was: CREATE TABLE sampleoperatorjob (
operatorid bigint DEFAULT 0 NOT NULL,
samplelotid smallint DEFAULT 0 NOT NULL,
...





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


Re: [GENERAL] problem with pg_restore

2004-10-05 Thread Tom Lane
Alexander Cohen <[EMAIL PROTECTED]> writes:
> pg_restore -d  -C -v -U  

> It keeps on telling me that the database  does not exist so it 
> cant connect to it. I thought the -C flag creates the database, what am 
> i missing here?

It does, but you have to connect somewhere first so you can issue the
CREATE DATABASE command.  I think the common approach is to use "-d template1"
in combination with -C.

regards, tom lane

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


[GENERAL] problem with pg_restore

2004-10-05 Thread Alexander Cohen
I cant seem to get pg_restore to work for me.
here's how im calling it:
pg_restore -d  -C -v -U  
It keeps on telling me that the database  does not exist so it 
cant connect to it. I thought the -C flag creates the database, what am 
i missing here?

Thanks
Alex
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


[GENERAL] problem with pg_restore and user privileges

2004-09-16 Thread Stefano Bonnin



Hi, I'm a Postgis user, and I have a problem 
restoring data from 7.4 to 8.0.0beta2.
 
I use the postgis_restore.pl script that comes with 
postgis distribution.
 
I do the following for the dump:

pg_dump -Fc mydb 
>mydb.sql
 
and the script does the following restore 
operations:



... some commands ...
open( PSQL, "| ./psql -a dbname") || die "Can't run 
psql\n"; 
... pg_restore -l mydb.sql 
>dump.list
 
... some commands ..
 
something like:
 
.. pg_restore -L dump.list 
mydb.sql
 

... some commands ..
 
It seems to work except for the user privileges. At 
the end, no user privileges are restored in the new database
 
My doubt is the following:
pg_restore -l mydb.sql >dump.list
 
dump the privileges information in the dump.list 
file or not?
some hints?
Thanks
Reds