2023-04-19
pg 是否有类似调整字段顺序的方法
mysql下,可以使用 alter .. before/after 的语法,
11:52:11> alter table t1 add column c1 int after user_id;
Query OK, 0 rows affected (0.09 sec)
Records: 0 Duplicates: 0 Warnings: 0
11:52:22> show create table t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`user_id` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`c1` int(11) DEFAULT NULL,
`user_name` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
1 row in set (0.00 sec)
但是在PostgreSQL中,如何实现呢?
我来答
添加附件
收藏
分享
问题补充
3条回答
默认
最新
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
墨值悬赏


评论

