pgsql

创建分区表: PostgreSQL分区表_pg分区表-CSDN博客

创建list分区的函数

复制代码
create or replace function create_list_fq(tb_name char, row_name char)
returns int
AS $$
declare
 s char;
begin
	raise notice 'CREATE TABLE if not exists %_% PARTITION OF %  FOR VALUES IN (''%'');', tb_name, row_name, tb_name, row_name;
	execute format('CREATE TABLE if not exists %s_%s PARTITION OF %s  FOR VALUES IN (''%s'');', tb_name, row_name, tb_name, row_name);
	raise notice '%, %', tb_name, row_name;
	return 123;
end;
$$
language plpgsql
相关推荐
山峰哥1 天前
数据库工程与SQL调优——从索引策略到查询优化的深度实践
数据库·sql·性能优化·编辑器
山岚的运维笔记1 天前
SQL Server笔记 -- 第18章:Views
数据库·笔记·sql·microsoft·sqlserver
WHD3061 天前
苏州数据库(SQL Oracle)文件损坏修复
hadoop·sql·sqlite·flume·memcached
麦聪聊数据1 天前
为何通用堡垒机无法在数据库运维中实现精准风控?
数据库·sql·安全·低代码·架构
枷锁—sha2 天前
【SRC】SQL注入快速判定与应对策略(一)
网络·数据库·sql·安全·网络安全·系统安全
怣502 天前
MySQL多表连接:全外连接、交叉连接与结果集合并详解
数据库·sql
证榜样呀2 天前
2026 中专大数据技术专业可考的证书有哪些,必看!
大数据·sql
Codefengfeng2 天前
数据安全知识点速通
sql
逍遥德2 天前
Sring事务详解之02.如何使用编程式事务?
java·服务器·数据库·后端·sql·spring