学习 PostgreSQL 存储过程的最佳方式?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/625367/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Best way to learn PostgreSQL stored procedures?
提问by Epaga
Is there a good tutorial or something similar for learning how to write Stored Procedures (for a PostgreSQL database). I'm a definite newbie when it comes to writing Stored Procedures at all, so the clearer and simpler things are explained, the better...
是否有一个很好的教程或类似的东西来学习如何编写存储过程(对于 PostgreSQL 数据库)。在编写存储过程方面,我是一个绝对的新手,所以解释得越清楚和简单,就越好......
Thanks in advance...
提前致谢...
采纳答案by Milen A. Radev
You almost had it, but better start here plpgsql
你几乎拥有它,但最好从这里开始plpgsql
Some will point that PL/pgSQL
is not the only way to write Stored Procedures for PostgreSQL and they will be right (that's one of the advantages of Postgres), but on the other hand PL/pgSQL
is nice and relatively easy to start with.
有些人会指出这PL/pgSQL
不是为 PostgreSQL 编写存储过程的唯一方法,他们是对的(这是 Postgres 的优点之一),但另一方面PL/pgSQL
它很好并且相对容易开始。
回答by Epaga
Note that obviously, here's a good place to start:sql-createfunction
请注意,显然,这里是一个很好的起点:sql-createfunction