官术网_书友最值得收藏!

The PL/pgSQL Language

The PL/pgSQL language is the default PostgreSQL language to implement functions, procedures, and other general SQL-like executable code.

The idea behind PL/pgSQL is to provide a more flexible and rich language to allow for complex computations, conditionals, iterations, and error handling. PL/pgSQL allows us to group several operations, including SQL statements, into code blocks, which are stored and executed on the server side. This has the benefit of reducing the traffic among the client and the backend.

This chapter will cover the following topics:

  • What a block of code looks like
  • How to execute a block of code with the DO statement
  • How to declare, assign, and use variables, as well as how to print messages
  • Conditionals, iterations (loops), and special variables
  • How to deal with errors and exceptions
主站蜘蛛池模板: 崇阳县| 桂平市| 和林格尔县| 西华县| 安化县| 革吉县| 通山县| 云霄县| 黄浦区| 新巴尔虎右旗| 利辛县| 正宁县| 莒南县| 东宁县| 武隆县| 教育| 北碚区| 商南县| 宁国市| 通渭县| 慈溪市| 宁城县| 兴和县| 财经| 正定县| 甘谷县| 林口县| 大荔县| 黄冈市| 宜良县| 垫江县| 吐鲁番市| 高碑店市| 东乌| 剑阁县| 叙永县| 龙岩市| 那曲县| 略阳县| 阳高县| 甘孜县|