deleting table content through command prompt

From: sconeek(at)gmail(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: deleting table content through command prompt
Date: 2006-04-19 23:04:04
Message-ID: 1145487844.482454.176940@e56g2000cwe.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-04-19 23:23:27 Re: Calling the same function more than once with the same arguments
Previous Message Ben 2006-04-19 21:38:33 Re: Calling the same function more than once with the same