摘要: 先介绍一下Postgresql的建索引语法: CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ name ] ON table [ USING method ] ( { column | ( expression ) } [ COLLATE collation ] 阅读全文
posted @ 2021-12-02 14:23 数据库集中营 阅读(254) 评论(0) 推荐(0) 编辑
摘要: SQL server的studio有一个功能,可以随意拖拽表字段,更改其位置并使之重新排序,有同事问起,Postgres是否也可以。Postgres每个字段的顺序是在系统表pg_attribute里面定义,下面实际操作一下看是否支持。 数据准备: postgres=# create table tb 阅读全文
posted @ 2021-12-02 14:00 数据库集中营 阅读(412) 评论(0) 推荐(0) 编辑
摘要: 今天开发问到,postgressql里面有没有像mysql那样插入一个值后返回插入的值,这个是有的,而且有更强的扩展性。 示例: [postgres@localhost ~]$ psql psql (9.2.4) Type "help" for help. postgres=# create tab 阅读全文
posted @ 2021-12-02 13:50 数据库集中营 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 1.10进制转16进制Postgres里面有一个内置的10进制转16进制的函数:to_hex(int)/to_hex(bigint) [postgres@localhost ~]$ psql Password: psql (9.1.3) Type "help" for help. postgres= 阅读全文
posted @ 2021-12-02 13:48 数据库集中营 阅读(868) 评论(0) 推荐(0) 编辑