pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_restore problem
9+ messages / 6 participants
[nested] [flat]

* pg_restore problem
@ 2005-02-02 20:17  Bradley Miller <bmiller@nuvio.com>
  0 siblings, 2 replies; 9+ messages in thread

From: Bradley Miller @ 2005-02-02 20:17 UTC (permalink / raw)
  To: pgsql-sql

I'm attempting to restore a dump from one server to another (one is a 
Mac and one is a Linux base, if that makes any difference).  I keep 
running into issues like this:

pg_restore: [archiver (db)] could not execute query: ERROR:  function 
public.random_page_link_id_gen() does not exist

This is what I'm using to restore the files with:

pg_restore -O -x -s -N -d nuvio mac_postgres_2_2_2005_13_24

Any suggestions on how to get around this problem?  It's a huge pain so 
far just to sync my two servers up.

Bradley Miller
NUVIO CORPORATION
Phone: 816-444-4422 ext. 6757
Fax: 913-498-1810
http://www.nuvio.com
bmiller@nuvio.com

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_restore problem
@ 2005-02-02 20:46  Joel Fradkin <jfradkin@wazagua.com>
  parent: Bradley Miller <bmiller@nuvio.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Joel Fradkin @ 2005-02-02 20:46 UTC (permalink / raw)
  To: pgsql-sql

I used pgadmin to save and mine would not restore saying something about the
encoding.

I will have to be able to save and restore reliably as well.

 

Also I never heard anything further on the query running slow (I put up
table defs and analyze with and without seq on).

I am running into this on several of my views (I guess I am not too bright,
because I still don't get why it chooses seq scan on indexed tables).

I can force it to use index and did see a little improvement, but the MSSQL
was 3 secs and Postgres was like 9.

Seeing as how I got the one viw to return faster (it was very complex view)
on postgres, my guess is I still have stuff to do. I did try changing the
cost to a lower number in config and redid my analyze, but it was still
trying to do a seq scan.

 

Joel Fradkin

 

Wazagua, Inc.
2520 Trailmate Dr
Sarasota, Florida 34243
Tel.  941-753-7111 ext 305

 

jfradkin@wazagua.com
www.wazagua.com
Powered by Wazagua
Providing you with the latest Web-based technology & advanced tools.
C 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc
 This email message is for the use of the intended recipient(s) and may
contain confidential and privileged information.  Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and delete and destroy
all copies of the original message, including attachments.

 


 

-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]
On Behalf Of Bradley Miller
Sent: Wednesday, February 02, 2005 3:17 PM
To: Postgres List
Subject: [SQL] pg_restore problem

 

I'm attempting to restore a dump from one server to another (one is a Mac
and one is a Linux base, if that makes any difference). I keep running into
issues like this:

pg_restore: [archiver (db)] could not execute query: ERROR: function
public.random_page_link_id_gen() does not exist

This is what I'm using to restore the files with:

pg_restore -O -x -s -N -d nuvio mac_postgres_2_2_2005_13_24 

Any suggestions on how to get around this problem? It's a huge pain so far
just to sync my two servers up.

Bradley Miller
NUVIO CORPORATION
Phone: 816-444-4422 ext. 6757
Fax: 913-498-1810
http://www.nuvio.com
bmiller@nuvio.com

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_restore problem
@ 2005-02-02 21:24  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Bradley Miller <bmiller@nuvio.com>
  1 sibling, 1 reply; 9+ messages in thread

From: Tom Lane @ 2005-02-02 21:24 UTC (permalink / raw)
  To: Bradley Miller <bmiller@nuvio.com>; +Cc: pgsql-sql

Bradley Miller <bmiller@nuvio.com> writes:
> I'm attempting to restore a dump from one server to another (one is a 
> Mac and one is a Linux base, if that makes any difference).  I keep 
> running into issues like this:

> pg_restore: [archiver (db)] could not execute query: ERROR:  function 
> public.random_page_link_id_gen() does not exist

