© Henrietta Dombrovskaya, Boris Novikov, Anna Bailliekova 2021
H. Dombrovskaya et al.PostgreSQL Query Optimizationhttps://doi.org/10.1007/978-1-4842-6885-8_12

12. Dynamic SQL

Henrietta Dombrovskaya1  , Boris Novikov2 and Anna Bailliekova3
(1)
Braviant Holdings, Chicago, IL, USA
(2)
HSE University, Saint Petersburg, Russia
(3)
Zendesk, Madison, WI, USA
 

What Is Dynamic SQL

Dynamic SQL is any SQL statement that is first built as a text string and then executed using the EXECUTE command. An example of dynamic SQL is shown in Listing 12-1. Possibilities that are opened by using dynamic SQL are underused in most of RDBMSs, but even more so in PostgreSQL. The recommendations provided in this chapter go against the grain of what many database textbooks say, but ...

Get PostgreSQL Query Optimization: The Ultimate Guide to Building Efficient Queries now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.