无论我执行哪个命令,PostgreSQL 都会挂起

无论我执行哪个命令,PostgreSQL 都会挂起

标题基本概括了所有内容。我正在运行 PostgreSQL 9.0.0 并运行使用 PostGIS 的数据库。

更详细地说,我遇到问题的表是一个怪物。表名已被匿名化。

我正在更新表,我需要做的第一件事是删除schedule_id列上的空约束。但是,当我尝试执行该语句时,发生了以下情况:

xxx=# alter table locations_location alter column schedule_id drop not null;
<hangs>

是的,什么都没有。然后我尝试删除列,结果相同。然后我尝试删除表,没有结果。有什么想法吗?

                                       Table "public.alpha_alpha"
       Column        |          Type          |                            Modifiers                            
---------------------+------------------------+-----------------------------------------------------------------
 id                  | integer                | not null default nextval('alpha_alpha_id_seq'::regclass)
 status              | integer                | not null
 address_line_one    | character varying(100) | not null
 address_line_two    | character varying(100) | not null
 city                | character varying(100) | not null
 city_slug           | character varying(50)  | not null
 state_id            | integer                | not null
 postal_code         | character varying(15)  | not null
 address_tip         | character varying(255) | not null
 phone               | character varying(30)  | not null
 fax                 | character varying(30)  | not null
 name                | character varying(75)  | not null
 dma_id              | integer                | 
 store_number        | character varying(5)   | not null
 store_type_id       | integer                | not null
 store_email_address | character varying(75)  | not null
 store_website       | character varying(200) | not null
 date_opened         | date                   | 
 new                 | boolean                | not null
 slug                | character varying(50)  | not null
 online_ordering_url | character varying(200) | not null
 delivery_url        | character varying(200) | not null
 has_catering        | boolean                | not null
 now_hiring          | boolean                | not null
 schedule_id         | integer                | not null
 tier                | integer                | not null
 coordinates         | geometry               | 
 schedule_display    | character varying(200) | not null default ''::character varying
 sunday_open         | time without time zone | 
 sunday_close        | time without time zone | 
 monday_close        | time without time zone | 
 tuesday_open        | time without time zone | 
 tuesday_close       | time without time zone | 
 wednesday_open      | time without time zone | 
 wednesday_close     | time without time zone | 
 thursday_open       | time without time zone | 
 thursday_close      | time without time zone | 
 friday_open         | time without time zone | 
 friday_close        | time without time zone | 
 saturday_open       | time without time zone | 
 saturday_close      | time without time zone | 
Indexes:
    "alpha_alpha_pkey" PRIMARY KEY, btree (id)
    "alpha_alpha_name_key" UNIQUE, btree (name)
    "alpha_alpha_name_state_id_key" UNIQUE, btree (name, state_id)
    "alpha_alpha_store_number_key" UNIQUE, btree (store_number)
    "alpha_alpha_city_slug" btree (city_slug)
    "alpha_alpha_city_slug_like" btree (city_slug varchar_pattern_ops)
    "alpha_alpha_coordinates_id" gist (coordinates)
    "alpha_alpha_dma_id" btree (dma_id)
    "alpha_alpha_schedule_id" btree (schedule_id)
    "alpha_alpha_slug" btree (slug)
    "alpha_alpha_slug_like" btree (slug varchar_pattern_ops)
    "alpha_alpha_state_id" btree (state_id)
    "alpha_alpha_store_type_id" btree (store_type_id)
Check constraints:
    "enforce_dims_coordinates" CHECK (st_ndims(coordinates) = 2)
    "enforce_geotype_coordinates" CHECK (geometrytype(coordinates) = 'POINT'::text OR coordinates IS NULL)
    "enforce_srid_coordinates" CHECK (st_srid(coordinates) = 4329)
Foreign-key constraints:
    "alpha_alpha_dma_id_fkey" FOREIGN KEY (dma_id) REFERENCES alpha_dma(id) DEFERRABLE INITIALLY DEFERRED
    "alpha_alpha_schedule_id_fkey" FOREIGN KEY (schedule_id) REFERENCES alpha_schedule(id) DEFERRABLE INITIALLY DEFERRED
    "alpha_alpha_state_id_fkey" FOREIGN KEY (state_id) REFERENCES countries_region(id) DEFERRABLE INITIALLY DEFERRED
    "alpha_alpha_store_type_id_fkey" FOREIGN KEY (store_type_id) REFERENCES alpha_storetype(id) DEFERRABLE INITIALLY DEFERRED
Referenced by:
    TABLE "beta_epsilon" CONSTRAINT "beta_epsilon_xxx_alpha_id_fkey" FOREIGN KEY (xxx_alpha_id) REFERENCES alpha_alpha(id) DEFERRABLE INITIALLY DEFERRED
    TABLE "beta_delta" CONSTRAINT "beta_delta_xxx_alpha_id_fkey" FOREIGN KEY (xxx_alpha_id) REFERENCES alpha_alpha(id) DEFERRABLE INITIALLY DEFERRED
    TABLE "beta_lambda" CONSTRAINT "beta_lambda_xxx_alpha_id_fkey" FOREIGN KEY (xxx_alpha_id) REFERENCES alpha_alpha(id) DEFERRABLE INITIALLY DEFERRED
    TABLE "beta_lambda" CONSTRAINT "beta_lambda_event_alpha_id_fkey" FOREIGN KEY (event_alpha_id) REFERENCES alpha_alpha(id) DEFERRABLE INITIALLY DEFERRED
    TABLE "gamma_applicant_alpha" CONSTRAINT "gamma_applicant_alpha_alpha_id_fkey" FOREIGN KEY (alpha_id) REFERENCES alpha_alpha(id) DEFERRABLE INITIALLY DEFERRED
    TABLE "alpha_alpha_services" CONSTRAINT "alpha_id_refs_id_e7506f2d" FOREIGN KEY (alpha_id) REFERENCES alpha_alpha(id) DEFERRABLE INITIALLY DEFERRED
    TABLE "news_upsilon_alpha" CONSTRAINT "news_upsilon_alpha_alpha_id_fkey" FOREIGN KEY (alpha_id) REFERENCES alpha_alpha(id) DEFERRABLE INITIALLY DEFERRED

相关内容