postgresql
PostgreSQL bytea与字符串互转
假如name是bytea类型的字段新增时INSERT INTO users (name) VALUES ('zhangsan'::bytea)查询时SELECT CONVERT_FROM(name, 'UTF-8') AS name FROM users
PostgreSQL的"find_in_set"
SELECT *FROM sys_dept WHERE #{id} = ANY (string_to_array(ids, ','));注意id也需要是字符串形式
PostgreSQL设置自增字段
postgres 自增需要先进行创建自增序列, 指定自增值, 最小值, 最大值:CREATE SEQUENCE "public"."tt_id_seq" INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1;
设置序列