4

I tried this command

pg_restore -U postgres -d test1  table4.dump

and got error

pg_restore: [archiver] input file appears to be a text format dump. Please use psql.

How to restore the dump file?

krist
  • 4,357
  • 2
  • 9
  • 11

1 Answers1

0

You have dumped the table in plain sql format which was designed to feed to psql.

This is not recognized by pg_restore! -> doc on pg_restore

For whole db:

cat db.txt | psql dbname

or

psql dbname < db.txt

for table:

connect to the db using psql:

psql /i path/to/filename

will help..

EDIT/UPDATE:

You asked for AWS redshift - here's the solution:

Sign in to the AWS Management Console and open the Amazon Redshift console at https://console.aws.amazon.com/redshift/

  • Choose Clusters
  • Choose the Table restore tab
  • Choose Restore table.
  • In the Table restore panel, select a date range that contains the cluster snapshot that you want to restore from.
iLuvLogix
  • 5,920
  • 3
  • 26
  • 43