pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_restore is not working
15+ messages / 5 participants
[nested] [flat]

* pg_restore is not working
@ 2023-10-24 16:43  M Sarwar <sarwarmd02@outlook.com>
  0 siblings, 2 replies; 15+ messages in thread

From: M Sarwar @ 2023-10-24 16:43 UTC (permalink / raw)
  To: pgsql-admin



Hi,

Restore is having no errors but it is not restoring any data.
I have used the below command pg_dump
pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP

I am using the below command for the restore.

PS H:\> pg_restore -F t -v -h bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
pg_restore: connecting to database for restore
Password:
pg_restore: implied data-only restore
PS H:\>

Thanks,
Sarwar

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

* Re: pg_restore is not working
@ 2023-10-24 16:56  Scott Ribe <scott_ribe@elevated-dev.com>
  parent: M Sarwar <sarwarmd02@outlook.com>
  1 sibling, 1 reply; 15+ messages in thread

From: Scott Ribe @ 2023-10-24 16:56 UTC (permalink / raw)
  To: M Sarwar <sarwarmd02@outlook.com>; +Cc: pgsql-admin

> On Oct 24, 2023, at 10:43 AM, M Sarwar <sarwarmd02@outlook.com> wrote:
> 
>  
> Hi,
> 
> Restore is having no errors but it is not restoring any data.
> I have used the below command pg_dump
> pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
> 
> I am using the below command for the restore.
> 
> PS H:\> pg_restore -F t -v -h bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
> pg_restore: connecting to database for restore
> Password:
> pg_restore: implied data-only restore
> PS H:\>
> 
> Thanks,
> Sarwar 

You're missing the -f on the pg_restore to take the dump from a file, so it's sitting waiting for SQL to come via stdin.





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

* Re: pg_restore is not working
@ 2023-10-24 17:02  M Sarwar <sarwarmd02@outlook.com>
  parent: Scott Ribe <scott_ribe@elevated-dev.com>
  0 siblings, 1 reply; 15+ messages in thread

From: M Sarwar @ 2023-10-24 17:02 UTC (permalink / raw)
  To: Scott Ribe <scott_ribe@elevated-dev.com>; +Cc: pgsql-admin

Hi Scott,
When I tried to add -f in the pg_restore clause, it is generating error.
I tried to use another clause --file=file-name which is also generating errors.


PS H:\> pg_restore -F t -v -h bronxdb1.c52p1f6zjuib.us-gov-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' --file=C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP

pg_restore: error: options -d/--dbname and -f/--file cannot be used together

Try "pg_restore --help" for more information.

PS H:\>

Thanks,
Sarwar

________________________________
From: Scott Ribe <scott_ribe@elevated-dev.com>
Sent: Tuesday, October 24, 2023 12:56 PM
To: M Sarwar <sarwarmd02@outlook.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: pg_restore is not working

> On Oct 24, 2023, at 10:43 AM, M Sarwar <sarwarmd02@outlook.com> wrote:
>
>
> Hi,
>
> Restore is having no errors but it is not restoring any data.
> I have used the below command pg_dump
> pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
>
> I am using the below command for the restore.
>
> PS H:\> pg_restore -F t -v -h bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
> pg_restore: connecting to database for restore
> Password:
> pg_restore: implied data-only restore
> PS H:\>
>
> Thanks,
> Sarwar

You're missing the -f on the pg_restore to take the dump from a file, so it's sitting waiting for SQL to come via stdin.


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

* RE: pg_restore is not working
@ 2023-10-24 17:05  Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>
  parent: M Sarwar <sarwarmd02@outlook.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Wetmore, Matthew (CTR) @ 2023-10-24 17:05 UTC (permalink / raw)
  To: M Sarwar <sarwarmd02@outlook.com>; Scott Ribe <scott_ribe@elevated-dev.com>; +Cc: pgsql-admin

Pg_restore …blah.. < dumpfile.sql

From: M Sarwar <sarwarmd02@outlook.com>
Sent: Tuesday, October 24, 2023 10:03 AM
To: Scott Ribe <scott_ribe@elevated-dev.com>
Cc: pgsql-admin@postgresql.org
Subject: [EXTERNAL] Re: pg_restore is not working

Hi Scott,
When I tried to add -f in the pg_restore clause, it is generating error.
I tried to use another clause --file=file-name which is also generating errors.


PS H:\> pg_restore -F t -v -h bronxdb1.c52p1f6zjuib.us-gov-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' --file=C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP

pg_restore: error: options -d/--dbname and -f/--file cannot be used together

Try "pg_restore --help" for more information.

PS H:\>

Thanks,
Sarwar

________________________________
From: Scott Ribe <scott_ribe@elevated-dev.com<mailto:scott_ribe@elevated-dev.com>>
Sent: Tuesday, October 24, 2023 12:56 PM
To: M Sarwar <sarwarmd02@outlook.com<mailto:sarwarmd02@outlook.com>>
Cc: pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org> <pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>>
Subject: Re: pg_restore is not working

