[PLUG] PSQL command to drop table from a databae

Rohit Karajgi rohit.karajgi at gmail.com
Sun Mar 28 10:57:01 IST 2010


You forgot to quote your sql statement. Hence the interpreter threw an error
at the DROP keyword.

psql -h localhost -p 5433 -U postgres -d testdb -c "DROP TABLE
11001_district_of_columbia_arealm"

-rohit
On Sun, Mar 28, 2010 at 9:41 AM, Shreerang Patwardhan <
patwardhan.shreerang at gmail.com> wrote:

> Hey all,
>  I am trying the following command to drop a table from a postgresql
> database. It gives an error. Can anyone please rectify the command if it is
> wrong?
>
> *Command:*
> psql -h localhost -p 5433 -U postgres -d testdb -c DROP TABLE
> 11001_district_of_columbia_arealm
>
> *Error Message:*
> psql: warning: extra command-line argument "TABLE" ignored
> psql: warning: extra command-line argument
> "11001_district_of_columbia_arealm" ignored
> ERROR:  syntax error at end of input
> LINE 1: DROP
>                       ^
>
>
> Please help!
> Thanx,
> Shreerang Patwardhan.
> _______________________________________
> Pune GNU/Linux Users Group Mailing List
>



More information about the Plug-mail mailing list