mysql和postgres的比较(待续)

1.  postgres不支持列顺序重排,除非重建表;而mysql可以说alter table mytable add column after column。
2. 删除列是,postgres其实是把这个列隐藏了,并没有真正删除,而mysql能真正删除。此外,mysql还提供optimize table,repair table和analyze table等工具分析和改善数据表的存储状况。
The DROP COLUMN form does not physically remove the column, but simply makes it invisible to SQL operations. Subsequent insert and update operations in the table will store a null value for the column. Thus, dropping a column is quick but it will not immediately reduce the on-disk size of your table, as the space occupied by the dropped column is not reclaimed. The space will be reclaimed over time as existing rows are updated
3. mysql的权限精确到数据表中的每个列,而postgres只能精确到表或者同级别的视图、函数、触发器等。
You can restrict access to individual columns of a table for a particular user or group by denying them direct access to it, and creating a view containing only the columns they should see for them to use instead. If your users need to update the data, you can create rules to apply updates to the view to the base table instead.
4. mysql支持同时插入多条纪录:insert into table values (), (), ();,为了避免重复插入主键相同的纪录还可以用replace into。而postgres只能插入一条,如果要插入多条纪录,可以使用COPY语句。至于mysql的replace和insert ... on duplicate key update等扩展的语法,可以用postgres的触发器来实现。

以后添加更多的比较
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值