> On Oct 24, 2023, at 10:43 AM, M Sarwar <sarwarmd02@outlook.com<mailto:sarwarmd02@outlook.com>> wrote:
>
>
> Hi,
>
> Restore is having no errors but it is not restoring any data.
> I have used the below command pg_dump
> pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
>
> I am using the below command for the restore.
>
> PS H:\> pg_restore -F t -v -h bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
> pg_restore: connecting to database for restore
> Password:
> pg_restore: implied data-only restore
> PS H:\>
>
> Thanks,
> Sarwar

You're missing the -f on the pg_restore to take the dump from a file, so it's sitting waiting for SQL to come via stdin.


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

* Re: pg_restore is not working
@ 2023-10-24 17:08  Ron <ronljohnsonjr@gmail.com>
  parent: M Sarwar <sarwarmd02@outlook.com>
  1 sibling, 1 reply; 15+ messages in thread

From: Ron @ 2023-10-24 17:08 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

On 10/24/23 11:43, M Sarwar wrote:
>
> Hi,
>
> Restore is having no errors but it is not restoring any data.
> I have used the below command pg_dump
> pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com 
> -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f 
> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
>

Why "-Ft" instead of "-Fc" for a .dump file?

> I am using the below command for the restore.
>
> PS H:\> pg_restore -F t -v -h 
> bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d 
> bronxdb1 -t 'bronxdev.errors' 
> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
> pg_restore: connecting to database for restore
> Password:
> pg_restore: implied data-only restore
> PS H:\>
>
> Thanks,
> Sarwar
>

-- 
Born in Arizona, moved to Babylonia.

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

* Re: pg_restore is not working
@ 2023-10-24 17:18  M Sarwar <sarwarmd02@outlook.com>
  parent: Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>
  0 siblings, 1 reply; 15+ messages in thread

From: M Sarwar @ 2023-10-24 17:18 UTC (permalink / raw)
  To: Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>; Scott Ribe <scott_ribe@elevated-dev.com>; +Cc: pgsql-admin

Hi Matt,
I tried this approach. It is generating error when I am using the format of < filename with pg_restore.

Database location: aws/rds
Client where I am running pg-dump and pg-restore is from Windows  laptop.

Thanks,
Sarwar

________________________________
From: Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>
Sent: Tuesday, October 24, 2023 1:05 PM
To: M Sarwar <sarwarmd02@outlook.com>; Scott Ribe <scott_ribe@elevated-dev.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: RE: pg_restore is not working


Pg_restore …blah.. < dumpfile.sql



From: M Sarwar <sarwarmd02@outlook.com>
Sent: Tuesday, October 24, 2023 10:03 AM
To: Scott Ribe <scott_ribe@elevated-dev.com>
Cc: pgsql-admin@postgresql.org
Subject: [EXTERNAL] Re: pg_restore is not working



Hi Scott,

When I tried to add -f in the pg_restore clause, it is generating error.

I tried to use another clause --file=file-name which is also generating errors.



PS H:\> pg_restore -F t -v -h bronxdb1.c52p1f6zjuib.us-gov-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' --file=C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP

pg_restore: error: options -d/--dbname and -f/--file cannot be used together

Try "pg_restore --help" for more information.

PS H:\>



Thanks,

Sarwar



________________________________

From: Scott Ribe <scott_ribe@elevated-dev.com<mailto:scott_ribe@elevated-dev.com>>
Sent: Tuesday, October 24, 2023 12:56 PM
To: M Sarwar <sarwarmd02@outlook.com<mailto:sarwarmd02@outlook.com>>
Cc: pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org> <pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>>
Subject: Re: pg_restore is not working



> On Oct 24, 2023, at 10:43 AM, M Sarwar <sarwarmd02@outlook.com<mailto:sarwarmd02@outlook.com>> wrote:
>
>
> Hi,
>
> Restore is having no errors but it is not restoring any data.
> I have used the below command pg_dump
> pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
>
> I am using the below command for the restore.
>
> PS H:\> pg_restore -F t -v -h bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
> pg_restore: connecting to database for restore
> Password:
> pg_restore: implied data-only restore
> PS H:\>
>
> Thanks,
> Sarwar

You're missing the -f on the pg_restore to take the dump from a file, so it's sitting waiting for SQL to come via stdin.


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

* Re: pg_restore is not working
@ 2023-10-24 17:24  M Sarwar <sarwarmd02@outlook.com>
  parent: Ron <ronljohnsonjr@gmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: M Sarwar @ 2023-10-24 17:24 UTC (permalink / raw)
  To: Ron <ronljohnsonjr@gmail.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Hi Ron,

I did try using -Fc clause. pg_dump is running fine but pg_restore is having the same issue.
I tried once again now after seeing your email and getting the same scenario.


Pg_Dump:-

PS H:\> pg_dump -Fc -v -h sharded -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

Password:



Pg_dump ran fine.



Pg_Restore:-



PS H:\> pg_restore -v -h sharded  -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

pg_restore: connecting to database for restore

Password:

pg_restore: implied data-only restore

PS H:\> pg_restore -Fc -v -h sharded  -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

