1. 用超级管理员运行命令

create extension tablefunc;

2. 如果报错,说明未安装扩展

进入postgresql安装目录,找到contrib文件夹,找到扩展项

cd /postgres/postgresql-13.5/contrib/tablefunc
make install

安装完成可以在扩展中看到

cd /postgres/pgsql/share/extension
[postgres@name extension]$ find tablefunc*
tablefunc--1.0.sql
tablefunc.control
tablefunc--unpackaged--1.0.sql

3. 行转列函数使用

https://muguayuan.com/2023/21866.html

Logo

一站式 AI 云服务平台

更多推荐