pg.ddx.io  pgsql-novice@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_restore error
7+ messages / 4 participants
[nested] [flat]

* pg_restore error
@ 2002-09-06 19:08 ` Curtis Mortensen <shakiro2@yahoo.com>
  2002-09-06 22:50   ` Re: pg_restore error Giles Lean <giles@nemeton.com.au>
  1 sibling, 1 reply; 7+ messages in thread

From: Curtis Mortensen @ 2002-09-06 19:08 UTC (permalink / raw)
  To: pgsql-novice

I've tried searching the archives for a solution to this, but I was unable
to find it.  So, I hope you'll forgive my newbie question if it's been asked
before.  I'm trying to backup a database on our company's server.  First I
create the backup (pg_dump [databasename] > backup.dump) then I create a new
database [databasename2].  When I try to move the dump to the new database
(pg_restore [databasenam2] < backup.dump) it gives me this error:

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

I get the same even if I give the absolute path for backup.dump.  I assume
that postgres is looking somewhere else for my file, but being fairly new to
SQL, I don't know where that is or where to find out.  So, any help or hints
you could give me would be appreciated.

Thanks,

Curtis Mortensen




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

* Re: pg_restore error
  2002-09-06 19:08 ` pg_restore error Curtis Mortensen <shakiro2@yahoo.com>
@ 2002-09-06 22:50   ` Giles Lean <giles@nemeton.com.au>
  0 siblings, 0 replies; 7+ messages in thread

From: Giles Lean @ 2002-09-06 22:50 UTC (permalink / raw)
  To: Curtis Mortensen <shakiro2@yahoo.com>; +Cc: pgsql-novice


Curtis Mortensen asked:

> When I try to move the dump to the new database
> (pg_restore [databasenam2] < backup.dump) it gives me this error:
> 
> pg_restore: [archiver] could not open input file: No such file or directory

To specify the database name to restore to, you want the --dbname option:

$ pg_restore --dbname=databasenam2 < backup.dump

Regards,

Giles



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

* Re: pg_restore error
@ 2002-09-07 02:34 ` Giles Lean <giles@nemeton.com.au>
  1 sibling, 0 replies; 7+ messages in thread

From: Giles Lean @ 2002-09-07 02:34 UTC (permalink / raw)
  To: Curtis Mortensen <shakiro2@yahoo.com>; +Cc: pgsql-novice


Hi Curtis,

> thanks for the advice.  i now have a different error. :(

I suspected you would, but without knowing the commands you were using
decided guessing would only be confusing!  Only the archive formats
from pg_dump are intended to be used with pg_restore.  The default
output can be restored by psql:

$ pg_dump fubar > fubar.sql
$ createdb fubar2
CREATE DATABASE
$ psql fubar2 < fubar.sql
You are now connected as new user giles.
CREATE
$

$ pg_dump --format=c fubar > fubar.dump
$ createdb fubar2
CREATE DATABASE
$ pg_restore --dbname=fubar2 < fubar.dump
pg_restore: [archiver] WARNING:
  Data restoration may fail because existing triggers cannot be disabled
  (no superuser user name specified).  This is only a problem when
  restoring into a database with already existing triggers.
$

Regards,

Giles




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

* Re: pg_restore error
@ 2002-09-09 21:54 Curtis Mortensen <shakiro2@yahoo.com>
  2002-09-11 21:51 ` Re: pg_restore error Curtis Mortensen <shakiro2@yahoo.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Curtis Mortensen @ 2002-09-09 21:54 UTC (permalink / raw)
  To: pgsql-novice

I finally got a chance to try out your suggestions, but it seems that
something I'm doing is still wrong.

When I try the first method described below, I get this error:

You are now connected as new user postgres.
ERROR:  function plpgsql_call_handler already exists with same argument
types
ERROR:  Language plpgsql already exists
\connect: FATAL 1:  IDENT authentication failed for user "cmortensen"

When I try the other method, I get this error:

pg_restore: [archiver (db)] could not execute query: ERROR:  function
plpgsql_call_handler already exists with same argument types

I get the impression that the problem is deeper than just trying to backup,
but being a very green novice to Postgres, I'm not sure where to start
tracking the problem to its source...

Thanks for all your help so far :)
  -------- Original Message --------

Hi Curtis,