pg_restore: connecting to database for restore

Password:

pg_restore: implied data-only restore

PS H:\>



It has no errors but it did not restore the data.

Thanks,
Sarwar

________________________________
From: Ron <ronljohnsonjr@gmail.com>
Sent: Tuesday, October 24, 2023 1:08 PM
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: pg_restore is not working

On 10/24/23 11:43, M Sarwar wrote:


Hi,

Restore is having no errors but it is not restoring any data.
I have used the below command pg_dump
pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP

Why "-Ft" instead of "-Fc" for a .dump file?


I am using the below command for the restore.

PS H:\> pg_restore -F t -v -h bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
pg_restore: connecting to database for restore
Password:
pg_restore: implied data-only restore
PS H:\>

Thanks,
Sarwar



--
Born in Arizona, moved to Babylonia.

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

* RE: pg_restore is not working
@ 2023-10-24 17:25  Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>
  parent: M Sarwar <sarwarmd02@outlook.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Wetmore, Matthew (CTR) @ 2023-10-24 17:25 UTC (permalink / raw)
  To: M Sarwar <sarwarmd02@outlook.com>; Scott Ribe <scott_ribe@elevated-dev.com>; +Cc: pgsql-admin

In AWS you need to use –dbname, not –d.

AWS postgres is their own, they have rewritten Postgres to their needs, you need to use AWS Postgres commands, not regular Postgres command.  Some work, some don’t.

Best practices for migrating PostgreSQL databases to Amazon RDS and Amazon Aurora | AWS Database Blog<https://aws.amazon.com/blogs/database/best-practices-for-migrating-postgresql-databases-to-amazon-rd...;

From: M Sarwar <sarwarmd02@outlook.com>
Sent: Tuesday, October 24, 2023 10:18 AM
To: Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>; Scott Ribe <scott_ribe@elevated-dev.com>
Cc: pgsql-admin@postgresql.org
Subject: [EXTERNAL] Re: pg_restore is not working

Hi Matt,
I tried this approach. It is generating error when I am using the format of < filename with pg_restore.

Database location: aws/rds
Client where I am running pg-dump and pg-restore is from Windows  laptop.

Thanks,
Sarwar

________________________________
From: Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com<mailto:Matthew.Wetmore@express-scripts.com>>
Sent: Tuesday, October 24, 2023 1:05 PM
To: M Sarwar <sarwarmd02@outlook.com<mailto:sarwarmd02@outlook.com>>; Scott Ribe <scott_ribe@elevated-dev.com<mailto:scott_ribe@elevated-dev.com>>
Cc: pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org> <pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>>
Subject: RE: pg_restore is not working


Pg_restore …blah.. < dumpfile.sql



From: M Sarwar <sarwarmd02@outlook.com<mailto:sarwarmd02@outlook.com>>
Sent: Tuesday, October 24, 2023 10:03 AM
To: Scott Ribe <scott_ribe@elevated-dev.com<mailto:scott_ribe@elevated-dev.com>>
Cc: pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>
Subject: [EXTERNAL] Re: pg_restore is not working



Hi Scott,

When I tried to add -f in the pg_restore clause, it is generating error.

I tried to use another clause --file=file-name which is also generating errors.



PS H:\> pg_restore -F t -v -h bronxdb1.c52p1f6zjuib.us-gov-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' --file=C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP

pg_restore: error: options -d/--dbname and -f/--file cannot be used together

Try "pg_restore --help" for more information.

PS H:\>



Thanks,

Sarwar



________________________________

From: Scott Ribe <scott_ribe@elevated-dev.com<mailto:scott_ribe@elevated-dev.com>>
Sent: Tuesday, October 24, 2023 12:56 PM
To: M Sarwar <sarwarmd02@outlook.com<mailto:sarwarmd02@outlook.com>>
Cc: pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org> <pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>>
Subject: Re: pg_restore is not working



> On Oct 24, 2023, at 10:43 AM, M Sarwar <sarwarmd02@outlook.com<mailto:sarwarmd02@outlook.com>> wrote:
>
>
> Hi,
>
> Restore is having no errors but it is not restoring any data.
> I have used the below command pg_dump
> pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
>
> I am using the below command for the restore.
>
> PS H:\> pg_restore -F t -v -h bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
> pg_restore: connecting to database for restore
> Password:
> pg_restore: implied data-only restore
> PS H:\>
>
> Thanks,
> Sarwar

You're missing the -f on the pg_restore to take the dump from a file, so it's sitting waiting for SQL to come via stdin.


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

* Re: pg_restore is not working
@ 2023-10-24 17:34  Michael Banck <mbanck@gmx.net>
  parent: Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>
  0 siblings, 0 replies; 15+ messages in thread

From: Michael Banck @ 2023-10-24 17:34 UTC (permalink / raw)
  To: Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>; +Cc: M Sarwar <sarwarmd02@outlook.com>; Scott Ribe <scott_ribe@elevated-dev.com>; pgsql-admin

Hi,

On Tue, Oct 24, 2023 at 05:25:02PM +0000, Wetmore, Matthew (CTR) wrote:
> In AWS you need to use –dbname, not –d.

