4

I have a docker container that I have created a table in called "first_app_firstresource." When I try, however, to delete this table, it does nothing. Instead, this is what happens:

docker=# \d

Part of the table...

Schema | Name | Type | Owner -------------------------------------------- public | first_app_firstresource | table | docker

then it goes straight to...

docker-# 

Notice now instead of =#, it is now -#.

I then try to drop the table with

docker-# drop table first_app_firstresource

and nothing whatsoever happens.

I have seen Postgresql DROP TABLE doesn't work, and adding quotes doesn't seem to do anything, either.

Community
  • 1
  • 1
Shaun
  • 611
  • 2
  • 6
  • 9
  • http://www.postgresql.org/docs/current/static/app-psql.html#R2-APP-PSQL-4 –  Mar 12 '14 at 22:51
  • Can you edit your question to show the copy and paste of the entire `psql` session, not just snippets? – Craig Ringer Mar 12 '14 at 23:19
  • Great, I found http://stackoverflow.com/questions/12472026/in-psql-why-do-some-commands-have-no-effect to be very useful! – Shaun Mar 13 '14 at 00:56

1 Answers1

11

In psql you need to end your SQL commands with a semicolon. The prompt -# means that it waiting for you to do so. I also suspect you have inserted some stray characters between the \d and drop table. So when you do add the semicolon, you will probably get a syntax error, because the command you sent is not what you think. I do this all the time, getting a stray ls into my psql commands.

jjanes
  • 37,812
  • 5
  • 27
  • 34