Is this a problem of items in the dump being in the wrong order (ie,
there's a forward reference to random_page_link_id_gen())?

> Any suggestions on how to get around this problem?

Use 8.0 ... or use pg_restore's -L/-l options to manually adjust the
load order.  Pre-8.0 versions of pg_dump are easily fooled if you use
ALTER to make earlier-created objects reference later-created objects.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_restore problem
@ 2005-02-03 14:16  Bradley Miller <bmiller@nuvio.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 9+ messages in thread

From: Bradley Miller @ 2005-02-03 14:16 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql

So in the current version I'm running (7.4.6) and I do a pg_dump I have 
to then manually manipulate the order by doing a -l to get a table of 
contents and then reorder (just changing the first number; or the oid 
also??) just to get it to work right?   Does anyone else have these 
issues?  How exactly can I use this on a mission critical app with 
flaws like this?   How do other people work with this?  Do they just 
not dump the files and restore?


On Feb 2, 2005, at 3:24 PM, Tom Lane wrote:

> Bradley Miller <bmiller@nuvio.com> writes:
>> I'm attempting to restore a dump from one server to another (one is a
>> Mac and one is a Linux base, if that makes any difference).  I keep
>> running into issues like this:
>
>> pg_restore: [archiver (db)] could not execute query: ERROR:  function
>> public.random_page_link_id_gen() does not exist
>
> Is this a problem of items in the dump being in the wrong order (ie,
> there's a forward reference to random_page_link_id_gen())?
>
>> Any suggestions on how to get around this problem?
>
> Use 8.0 ... or use pg_restore's -L/-l options to manually adjust the
> load order.  Pre-8.0 versions of pg_dump are easily fooled if you use
> ALTER to make earlier-created objects reference later-created objects.
>
> 			regards, tom lane
>
>
Bradley Miller
NUVIO CORPORATION
Phone: 816-444-4422 ext. 6757
Fax: 913-498-1810
http://www.nuvio.com
bmiller@nuvio.com

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_restore problem
@ 2005-02-03 15:25  Richard Huxton <dev@archonet.com>
  parent: Bradley Miller <bmiller@nuvio.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Richard Huxton @ 2005-02-03 15:25 UTC (permalink / raw)
  To: Bradley Miller <bmiller@nuvio.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-sql

Bradley Miller wrote:
> So in the current version I'm running (7.4.6) and I do a pg_dump I have 
> to then manually manipulate the order by doing a -l to get a table of 
> contents and then reorder (just changing the first number; or the oid 
> also??) just to get it to work right?   Does anyone else have these 
> issues?  How exactly can I use this on a mission critical app with flaws 
> like this?   How do other people work with this?  Do they just not dump 
> the files and restore?

The problem(s) are only apparent if you define/redefine objects in a 
certain order. I've tended to encounter them on databases where I've 
extensively reworked elements (particularly functions/views). In 
particular, dumping a restored database always seems OK for me.

With the -l file, you just need to cut & paste the lines into the 
correct order. In practice, I tend to just move half-a-dozen lines to 
the end of the file to get things to work. The crucial bit then is to 
make sure you keep a backup copy of the working order somewhere - you 
have no idea how often I've deleted the file as soon as I've finished 
restoring.

Of course, if you have dynamic functions in say perl/tcl and then base 
views on them there's probably no way for pg_dump to ever figure out the 
correct dependencies.

--
   Richard Huxton
   Archonet Ltd



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_restore problem
@ 2005-02-03 19:04  Bradley Miller <bmiller@nuvio.com>
  parent: Richard Huxton <dev@archonet.com>
  0 siblings, 0 replies; 9+ messages in thread

From: Bradley Miller @ 2005-02-03 19:04 UTC (permalink / raw)
  To: pgsql-sql

Interestingly, I made a new database on my test server and then was 
able to do a pg_dump from my mac box to the test server and I think it 
got just about everything . . . I've got some constraint issues and 
other oddities happening, but at least my functions came in fine.  I 
used the pipe command to pipe it directly to the server rather than 
using pg_restore.


Bradley Miller
NUVIO CORPORATION
Phone: 816-444-4422 ext. 6757
Fax: 913-498-1810
http://www.nuvio.com
bmiller@nuvio.com

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* pg_restore problem
@ 2012-09-12 07:23  Kjell Øygard <kjellinge.oygard@ecc.no>
  0 siblings, 1 reply; 9+ messages in thread

From: Kjell Øygard @ 2012-09-12 07:23 UTC (permalink / raw)
  To: pgsql-sql

Morning guys...

I have two servers , one with postgres 9.2rc1 and one with postgres 9.1.4.
I need to do a restore from a dump from 9.1.4 to 9.2rc1 and I get this
error:

pg_restore: [archiver (db)] Error from TOC entry 177675; 2613 579519 BLOB
579519 primar
pg_restore: [archiver (db)] could not execute query: ERROR:  duplicate key
value violates unique constraint "pg_largeobject_metadata_oid_index"
DETAIL:  Key (oid)=(579519) already exists.
    Command was: SELECT pg_catalog.lo_create('579519');

This just keep repeat itself in the log.

The command used is: pg_restore -O -U user -d  database2 database2.dump
>dump.log 2>&1 &

Appreciate any help

-- 
Rgds
Kjell Inge Øygard
Electronic Chart Centre
www.ecc.no

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_restore problem
@ 2012-09-13 13:46  Adrian Klaver <adrian.klaver@gmail.com>
  parent: Kjell Øygard <kjellinge.oygard@ecc.no>
  0 siblings, 1 reply; 9+ messages in thread

From: Adrian Klaver @ 2012-09-13 13:46 UTC (permalink / raw)
  To: Kjell Øygard <kjellinge.oygard@ecc.no>; +Cc: pgsql-sql

On 09/12/2012 12:23 AM, Kjell Øygard wrote:
> Morning guys...
>
> I have two servers , one with postgres 9.2rc1 and one with postgres
> 9.1.4. I need to do a restore from a dump from 9.1.4 to 9.2rc1 and I get
> this error:
>
> pg_restore: [archiver (db)] Error from TOC entry 177675; 2613 579519
> BLOB 579519 primar
> pg_restore: [archiver (db)] could not execute query: ERROR:  duplicate
> key value violates unique constraint "pg_largeobject_metadata_oid_index"
> DETAIL:  Key (oid)=(579519) already exists.
>      Command was: SELECT pg_catalog.lo_create('579519');
>
> This just keep repeat itself in the log.
>
> The command used is: pg_restore -O -U user -d  database2 database2.dump
>  >dump.log 2>&1 &
>
> Appreciate any help

Several things:
1) The production version of 9,2 is out(9.2.0).
2) When you did the dump from 9.1.4 did you use the 9.1.4 or 9.2 version 
of pg_dump?
3) What was the pg_dump command you used?

