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

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
主站蜘蛛池模板: 嘉定区| 板桥市| 凤山县| 商水县| 公主岭市| 绥芬河市| 镇宁| 仁布县| 咸阳市| 隆安县| 桂林市| 巍山| 黔西县| 惠州市| 青阳县| 临洮县| 新昌县| 中卫市| 丰镇市| 巫山县| 三明市| 游戏| 高要市| 绥德县| 涿鹿县| 琼海市| 布尔津县| 梁山县| 嘉峪关市| 珲春市| 红安县| 澄江县| 泊头市| 北安市| 镇雄县| 芒康县| 门头沟区| 北宁市| 沭阳县| 吴江市| 黑龙江省|