deleting table content through command prompt - Mailing list pgsql-general

From sconeek@gmail.com
Subject deleting table content through command prompt
Date
Msg-id 1145487844.482454.176940@e56g2000cwe.googlegroups.com
Whole thread Raw
List pgsql-general
hi all,
i am trying to create a database backup and restore windows batch file,
which when run will do a database table backup and a corresponding
table restore.

now for table_usernames backup i run something like from the command
prompt,
pg_dump.exe -i -h localhost -p 5432 -U postgres -F t -v -f
"C:\usernames.backup" -t table_usernames "loginDetails"
now for db restore i run something like from the command prompt,
pg_restore.exe -i -h localhost -p 5432 -U postgres -d "loginDetails" -a
-t table_usernames -v "C:\usernames.backup"

the problem is that after i do a backup i need to delete the table
content and then do a restore. through pgadmin i would do DELETE FROM
table_usernames. however i need to do this from the command prompt,
like how i am doing above.

it seems very obvious and simple, but i am unable to think of how i
would do deletion of a table from the command prompt

thanks for all feedback and help.


pgsql-general by date:

Previous
From: "jonathan ramirez"
Date:
Subject: consulta SELECT FOR UPDATE
Next
From: Alexander Scholz
Date:
Subject: Re: Query to check existence of stored procedure?