From: | Rick Genter <rick(dot)genter(at)gmail(dot)com> |
---|---|
To: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: DROP TABLE Appears to Fail |
Date: | 2011-06-28 22:57:17 |
Message-ID: | BANLkTinLLYrFATyrccVwVFCuiTRXo8=PgQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
After issuing the \d you are still in the middle of your command. Witness
the following copy/paste of a terminal session:
bash-3.2$ ./psql
Password:
psql (8.4.4)
Type "help" for help.
postgres=# create table foo (bar int);
CREATE TABLE
postgres=# drop table foo
postgres-# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
public | foo | table | postgres
(1 row)
postgres-# drop table foo;
ERROR: syntax error at or near "drop"
LINE 2: drop table foo;
^
postgres=# drop table foo;
DROP TABLE
postgres=#
This is on 8.4.4. The semicolon is required.
On Tue, Jun 28, 2011 at 3:53 PM, Rich Shepard <rshepard(at)appl-ecosys(dot)com>wrote:
> On Tue, 28 Jun 2011, Rick Genter wrote:
>
> Silly question, but did you try it with a semicolon after the drop table?
>>
>
> Rick,
>
> See my answer to Andy: that's incorrect syntax and psql complains.
>
>
> I've noticed that if you are in the middle of a statement and issue a \
>> command, psql ignores the SQL you've typed in and just does the \ command.
>>
>
> But there is no continuation command just 'drop table <tablename>'.
>
> Thanks,
>
>
> Rich
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/**mailpref/pgsql-general<http://www.postgresql.org/mailpref/pgsql-general>
>
--
Rick Genter
rick(dot)genter(at)gmail(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Smith | 2011-06-28 23:03:04 | Re: rationale behind quotes for camel case? |
Previous Message | Jonathan S. Katz | 2011-06-28 22:56:14 | point types in "DISTINCT" queries |