-d is the short option for the --dbname long option:

|$ LANG=C pg_restore --help | grep dbname
|  -d, --dbname=NAME        connect to database name


Michael





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

* Re: pg_restore is not working
@ 2023-10-24 17:56  Ron <ronljohnsonjr@gmail.com>
  parent: M Sarwar <sarwarmd02@outlook.com>
  0 siblings, 2 replies; 15+ messages in thread

From: Ron @ 2023-10-24 17:56 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On 10/24/23 12:24, M Sarwar wrote:
> Hi Ron,
>
> I did try using -Fc clause. pg_dump is running fine but pg_restore is 
> having the same issue.
> I tried once again now after seeing your email and getting the same scenario.
>
> Pg_Dump:-
>
> PS H:\> pg_dump -Fc -v -h*/sharded/*-U db_sarwar -d NGBRDVDB -t 
> 'bronxdev.errors' -f 
> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP
>
> Password:
>
> Pg_dump ran fine.
>
> Pg_Restore:-
>
> PS H:\> pg_restore -v -h*/sharded/* -U db_sarwar -d bronxdb1 -t 
> 'bronxdev.errors' 
> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP
>
> pg_restore: connecting to database for restore
>
> Password:
>
> pg_restore: implied data-only restore
>
> PS H:\> pg_restore -Fc -v -h*/sharded/* -U db_sarwar -d bronxdb1 -t 
> 'bronxdev.errors' 
> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP
>
> pg_restore: connecting to database for restore
>
> Password:
>
> pg_restore: implied data-only restore
>
> PS H:\>
>
> It has no errors but it did not restore the data.
>

This works for me.  I just tested it.  You'll have to convert from bash to 
Windows.

SrcHost=somehost
DescHost=anotherhost

SrcDir=/var/lib/pgsql/backups/test

SrcDB=somedb

DestDB=anotherdb

Tbl=public.job

pg_dump --host=$SrcHost -Fc -t $Tbl -v -d ${SrcDB} -f $SrcDir/${Tbl}.dump

pg_restore --host=$DestHost -v -d ${DestDB} ${SrcDir}/${Tbl}.dump

> Thanks,
> Sarwar
>
> ----------------------------------------------------------------------------
> *From:* Ron <ronljohnsonjr@gmail.com>
> *Sent:* Tuesday, October 24, 2023 1:08 PM
> *To:* pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
> *Subject:* Re: pg_restore is not working
> On 10/24/23 11:43, M Sarwar wrote:
>>
>> Hi,
>>
>> Restore is having no errors but it is not restoring any data.
>> I have used the below command pg_dump
>> pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com 
>> -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f 
>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
>>
>
> Why "-Ft" instead of "-Fc" for a .dump file?
>
>> I am using the below command for the restore.
>>
>> PS H:\> pg_restore -F t -v -h 
>> bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d 
>> bronxdb1 -t 'bronxdev.errors' 
>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
>> pg_restore: connecting to database for restore
>> Password:
>> pg_restore: implied data-only restore
>> PS H:\>
>>
>> Thanks,
>> Sarwar
>>
>
> -- 
> Born in Arizona, moved to Babylonia.

-- 
Born in Arizona, moved to Babylonia.

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

* Re: pg_restore is not working
@ 2023-10-24 18:28  M Sarwar <sarwarmd02@outlook.com>
  parent: Ron <ronljohnsonjr@gmail.com>
  1 sibling, 0 replies; 15+ messages in thread

From: M Sarwar @ 2023-10-24 18:28 UTC (permalink / raw)
  To: Ron <ronljohnsonjr@gmail.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Hi Ron,
This issue has got resolved.
I will share my findings in the next email.
Thanks,
Sarwar

________________________________
From: Ron <ronljohnsonjr@gmail.com>
Sent: Tuesday, October 24, 2023 1:56 PM
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: pg_restore is not working

On 10/24/23 12:24, M Sarwar wrote:
Hi Ron,

I did try using -Fc clause. pg_dump is running fine but pg_restore is having the same issue.
I tried once again now after seeing your email and getting the same scenario.


Pg_Dump:-

PS H:\> pg_dump -Fc -v -h sharded -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

Password:



Pg_dump ran fine.



Pg_Restore:-



PS H:\> pg_restore -v -h sharded  -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

pg_restore: connecting to database for restore

Password:

pg_restore: implied data-only restore

PS H:\> pg_restore -Fc -v -h sharded  -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

pg_restore: connecting to database for restore

Password:

pg_restore: implied data-only restore

PS H:\>



It has no errors but it did not restore the data.

This works for me.  I just tested it.  You'll have to convert from bash to Windows.

SrcHost=somehost
DescHost=anotherhost

SrcDir=/var/lib/pgsql/backups/test

SrcDB=somedb

DestDB=anotherdb

Tbl=public.job

pg_dump --host=$SrcHost -Fc -t $Tbl -v -d ${SrcDB} -f $SrcDir/${Tbl}.dump

pg_restore --host=$DestHost -v -d ${DestDB} ${SrcDir}/${Tbl}.dump

Thanks,
Sarwar

________________________________
From: Ron <ronljohnsonjr@gmail.com><mailto:ronljohnsonjr@gmail.com>
Sent: Tuesday, October 24, 2023 1:08 PM
To: pgsql-admin@lists.postgresql.org<mailto:pgsql-admin@lists.postgresql.org> <pgsql-admin@lists.postgresql.org><mailto:pgsql-admin@lists.postgresql.org>
Subject: Re: pg_restore is not working

On 10/24/23 11:43, M Sarwar wrote:


Hi,

Restore is having no errors but it is not restoring any data.
I have used the below command pg_dump
pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP

Why "-Ft" instead of "-Fc" for a .dump file?


I am using the below command for the restore.

PS H:\> pg_restore -F t -v -h bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
pg_restore: connecting to database for restore
Password:
pg_restore: implied data-only restore
PS H:\>

Thanks,
Sarwar



--
Born in Arizona, moved to Babylonia.

--
Born in Arizona, moved to Babylonia.

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

* Re: pg_restore is not working
@ 2023-10-24 19:13  M Sarwar <sarwarmd02@outlook.com>
  parent: Ron <ronljohnsonjr@gmail.com>
  1 sibling, 1 reply; 15+ messages in thread

From: M Sarwar @ 2023-10-24 19:13 UTC (permalink / raw)
  To: Ron <ronljohnsonjr@gmail.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Here is my update.
I was using pg_restore with -t 'schema-name.tablename'.

After reading the document, https://www.postgresql.org/docs/16/app-pgrestore.html, I tried to avoid using the clause of -t in pg-restore command. I just restored the entire which has just 1 table dump.

In my opinion if there is any issue with -t clause in pg_restore, it should through an error instead of it is simply coming out without throwing any error.
Thanks,
Sarwar

________________________________
From: Ron <ronljohnsonjr@gmail.com>
Sent: Tuesday, October 24, 2023 1:56 PM
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: pg_restore is not working

On 10/24/23 12:24, M Sarwar wrote:
Hi Ron,

I did try using -Fc clause. pg_dump is running fine but pg_restore is having the same issue.
I tried once again now after seeing your email and getting the same scenario.


Pg_Dump:-

PS H:\> pg_dump -Fc -v -h sharded -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

Password:



Pg_dump ran fine.



Pg_Restore:-



PS H:\> pg_restore -v -h sharded  -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

pg_restore: connecting to database for restore

Password:

pg_restore: implied data-only restore

PS H:\> pg_restore -Fc -v -h sharded  -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

pg_restore: connecting to database for restore

Password:

pg_restore: implied data-only restore

PS H:\>



It has no errors but it did not restore the data.

This works for me.  I just tested it.  You'll have to convert from bash to Windows.

SrcHost=somehost
DescHost=anotherhost

SrcDir=/var/lib/pgsql/backups/test

SrcDB=somedb

DestDB=anotherdb

Tbl=public.job

pg_dump --host=$SrcHost -Fc -t $Tbl -v -d ${SrcDB} -f $SrcDir/${Tbl}.dump

pg_restore --host=$DestHost -v -d ${DestDB} ${SrcDir}/${Tbl}.dump

Thanks,
Sarwar

________________________________
From: Ron <ronljohnsonjr@gmail.com><mailto:ronljohnsonjr@gmail.com>
Sent: Tuesday, October 24, 2023 1:08 PM
To: pgsql-admin@lists.postgresql.org<mailto:pgsql-admin@lists.postgresql.org> <pgsql-admin@lists.postgresql.org><mailto:pgsql-admin@lists.postgresql.org>
Subject: Re: pg_restore is not working

On 10/24/23 11:43, M Sarwar wrote:


Hi,

Restore is having no errors but it is not restoring any data.
I have used the below command pg_dump
pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP

Why "-Ft" instead of "-Fc" for a .dump file?


I am using the below command for the restore.

PS H:\> pg_restore -F t -v -h bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
pg_restore: connecting to database for restore
Password:
pg_restore: implied data-only restore
PS H:\>

Thanks,
Sarwar



--
Born in Arizona, moved to Babylonia.

--
Born in Arizona, moved to Babylonia.

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

* Re: pg_restore is not working
@ 2023-10-24 19:43  Ron <ronljohnsonjr@gmail.com>
  parent: M Sarwar <sarwarmd02@outlook.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Ron @ 2023-10-24 19:43 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

You're still doing something wrong.  And "pg_restore --verbose" *does* throw 
errors.

On 10/24/23 14:13, M Sarwar wrote:
> Here is my update.
> I was using pg_restore with -t 'schema-name.tablename'.
>
> After reading the document, 
> https://www.postgresql.org/docs/16/app-pgrestore.html, I tried to avoid 
> using the clause of -t in pg-restore command. I just restored the entire 
> which has just 1 table dump.
>
> In my opinion if there is any issue with -t clause in pg_restore, it 
> should through an error instead of it is simply coming out without 
> throwing any error.
> Thanks,
> Sarwar
>
> ----------------------------------------------------------------------------
> *From:* Ron <ronljohnsonjr@gmail.com>
> *Sent:* Tuesday, October 24, 2023 1:56 PM
> *To:* pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
> *Subject:* Re: pg_restore is not working
> On 10/24/23 12:24, M Sarwar wrote:
>> Hi Ron,
>>
>> I did try using -Fc clause. pg_dump is running fine but pg_restore is 
>> having the same issue.
>> I tried once again now after seeing your email and getting the same scenario.
>>
>> Pg_Dump:-
>>
>> PS H:\> pg_dump -Fc -v -h*/sharded/*-U db_sarwar -d NGBRDVDB -t 
>> 'bronxdev.errors' -f 
>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP
>>
>> Password:
>>
>> Pg_dump ran fine.
>>
>> Pg_Restore:-
>>
>> PS H:\> pg_restore -v -h*/sharded/* -U db_sarwar -d bronxdb1 -t 
>> 'bronxdev.errors' 
>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP
>>
>> pg_restore: connecting to database for restore
>>
>> Password:
>>
>> pg_restore: implied data-only restore
>>
>> PS H:\> pg_restore -Fc -v -h*/sharded/* -U db_sarwar -d bronxdb1 -t 
>> 'bronxdev.errors' 
>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP
>>
>> pg_restore: connecting to database for restore
>>
>> Password:
>>
>> pg_restore: implied data-only restore
>>
>> PS H:\>
>>
>> It has no errors but it did not restore the data.
>>
>
> This works for me.  I just tested it.  You'll have to convert from bash to 
> Windows.
>
> SrcHost=somehost
> DescHost=anotherhost
>
> SrcDir=/var/lib/pgsql/backups/test
>
> SrcDB=somedb
>
> DestDB=anotherdb
>
> Tbl=public.job
>
> pg_dump --host=$SrcHost -Fc -t $Tbl -v -d ${SrcDB} -f $SrcDir/${Tbl}.dump
>
> pg_restore --host=$DestHost -v -d ${DestDB} ${SrcDir}/${Tbl}.dump
>
>> Thanks,
>> Sarwar
>>
>> ----------------------------------------------------------------------------
>> *From:* Ron <ronljohnsonjr@gmail.com> <mailto:ronljohnsonjr@gmail.com>
>> *Sent:* Tuesday, October 24, 2023 1:08 PM
>> *To:* pgsql-admin@lists.postgresql.org 
>> <mailto:pgsql-admin@lists.postgresql.org> 
>> <pgsql-admin@lists.postgresql.org> <mailto:pgsql-admin@lists.postgresql.org>
>> *Subject:* Re: pg_restore is not working
>> On 10/24/23 11:43, M Sarwar wrote:
>>>
>>> Hi,
>>>
>>> Restore is having no errors but it is not restoring any data.
>>> I have used the below command pg_dump
>>> pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com 
>>> -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f 
>>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
>>>
>>
>> Why "-Ft" instead of "-Fc" for a .dump file?
>>
>>> I am using the below command for the restore.
>>>
>>> PS H:\> pg_restore -F t -v -h 
>>> bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d 
>>> bronxdb1 -t 'bronxdev.errors' 
>>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
>>> pg_restore: connecting to database for restore
>>> Password:
>>> pg_restore: implied data-only restore
>>> PS H:\>
>>>
>>> Thanks,
>>> Sarwar
>>>
>>
>> -- 
>> Born in Arizona, moved to Babylonia.
>
> -- 
> Born in Arizona, moved to Babylonia.

-- 
Born in Arizona, moved to Babylonia.

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

* Re: pg_restore is not working
@ 2023-10-24 19:55  M Sarwar <sarwarmd02@outlook.com>
  parent: Ron <ronljohnsonjr@gmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: M Sarwar @ 2023-10-24 19:55 UTC (permalink / raw)
  To: Ron <ronljohnsonjr@gmail.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

In both pg_dump and pg_restore commands, I am always using -v option which verbose mode. Without that I will not be able to know any status.
All of my commands are using -v clause.
Thanks,
Sarwar

________________________________
From: Ron <ronljohnsonjr@gmail.com>
Sent: Tuesday, October 24, 2023 3:43 PM
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: pg_restore is not working

You're still doing something wrong.  And "pg_restore --verbose" does throw errors.

On 10/24/23 14:13, M Sarwar wrote:
Here is my update.
I was using pg_restore with -t 'schema-name.tablename'.

After reading the document, https://www.postgresql.org/docs/16/app-pgrestore.html, I tried to avoid using the clause of -t in pg-restore command. I just restored the entire which has just 1 table dump.

In my opinion if there is any issue with -t clause in pg_restore, it should through an error instead of it is simply coming out without throwing any error.
Thanks,
Sarwar

________________________________
From: Ron <ronljohnsonjr@gmail.com><mailto:ronljohnsonjr@gmail.com>
Sent: Tuesday, October 24, 2023 1:56 PM
To: pgsql-admin@lists.postgresql.org<mailto:pgsql-admin@lists.postgresql.org> <pgsql-admin@lists.postgresql.org><mailto:pgsql-admin@lists.postgresql.org>
Subject: Re: pg_restore is not working

On 10/24/23 12:24, M Sarwar wrote:
Hi Ron,

I did try using -Fc clause. pg_dump is running fine but pg_restore is having the same issue.
I tried once again now after seeing your email and getting the same scenario.


Pg_Dump:-

PS H:\> pg_dump -Fc -v -h sharded -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

Password:



Pg_dump ran fine.



Pg_Restore:-



PS H:\> pg_restore -v -h sharded  -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

pg_restore: connecting to database for restore

Password:

pg_restore: implied data-only restore

PS H:\> pg_restore -Fc -v -h sharded  -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP

pg_restore: connecting to database for restore

Password:

pg_restore: implied data-only restore

PS H:\>



It has no errors but it did not restore the data.

This works for me.  I just tested it.  You'll have to convert from bash to Windows.

SrcHost=somehost
DescHost=anotherhost

SrcDir=/var/lib/pgsql/backups/test

SrcDB=somedb

DestDB=anotherdb

Tbl=public.job

pg_dump --host=$SrcHost -Fc -t $Tbl -v -d ${SrcDB} -f $SrcDir/${Tbl}.dump

pg_restore --host=$DestHost -v -d ${DestDB} ${SrcDir}/${Tbl}.dump

Thanks,
Sarwar

________________________________
From: Ron <ronljohnsonjr@gmail.com><mailto:ronljohnsonjr@gmail.com>
Sent: Tuesday, October 24, 2023 1:08 PM
To: pgsql-admin@lists.postgresql.org<mailto:pgsql-admin@lists.postgresql.org> <pgsql-admin@lists.postgresql.org><mailto:pgsql-admin@lists.postgresql.org>
Subject: Re: pg_restore is not working

On 10/24/23 11:43, M Sarwar wrote:


Hi,

Restore is having no errors but it is not restoring any data.
I have used the below command pg_dump
pg_dump -F t -v -h bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d NGBRDVDB -t 'bronxdev.errors' -f C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP

Why "-Ft" instead of "-Fc" for a .dump file?


I am using the below command for the restore.

PS H:\> pg_restore -F t -v -h bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d bronxdb1 -t 'bronxdev.errors' C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
pg_restore: connecting to database for restore
Password:
pg_restore: implied data-only restore
PS H:\>

Thanks,
Sarwar



--
Born in Arizona, moved to Babylonia.

--
Born in Arizona, moved to Babylonia.

--
Born in Arizona, moved to Babylonia.

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

* Re: pg_restore is not working
@ 2023-10-24 20:03  Ron <ronljohnsonjr@gmail.com>
  parent: M Sarwar <sarwarmd02@outlook.com>
  0 siblings, 0 replies; 15+ messages in thread

From: Ron @ 2023-10-24 20:03 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>


If you were, then you'd see all sorts of output from pg_dump and pg_restore.

On 10/24/23 14:55, M Sarwar wrote:
> In both pg_dump and pg_restore commands, I am always using -v option which 
> verbose mode. Without that I will not be able to know any status.
> All of my commands are using -v clause.
> Thanks,
> Sarwar
>
> ----------------------------------------------------------------------------
> *From:* Ron <ronljohnsonjr@gmail.com>
> *Sent:* Tuesday, October 24, 2023 3:43 PM
> *To:* pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
> *Subject:* Re: pg_restore is not working
> You're still doing something wrong.  And "pg_restore --verbose" *does* 
> throw errors.
>
> On 10/24/23 14:13, M Sarwar wrote:
>> Here is my update.
>> I was using pg_restore with -t 'schema-name.tablename'.
>>
>> After reading the document, 
>> https://www.postgresql.org/docs/16/app-pgrestore.html 
>> <https://www.postgresql.org/docs/16/app-pgrestore.html;, I tried to avoid 
>> using the clause of -t in pg-restore command. I just restored the entire 
>> which has just 1 table dump.
>>
>> In my opinion if there is any issue with -t clause in pg_restore, it 
>> should through an error instead of it is simply coming out without 
>> throwing any error.
>> Thanks,
>> Sarwar
>>
>> ----------------------------------------------------------------------------
>> *From:* Ron <ronljohnsonjr@gmail.com> <mailto:ronljohnsonjr@gmail.com>
>> *Sent:* Tuesday, October 24, 2023 1:56 PM
>> *To:* pgsql-admin@lists.postgresql.org 
>> <mailto:pgsql-admin@lists.postgresql.org> 
>> <pgsql-admin@lists.postgresql.org> <mailto:pgsql-admin@lists.postgresql.org>
>> *Subject:* Re: pg_restore is not working
>> On 10/24/23 12:24, M Sarwar wrote:
>>> Hi Ron,
>>>
>>> I did try using -Fc clause. pg_dump is running fine but pg_restore is 
>>> having the same issue.
>>> I tried once again now after seeing your email and getting the same 
>>> scenario.
>>>
>>> Pg_Dump:-
>>>
>>> PS H:\> pg_dump -Fc -v -h*/sharded/*-U db_sarwar -d NGBRDVDB -t 
>>> 'bronxdev.errors' -f 
>>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP
>>>
>>> Password:
>>>
>>> Pg_dump ran fine.
>>>
>>> Pg_Restore:-
>>>
>>> PS H:\> pg_restore -v -h*/sharded/* -U db_sarwar -d bronxdb1 -t 
>>> 'bronxdev.errors' 
>>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP
>>>
>>> pg_restore: connecting to database for restore
>>>
>>> Password:
>>>
>>> pg_restore: implied data-only restore
>>>
>>> PS H:\> pg_restore -Fc -v -h*/sharded/* -U db_sarwar -d bronxdb1 -t 
>>> 'bronxdev.errors' 
>>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-6.DUMP
>>>
>>> pg_restore: connecting to database for restore
>>>
>>> Password:
>>>
>>> pg_restore: implied data-only restore
>>>
>>> PS H:\>
>>>
>>> It has no errors but it did not restore the data.
>>>
>>
>> This works for me.  I just tested it.  You'll have to convert from bash 
>> to Windows.
>>
>> SrcHost=somehost
>> DescHost=anotherhost
>>
>> SrcDir=/var/lib/pgsql/backups/test
>>
>> SrcDB=somedb
>>
>> DestDB=anotherdb
>>
>> Tbl=public.job
>>
>> pg_dump --host=$SrcHost -Fc -t $Tbl -v -d ${SrcDB} -f $SrcDir/${Tbl}.dump
>>
>> pg_restore --host=$DestHost -v -d ${DestDB} ${SrcDir}/${Tbl}.dump
>>
>>> Thanks,
>>> Sarwar
>>>
>>> ----------------------------------------------------------------------------
>>> *From:* Ron <ronljohnsonjr@gmail.com> <mailto:ronljohnsonjr@gmail.com>
>>> *Sent:* Tuesday, October 24, 2023 1:08 PM
>>> *To:* pgsql-admin@lists.postgresql.org 
>>> <mailto:pgsql-admin@lists.postgresql.org> 
>>> <pgsql-admin@lists.postgresql.org> <mailto:pgsql-admin@lists.postgresql.org>
>>> *Subject:* Re: pg_restore is not working
>>> On 10/24/23 11:43, M Sarwar wrote:
>>>>
>>>> Hi,
>>>>
>>>> Restore is having no errors but it is not restoring any data.
>>>> I have used the below command pg_dump
>>>> pg_dump -F t -v -h 
>>>> bronxdb1.c52p1yyyjuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d 
>>>> NGBRDVDB -t 'bronxdev.errors' -f 
>>>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
>>>>
>>>
>>> Why "-Ft" instead of "-Fc" for a .dump file?
>>>
>>>> I am using the below command for the restore.
>>>>
>>>> PS H:\> pg_restore -F t -v -h 
>>>> bronxdb1.c52p1fyyyuib.us-xxx-west-1.rds.amazonaws.com -U db_sarwar -d 
>>>> bronxdb1 -t 'bronxdev.errors' 
>>>> C:\Mohammed\Work\NGC\Apps\Bronx\Backups\Dumps\data\backup_Dev_Bronxdev-Errors_20231024-5.DUMP
>>>> pg_restore: connecting to database for restore
>>>> Password:
>>>> pg_restore: implied data-only restore
>>>> PS H:\>
>>>>
>>>> Thanks,
>>>> Sarwar
>>>>
>>>
>>> -- 
>>> Born in Arizona, moved to Babylonia.
>>
>> -- 
>> Born in Arizona, moved to Babylonia.
>
> -- 
> Born in Arizona, moved to Babylonia.

-- 
Born in Arizona, moved to Babylonia.

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


end of thread, other threads:[~2023-10-24 20:03 UTC | newest]

Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-10-24 16:43 pg_restore is not working M Sarwar <sarwarmd02@outlook.com>
2023-10-24 16:56 ` Scott Ribe <scott_ribe@elevated-dev.com>
2023-10-24 17:02   ` M Sarwar <sarwarmd02@outlook.com>
2023-10-24 17:05     ` Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>
2023-10-24 17:18       ` M Sarwar <sarwarmd02@outlook.com>
2023-10-24 17:25         ` Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>
2023-10-24 17:34           ` Michael Banck <mbanck@gmx.net>
2023-10-24 17:08 ` Ron <ronljohnsonjr@gmail.com>
2023-10-24 17:24   ` M Sarwar <sarwarmd02@outlook.com>
2023-10-24 17:56     ` Ron <ronljohnsonjr@gmail.com>
2023-10-24 18:28       ` M Sarwar <sarwarmd02@outlook.com>
2023-10-24 19:13       ` M Sarwar <sarwarmd02@outlook.com>
2023-10-24 19:43         ` Ron <ronljohnsonjr@gmail.com>
2023-10-24 19:55           ` M Sarwar <sarwarmd02@outlook.com>
2023-10-24 20:03             ` Ron <ronljohnsonjr@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