本文档主要介绍一些简单的 CRUD 操作示例,更多操作可参考 PostgreSQL 官网。
查询表 test 中的所有记录
sample=# select * from test;
Note:
如果 PostgreSQL 所连接的 SequoiaDB 协调节点重启,则需要重新进入 PostgreSQL Shell,否则查询报错。
在表 test 中插入如下记录
sample=# insert into test values('one',3);
匹配表 test 中 name 为'one'的记录,并将该记录中字段 id 的值更新为 9
sample=# update test set id=9 where name='one';
删除表 test 中字段 id 为 2 的记录
sample=# delete from test where id=2;