【发布时间】:2018-12-14 17:13:58
【问题描述】:
我正在使用 PostgreSQL。 e_id 是主键,我想将数据类型从 char(5) 更改为整数。
Column | Type | Modifiers
-----------+-----------------------+-----------
e_id | character(5) | not null
Column | Type | Modifiers
-----------------+--------------+-----------
employee_e_id | character(5) | not null
product_prod_nr | character(5) | not null
hours | numeric | not null
Indexes:
"works_on_pkey" PRIMARY KEY, btree (employee_e_id, product_prod_nr, hours)
Foreign-key constraints:
"works_on_employee_e_id_fkey" FOREIGN KEY (employee_e_id) REFERENCES employee(e_id)
我的数据库中的一个表已经依赖于该主键。 有没有办法做到这一点?
【问题讨论】:
标签: postgresql type-conversion foreign-keys primary-key ddl