>
> --
> Rgds
> Kjell Inge Øygard
> Electronic Chart Centre
> www.ecc.no <http://www.ecc.no;
>


-- 
Adrian Klaver
adrian.klaver@gmail.com




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: pg_restore problem
@ 2012-09-14 14:58  Adrian Klaver <adrian.klaver@gmail.com>
  parent: Adrian Klaver <adrian.klaver@gmail.com>
  0 siblings, 0 replies; 9+ messages in thread

From: Adrian Klaver @ 2012-09-14 14:58 UTC (permalink / raw)
  To: Kjell Øygard <kjellinge.oygard@ecc.no>; +Cc: pgsql-sql

On 09/14/2012 01:58 AM, Kjell Øygard wrote:
> 1 - Ok, I was not aware of that....
> 2 -  I used version 9.1.4 of pg_dump
> 3 - The command was in a script, se below
>
> pdir=/usr/local/postgresql-9.1.4/
> bdir=/backup/`hostname -s`/dump/
> export PATH=${pdir}/bin:$PATH
>
> # make sure tmp files are not readable by others
> umask 0077
>
> for db in `psql -l -t -h localhost | awk '{print $1}' |grep -v
> template|grep -v postgres`
> do
>    pg_dump -h localhost -F c -Z -b $db > ${bdir}/${db}.tmp && mv
> ${bdir}/${db}.tmp ${bdir}/${db}.dump

I do not see anything obviously wrong.
Two suggestions.
1) Use the 9.2 version of pg_dump. Newer versions know about changes in 
data handling and are also backward compatible(to 7.0).
2) As of 8.3(I believe) the -b switch is redundant for whole database dumps.

When you do the above dump are there large objects in the 9.2 database 
in spite of the errors?

>
>
> rgds Kjell Inge Ø
>



-- 
Adrian Klaver
adrian.klaver@gmail.com




^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2012-09-14 14:58 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-02 20:17 pg_restore problem Bradley Miller <bmiller@nuvio.com>
2005-02-02 20:46 ` Joel Fradkin <jfradkin@wazagua.com>
2005-02-02 21:24 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-02-03 14:16   ` Bradley Miller <bmiller@nuvio.com>
2005-02-03 15:25     ` Richard Huxton <dev@archonet.com>
2005-02-03 19:04       ` Bradley Miller <bmiller@nuvio.com>
2012-09-12 07:23 pg_restore problem Kjell Øygard <kjellinge.oygard@ecc.no>
2012-09-13 13:46 ` Adrian Klaver <adrian.klaver@gmail.com>
2012-09-14 14:58   ` Adrian Klaver <adrian.klaver@gmail.com>

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