Procedural Programming with PostgreSQL PL/pgSQL: Design Complex Database-Centric Applications with PL/pgSQL 1st Edition Baji Shaik pdf download
Procedural Programming with PostgreSQL PL/pgSQL: Design Complex Database-Centric Applications with PL/pgSQL 1st Edition Baji Shaik pdf download
https://ebookmeta.com/product/postgresql-configuration-best-
practices-for-performance-and-security-1st-edition-baji-shaik-2/
https://ebookmeta.com/product/postgresql-configuration-best-
practices-for-performance-and-security-1st-edition-baji-shaik/
https://ebookmeta.com/product/resilient-oracle-pl-sql-building-
resilient-database-solutions-for-continuous-operation-1st-
edition-stephen-morris/
https://ebookmeta.com/product/home-to-roost-bower-colorado-1st-
edition-reina-torres-torres-reina/
Pull Up a Chair Recipes from My Family to Yours Rachel
Holtzman
https://ebookmeta.com/product/pull-up-a-chair-recipes-from-my-
family-to-yours-rachel-holtzman/
https://ebookmeta.com/product/moving-ideas-multimodality-and-
embodied-learning-in-communities-and-schools-new-literacies-and-
digital-epistemologies-mira-lisa-katz-editor/
https://ebookmeta.com/product/st-dominic-the-story-of-a-
preaching-friar-donald-j-goergen/
https://ebookmeta.com/product/bred-by-the-mafia-monster-breeding-
season-7-1st-edition-sam-crescent-stacey-espino/
https://ebookmeta.com/product/the-other-alcott-1st-edition-elise-
hooper/
Routledge Handbook of Identity Studies 2nd Edition
Anthony Elliott
https://ebookmeta.com/product/routledge-handbook-of-identity-
studies-2nd-edition-anthony-elliott/
Q L
S
E
AG
NGU
Y LA
ER
D QU
RE
TU
RUC
ST
B
TA
Procedural Programming DA
with PostgreSQL DA
TAB
A SE
DA
T
PL/pgSQL
Design Complex Database-Centric
Applications with PL/pgSQL
—
Baji Shaik
Dinesh Kumar Chemuduru
Procedural Programming
with PostgreSQL
PL/pgSQL
Design Complex Database-Centric
Applications with PL/pgSQL
Baji Shaik
Dinesh Kumar Chemuduru
Procedural Programming with PostgreSQL PL/pgSQL: Design Complex
Database-Centric Applications with PL/pgSQL
Baji Shaik Dinesh Kumar Chemuduru
Texas, TX, USA Andhra Pradesh, India
Acknowledgments�������������������������������������������������������������������������������������������������xvii
Introduction������������������������������������������������������������������������������������������������������������xix
v
Table of Contents
Summary������������������������������������������������������������������������������������������������������������������������������������ 25
What’s Next��������������������������������������������������������������������������������������������������������������������������������� 25
Iterative Statement��������������������������������������������������������������������������������������������������������������������� 68
LOOP Statement�������������������������������������������������������������������������������������������������������������������� 69
WHILE Statement������������������������������������������������������������������������������������������������������������������������ 72
FOR Statement���������������������������������������������������������������������������������������������������������������������������� 74
Example Use Cases��������������������������������������������������������������������������������������������������������������������� 78
Example 1������������������������������������������������������������������������������������������������������������������������������ 78
Example 2������������������������������������������������������������������������������������������������������������������������������ 81
Best Practices of Using Control Statements in PL/pgSQL����������������������������������������������������� 84
Summary������������������������������������������������������������������������������������������������������������������������������������ 85
What’s Next��������������������������������������������������������������������������������������������������������������������������������� 85
vii
Table of Contents
viii
Table of Contents
ix
Table of Contents
Summary���������������������������������������������������������������������������������������������������������������������������������� 199
What’s Next������������������������������������������������������������������������������������������������������������������������������� 199
x
Table of Contents
xi
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 311
xii
About the Authors
Baji Shaik, currently serving as a Senior Database
Consultant at AWS Professional Services, embarked on
his journey into the world of databases in 2011. Since
then, his expertise has encompassed an array of database
technologies, including Oracle, PostgreSQL, EDB Postgres,
Amazon RDS, Amazon Aurora, Amazon Redshift, and
Greenplum. Baji’s extensive background spans both depth
and breadth, showcasing his mastery in SQL/NoSQL
database technologies.
Baji stands out as a Database Migration Expert, having
successfully developed numerous database solutions that
tackle complex business challenges, particularly in migrating databases from on-
premises environments to Amazon RDS and Aurora PostgreSQL/MySQL. His prowess
also extends to performance optimization, having fine-tuned RDS/Aurora PostgreSQL/
MySQL databases to achieve remarkable performance benchmarks.
With a passion for knowledge sharing, Baji has authored several notable books on
PostgreSQL, such as PostgreSQL Configuration, Beginning PostgreSQL on the Cloud, and
PostgreSQL Development Essentials. His commitment to education and information
dissemination is further evident through his contributions to conferences, workshops,
and a multitude of insightful blogs within the AWS blog community.
xiii
About the Authors
A coding enthusiast at heart, Dinesh finds joy in crafting applications using Flutter,
Golang, and C++, platforms where his creativity knows no bounds. His proficiency
extends to the deployment phase, as he deftly navigates Kubernetes to bring his coding
creations to life. In the literary domain, Dinesh stands as a coauthor of the esteemed
PostgreSQL High Performance Cookbook, a testament to his mastery of the subject
matter. Beyond his own works, he actively engages in the appraisal of fellow authors’
PostgreSQL books, cementing his status as a valued participant in the exchange of
knowledge.
Dinesh’s impact reverberates through his open source contributions, which include
the inception and enrichment of projects such as PTOR – an ingenious RPO/RTO/SLA
calculator tailored for PostgreSQL. Another tool, “hammerpost,” sets a benchmark for
synthetic parameter evaluation in PostgreSQL, seamlessly integrated with HammerDB.
xiv
About the Technical Reviewer
Deepak Ramnandan Mahto works as a PostgreSQL
Database Engineer at Google Cloud. He has been working
with PostgreSQL since 2018, and he also worked as a
database migration consultant at AWS. He is also a keen
blogger and loves to publish articles on migration, best
practices, and on cloud with PostgreSQL. He loves to
code and build database-related utilities using PL/pgSQL
and SQL.
xv
Exploring the Variety of Random
Documents with Different Content
themselves, are the more precious from the
circumstance that at the present day he is the only
author extant who relates them. It is to be regretted
however that the manner in which he has collected
and grouped this mass of matter, has caused it to
lose some portion of its value, from his mixture of
fable with truth, and more especially from the
difficulty, and in some cases, the impossibility, of
discovering exactly of what object33 he is speaking.
But if Pliny possesses little merit as a critic, it is far
otherwise with his talent as a writer, and the
immense treasury which he opens to us of Latin
terms and forms of expression: these, from the very
abundance of the subjects upon which he treats,
render his work one of the richest repositories of the
Roman language. Wherever he finds it possible to
give expression to general ideas or to philosophical
views, his language assumes considerable energy
and vivacity, and his thoughts present to us a certain
novelty and boldness which tend in a very great
degree to relieve the dryness of his enumerations,
and, with the majority of his readers, excuse the
insufficiency of his scientific indications. He is always
noble and serious, full of the love of justice and
virtue, detestation of cruelty and baseness, of which
he had such frightful instances before his eyes, and
contempt for that unbridled luxury which in his time
had so deeply corrupted the Roman people. For
these great merits Pliny cannot be too highly praised,
and despite the faults which we are obliged to admit
in him when viewed as a naturalist, we are bound to
regard him as one of the most meritorious of the
Roman writers, and among those most worthy to be
reckoned in the number of the classics who wrote
after the reign of Augustus.”
CONTENTS.
BOOK I.
DEDICATION.
Page
C. Plinius Secundus to his friend Titus
Vespasian 1
BOOK II.
BOOK III.
BOOK IV.
DEDICATION.