Thread: Can't drop table

Can't drop table

From
Hima Surapaneni
Date:
Hi,

I have created a table called experimenters with the following query:

CREATE TABLE experimenters (     experimenter_id  INTEGER CONSTRAINT firstkey PRIMARY KEY,     first_name
CHAR(20),    last_name        CHAR(25),     address          CHAR(30),     phone_num        CHAR(15)
 
);

The query was successful. But when I try to drop or alter the table, it just hangs without echoing any error message. I
haveto cancel the query to get out.
 

I ran the following query to drop the table

DROP TABLE experimenters;

It also hangs when I try to alter the table.

Just don't understand the problem here.

Any help will be highly appreciated.

Thanks in advance

Hima


Re: Can't drop table

From
Richard Broersma Jr
Date:
> I have created a table called experimenters with the following query:
> CREATE TABLE experimenters (
>       experimenter_id  INTEGER CONSTRAINT firstkey PRIMARY KEY,
>       first_name       CHAR(20),
>       last_name        CHAR(25),
>       address          CHAR(30),
>       phone_num        CHAR(15)
> );
> The query was successful. But when I try to drop or alter the table, it just hangs without
> echoing any error message. I have to cancel the query to get out.
> I ran the following query to drop the table
> DROP TABLE experimenters;
> It also hangs when I try to alter the table.
> Just don't understand the problem here.
> Any help will be highly appreciated.

You might want to post this on the PG_General Mailing list of you do not get many responses.

Regards,

Richard Broersma Jr.


Re: Can't drop table

From
Tom Lane
Date:
Hima Surapaneni <hbsur1@student.monash.edu> writes:
> The query was successful. But when I try to drop or alter the table, it just hangs without echoing any error message.
Ihave to cancel the query to get out.
 

Sounds like there's some open transaction with a lock on the table.
The pg_locks view might help you figure out which one.
        regards, tom lane