更新时间:2021-06-10 19:23:32
coverpage
Title Page
Dedication
About Packt
Why subscribe?
Packt.com
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
PostgreSQL Server-side Programming
What is server-side programming?
How to get help
The example database
The source code of the examples in this book
Summary
Statement Tricks: UPSERTs RETURNING and CTEs
Inserting updating or both?
Getting back modified data with RETURNING
Common Table Expressions (CTEs)
Introducing CTEs
Writable CTEs and the RETURNING clause: Pipelining statements
Recursive CTEs
References
The PL/pgSQL Language
An introduction to PL/pgSQL
Variables and variable assignment
Conditionals
Iterations
Exceptions and error handling
The RAISE statement revisited
Executing dynamic statements
Throwing away a query result set
The FOUND Global Variable
Stored Procedures
Using functions procedures and routines
Supported languages
Functions
Return Types
Function argument list
Returning values to the caller
Security
Immutability
Costs
Moving functions to other schemas
Temporary functions
Where is my function?
Permissions
A tag insertion function
Compile and runtime problem detection
Procedures
Procedure argument list
Moving procedures to other schemas
Temporary procedures
Where is my procedure?
Interacting with transactions
Nesting transactions and procedures
PL/Perl and PL/Java
PL/Perl
Database interaction
Function arguments and return types
Re-implementing functions in PL/Perl
Implementing routines in PL/Perl
PL/Java
Installing PL/Java
PL/Java main concepts
Implementing a PL/Java function without a deployment descriptor
Implementing a PL/Java function with a deployment descriptor
Triggers
Data manipulation triggers
The trigger function
Creating a simple trigger
Discovering if a table has triggers
Disabling Triggers
Using triggers to modify data on the fly
Parametric triggers
Aborting the current statement
The WHEN condition
The REFERENCING clause
Using a trigger to perform multiple statements
Trigger examples in foreign languages
PL/Perl Triggers