如何在postgresql中修改类型?
我的类型定义为:如何在postgresql中修改类型?,sql,postgresql,ddl,alter,Sql,Postgresql,Ddl,Alter,我的类型定义为: CREATE TYPE New_A AS (id integer, id_new integer, arrived date, sum numeric); 我想将到达从日期类型更改为无时区时间戳类型 我试过: ALTER TYPE New_A SET arrived TO timestamp without time zone 但它不起作用。它给出: 错误:“到达”处或附近出现语法错误 您可以使用alter attribute子句: ALTER
CREATE TYPE New_A AS
(id integer,
id_new integer,
arrived date,
sum numeric);
我想将到达
从日期
类型更改为无时区时间戳
类型
我试过:
ALTER TYPE New_A SET arrived TO timestamp without time zone
但它不起作用。它给出:
错误:“到达”处或附近出现语法错误
您可以使用
alter attribute
子句:
ALTER TYPE new_a ALTER ATTRIBUTE arrived TYPE timestamp without time zone;
有关详细信息,请参阅。我读了这篇文章。没有关于如何更改类型的示例。仔细阅读。。。他们说“设置数据类型”,但没有例子。我尝试的每件事都会产生同样的错误。