1
0
This commit is contained in:
2025-11-19 05:51:56 +08:00
parent 7b1465fc4e
commit 7a5099188e
3 changed files with 12 additions and 4 deletions

View File

@@ -1,7 +1,5 @@
-- 修改用户的密码 -- search_path
alter user postgres with password '123456'; SHOW search_path;
-- 查询所有用户
select * from pg_catalog.pg_user;
-- 查询表的 COLLATION VERSION -- 查询表的 COLLATION VERSION
SELECT SELECT

6
PostgreSQL/function.sql Normal file
View File

@@ -0,0 +1,6 @@
-- ROW 关键字生成一个元组
SELECT ROW (1, 2, 3);
-- pg_column_size函数获取存储数据需要的字节数
SELECT pg_column_size(ROW (1,2,3)); -- 36
SELECT pg_column_size(ROW (1::int2, 2::int2, 3::int2)); -- 30

4
PostgreSQL/user.sql Normal file
View File

@@ -0,0 +1,4 @@
-- 修改用户的密码
alter user postgres with password '123456';
-- 查询所有用户
select * from pg_catalog.pg_user;