用C完成PostgreSQL存储过程例子
发布时间: 2022-05-03 23:38:31 评论数: 0
目的:用C完成一个存储过程例子,存储过程实现对表某一段进行update。准备工作1、安装数据库2、建立表testhighgo=# create table test(id int, name text, label int);
CREATE TABLE3、建立C文件,C代码如下:#include "postgres.h"
#include "executor/spi.h"
#include "utils/builtins.h"
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
int mydelete(int key);
int ......