Amrullah Zunzunia
Amrullah Zunzunia

Reputation: 1657

No query executing on a table in postgresql

I have a table in PostgreSql-9.4 database called orders_order. I am unable to run any kind of query on it. No matter what query I run on this table (for eg. SELECT count(*) from orders_order; or even \d orders_order), nothing happens, except cursor blinking on terminal.

What could have caused it? And How can I fix it?

I was running some raw sql queries (INSERT INTO queries) using a script in Django/Python in a transaction. I abruptly quit the script by pressing Ctrl + Z. Since then I am facing this problem

Upvotes: 1

Views: 300

Answers (1)

Chris Travers
Chris Travers

Reputation: 26464

Most likely you are not terminating your query with a semicolon ;-)

Note that by default the PostgreSQL prompt has three pieces:

[dbname][linestatus][is_superuser]

for example logged in as Postgres, new line, db is postgres:

postgres=#

Logged in to db test as non-superuser, new line:

test=>

Now that = is an important character. If you have an open paren, it will show: test(>

If you are at the top level it will be

test->

Upvotes: 2

Related Questions