---
title: "创建postgresql的存储过程"
author: "winds_he"
date: "2013-08-16T17:10:45Z"
tags: ["PostgreSQL"]
categories: ["数据库"]
slug: "postgresql"
draft: false
lastmod: "2013-08-16T17:10:45Z"
id: 1926213
url: "https://winds-he.iteye.com/blog/1926213"
---

创建postgresql的存储过程时，需要指定语言，比如：language 'plpgsql'; 或者language 'sql';
当指定语言为“plpgsql”时，发生错误：
ERROR: language "plpgsql" does not exist
HINT: Use CREATE LANGUAGE to load the language into the database.
解决方法：
createlang -U [USER] plpgsql [DB NAME];
特别需要注意的是，上面这行命令是需要在SHELL中执行的，而不是在SQL中!