> thanks for the advice.  i now have a different error. :(

I suspected you would, but without knowing the commands you were using
decided guessing would only be confusing!  Only the archive formats
from pg_dump are intended to be used with pg_restore.  The default
output can be restored by psql:

$ pg_dump fubar > fubar.sql
$ createdb fubar2
CREATE DATABASE
$ psql fubar2 < fubar.sql
You are now connected as new user giles.
CREATE
$

$ pg_dump --format=c fubar > fubar.dump
$ createdb fubar2
CREATE DATABASE
$ pg_restore --dbname=fubar2 < fubar.dump
pg_restore: [archiver] WARNING:
  Data restoration may fail because existing triggers cannot be disabled
  (no superuser user name specified).  This is only a problem when
  restoring into a database with already existing triggers.
$

Regards,

Giles

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

* Re: pg_restore error
  2002-09-09 21:54 Re: pg_restore error Curtis Mortensen <shakiro2@yahoo.com>
@ 2002-09-11 21:51 ` Curtis Mortensen <shakiro2@yahoo.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Curtis Mortensen @ 2002-09-11 21:51 UTC (permalink / raw)
  To: pgsql-novice

In case anyone else was following my problem and wanted to know how to
resolve it, I'll post what the solution was...

I had a bunch of '/connect user' commands in my dump file causing the ident
authentication errors.  I took those out and the plpgsql stuff that I didn't
need in the dump, and that restored everything fine to a new database,
except that none of my web applications could get in.  That was when i
realized that I'd left out the authorization stuff in pg_hba.conf.  When I
added that, everything worked great.

  -----Original Message-----
  From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Curtis Mortensen
  Sent: Monday, September 09, 2002 3:55 PM
  To: pgsql-novice@postgresql.org
  Subject: Re: [NOVICE] pg_restore error


  I finally got a chance to try out your suggestions, but it seems that
something I'm doing is still wrong.

  When I try the first method described below, I get this error:

  You are now connected as new user postgres.
  ERROR:  function plpgsql_call_handler already exists with same argument
types
  ERROR:  Language plpgsql already exists
  \connect: FATAL 1:  IDENT authentication failed for user "cmortensen"

  When I try the other method, I get this error:

  pg_restore: [archiver (db)] could not execute query: ERROR:  function
plpgsql_call_handler already exists with same argument types

  I get the impression that the problem is deeper than just trying to
backup, but being a very green novice to Postgres, I'm not sure where to
start tracking the problem to its source...

  Thanks for all your help so far :)
    -------- Original Message --------

Hi Curtis,

> thanks for the advice.  i now have a different error. :(

I suspected you would, but without knowing the commands you were using
decided guessing would only be confusing!  Only the archive formats
from pg_dump are intended to be used with pg_restore.  The default
output can be restored by psql:

$ pg_dump fubar > fubar.sql
$ createdb fubar2
CREATE DATABASE
$ psql fubar2 < fubar.sql
You are now connected as new user giles.
CREATE
$

$ pg_dump --format=c fubar > fubar.dump
$ createdb fubar2
CREATE DATABASE
$ pg_restore --dbname=fubar2 < fubar.dump
pg_restore: [archiver] WARNING:
  Data restoration may fail because existing triggers cannot be disabled
  (no superuser user name specified).  This is only a problem when
  restoring into a database with already existing triggers.
$

Regards,

Giles

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

* pg_restore error
@ 2026-05-18 11:57 Subramanian,Ramachandran <ramachandran.subramanian@alte-leipziger.de>
  2026-05-18 23:38 ` Re: pg_restore error Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 7+ messages in thread

From: Subramanian,Ramachandran @ 2026-05-18 11:57 UTC (permalink / raw)
  To: pgsql-novice@lists.postgresql.org <pgsql-novice@lists.postgresql.org>

Hello,

  I received a file to be restored into a new box.

I tried to do a psql -f   and postgres asked me to use pg_restore instead.


Then I used pg_restore and got this error message.

pg_restore -c -v -f Restore.out Cameleon_ewt_20260512.sql

pg_restore: error: unsupported version (1.16) in file header


I am running postgres 16.13 .

How should I handle this issue?

Would be grateful for your inputs.


LG

Ram



[postgres@lx90189 postgresql]$ head -10 Cameleon_ewt_20260512.sql
PGDM7
~data16.8 (Debian 16.8-1.pgdg120+1)18.1?'%[0ENCODINENCODINGSET client_encoding = 'UTF8';
false&[00
STDSTRINGS
STDSTRINGS(SET standard_conforming_strings = 'on';
false'[00
SEARCHPATH
SEARCHPATH8SELECT pg_catalog.set_config('search_path', '', false);
false([126221992datDATABASEoCREATE DATABASE data WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE_PROVIDER = libc LOCALE = 'en_US.utf8';
DROP DATABASE data;                                                                                                                                                                                postgresfalse'26154653312197261SCHEMACREATE SCHEMA "2197261";
[postgres@lx90189 postgresql]$ xtermxtermxtermxtermxterm


Freundliche Grüße

i. A. Ramachandran Subramanian
Zentralbereich Informationstechnologie

Alte Leipziger Lebensversicherung a.G.


Hallesche Krankenversicherung a.G.





Alte Leipziger Lebensversicherung a.G., Alte Leipziger-Platz 1, 61440 Oberursel
Vors. des Aufsichtsrats: Dr. Walter Botermann · Vorstand: Christoph Bohn (Vors.), Dr. Jürgen Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Jochen Kriegmeier, Alexander Mayer, Christian Pape, Wiltrud Pekarek, Udo Wilcsek
Sitz Oberursel (Taunus) · Rechtsform VVaG · Amtsgericht Bad Homburg v. d. H. HRB 1583 · USt.-IdNr. DE 114106814





 
Hallesche Krankenversicherung a.G.,  Löffelstraße 34-38, 70597 Stuttgart
Vors. des Aufsichtsrats: Dr. Walter Botermann · Vorstand: Christoph Bohn (Vors.), Dr. Jürgen Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Jochen Kriegmeier, Alexander Mayer, Christian Pape,
Wiltrud Pekarek, Udo Wilcsek
Sitz Stuttgart · Rechtsform VVaG · Amtsgericht Stuttgart HRB 2686 · USt.-IdNr. DE 147802285
Beiträge zu privaten Kranken- und Pflegekrankenversicherungen unterliegen nicht der Versicherungsteuer (§ 4 Nr. 5 VersStG) · Versicherungsleistungen sowie Umsätze aus Versicherungsvertreter-/Maklertätigkeiten sind umsatzsteuerfrei
 



 
Die Pflichtangaben der ALH Gruppe gemäß § 35a GmbHG bzw. § 80 AktG finden Sie hier: https://www.alte-leipziger.de/impressum 





______________________

ALH Gruppe
Alte Leipziger-Platz 1, 61440 Oberursel
Tel.: +49 (6171) 66-4882
Fax: +49 (6171) 66-800-4882
E-Mail: ramachandran.subramanian@alte-leipziger.de
www.alte-leipziger.de
www.hallesche.de

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

* Re: pg_restore error
  2026-05-18 11:57 pg_restore error Subramanian,Ramachandran <ramachandran.subramanian@alte-leipziger.de>
@ 2026-05-18 23:38 ` Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 7+ messages in thread

From: Laurenz Albe @ 2026-05-18 23:38 UTC (permalink / raw)
  To: Subramanian,Ramachandran <ramachandran.subramanian@alte-leipziger.de>; pgsql-novice@lists.postgresql.org <pgsql-novice@lists.postgresql.org>

On Mon, 2026-05-18 at 11:57 +0000, Subramanian,Ramachandran wrote:
> Then I used pg_restore and got this error message.
>  
> pg_restore -c -v -f Restore.out Cameleon_ewt_20260512.sql
>  
> pg_restore: error: unsupported version (1.16) in file header
>  
> I am running postgres 16.13 . 

Archive version 1.16 was introduced in PostgreSQL v17, so you need
to use at least that version to restore the dump.

Yours,
Laurenz Albe





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


end of thread, other threads:[~2026-05-18 23:38 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-09-06 19:08 ` Curtis Mortensen <shakiro2@yahoo.com>
2002-09-06 22:50   ` Giles Lean <giles@nemeton.com.au>
2002-09-07 02:34 ` Giles Lean <giles@nemeton.com.au>
2002-09-09 21:54 Re: pg_restore error Curtis Mortensen <shakiro2@yahoo.com>
2002-09-11 21:51 ` Curtis Mortensen <shakiro2@yahoo.com>
2026-05-18 11:57 pg_restore error Subramanian,Ramachandran <ramachandran.subramanian@alte-leipziger.de>
2026-05-18 23:38 ` Laurenz Albe <laurenz.albe@cybertec.at>

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