loader image

PostgreSQL Development

Overview

This course covers important basic and intermediate level details for developers interacting with PostgreSQL. Delegates will learn techniques, syntax and structures needed to develop quality applications using the PostgreSQL backend. This course also covers SQL Tuning best practices for writing efficient SQL. This course will benefit anyone who has a working knowledge of PostgreSQL but needs to enhance this to include PL/pgSQL, additional functions, and techniques to monitor and optimise query performance.

Course Objective

By the end of this 3-day course, participants will be able to:

  • Deepen their understanding of PostgreSQL by mastering advanced SQL techniques and data processing capabilities.

  • Develop, manage, and optimize PL/pgSQL programs including stored procedures, functions, and triggers.

  • Implement complex queries using grouping sets, analytical functions, and recursive common table expressions.

  • Improve application performance through SQL tuning and query optimization strategies.

  • Utilize cursors, control structures, and exception handling to create efficient, robust PostgreSQL-based applications.

  • Manage transactions and concurrency effectively, understanding locking mechanisms and isolation levels.

  • Perform data import/export tasks using PostgreSQL’s COPY command for efficient bulk data handling.

Who Should Attend

The target audience includes developers and programmers who want to extend their knowledge of PostgreSQL to encompass advanced SQL techniques and the usage of Stored Program Units such as triggers, procedures and functions.

Prerequisites

This course assumes a good working knowledge of PostgreSQL SQL. This can be obtained by attendance on the pre-requisite SQL for PostgreSQL course.
Analyzing Data with MS Excel

Training Calendar

Intake

Duration

Program Fees

Inquire further

3 Day

Contact us to find out more

Module

• Administration and course materials
• Course structure and agenda
• Delegate and trainer introductions

• Advanced Datatypes
• Data Type Conversion

• Revision of aggregate functions and basic GROUP BY and HAVING
clauses
• ROLLUP extension
• CUBE extension
• GROUPING function
• GROUPING SETS function

• Ranking functions
• NTILE and WIDTH_BUCKET functions
• Analytic aggregates
• Windowing functions
• Row and Range specifications
• FIRST_VALUE and LAST_VALUE
• LAG and LEAD functions

• The WITH clause
• Recursive Common Table Expressions

• Match operators and notation
• Repetition operators
• Regular Expression functions
• Sub-expression grouping
• SQL Regular Expressions

• Extending SQL with Procedural Code
• Basic Elements
• Variables and Constants
• Data Types
• Initialising Variables and Assigning Values
• Using DML Statements in Code
• Generating Output

• IF THEN ELSIF ELSE Statements
• CASE Statements
• The Basic Loop Construct
• WHILE and FOR Loops
• Nested and Labelled Loops
• The CONTINUE Statemen

• What is a Cursor?
• Implicit and Explicit Cursors
• Cursor Operations
• Declaring,Opening and Closing Cursors
• Fetching Rows
• Status Checking
• Where current of clause
• Unbound cursors (refcursors)
• The Cursor FOR Loop
• Parameterised Cursors

• Errors and Messages
• The EXCEPTION clause
• System Raised Exceptions
• The RAISE statement
• STRICT option in a SELECT ..INTO
• Programmer Raised Exceptions
• The GET STACKED DIAGNOSTICS command
• Nested and Labelled Blocks
• Scope of Variables and Cursors

• CREATE FUNCTION statement
• Function parameters
• Functions Returning Void
• Execute a function using PERFORM
• Listing Functions
• ALTER and DROP FUNCTION statements

• CREATE PROCEDURE statement
• Procedure parameters
• Invoke a procedure using CALL
• Definer’s and Invoker’s rights execution
• ALTER and DROP PROCEDURE statements

• DML Triggers
• The Trigger Function
• The CREATE TRIGGER Statement
• BEFORE, AFTER and INSTEAD OF Triggers
• The OLD and NEW qualifiers
• Errors in Triggers
• DDL and Database Event Triggers
• Managing Triggers
• Privileges to create Triggers

• Overview of Transaction Processing in PostgreSQL
• Transaction Control
• COMMIT, ROLLBACK and SAVEPOINT statements
• AUTOCOMMIT
• Multi-version Concurrency Control (MVCC)
• Transaction Isolation Levels
• Locking Concepts
• Possible Causes of Contention
• Deadlocks
• Implicit and Explicit Locking of Tables and Rows
• Advisory Locks
• Lock Management Parameters

• Query Optimization
• Scan Methods
• Join Methods
• Join Order
• Statement Transformation
• Detect Slow Queries
• View Execution Plans using EXPLAIN
• Gather Optimizer Statistics with ANALYZE
• Gather Extended Statistics with CREATE STATISTICS
• Parameters that affect Optimization
• Memory Settings that affect Query Performance
• Overview of declarative Table Partitioning

• Import and Export Operations with COPY
• Export using the COPY Command
• Import using the COPY Command

FAQs

Q: What is the PostgreSQL – Development course about?
A: This 3-day course provides developers with the knowledge and practical skills required to develop, optimize, and manage applications using PostgreSQL. It covers advanced SQL techniques, server programming, PL/pgSQL, performance tuning, and query optimization. Participants will also gain hands-on experience in working with triggers, procedures, functions, and transactions.

Q: Who should attend this course?
A: This course is designed for developers and programmers who already have a working knowledge of PostgreSQL and wish to deepen their understanding by learning advanced SQL techniques, server programming, and performance optimization.

Q: What are the prerequisites for this course?
A: Participants should have a good working knowledge of PostgreSQL SQL. Familiarity with basic SQL concepts can be gained by attending the prerequisite “SQL for PostgreSQL” course.

Q: How long is the course?
A: The course duration is 3 days.

Q: What key topics are covered in this course?
A: Key topics include:

  • Advanced SQL features such as grouping, analytical queries, and regular expressions

  • Recursive queries and windowing functions

  • PL/pgSQL programming, including procedures, triggers, and functions

  • Cursor management and exception handling

  • Transaction control, concurrency, and locking mechanisms

  • SQL query tuning, including performance optimization and execution plans

  • Data import/export using the COPY command

Q: Will I receive a certification after completing the course?
A: While this course provides the necessary skills for PostgreSQL development, it does not include a certification exam. A certificate of completion may be provided by the training provider.

Q: What skills will I gain from the PostgreSQL – Development course?
A: You will gain hands-on skills in advanced SQL techniques, server programming using PL/pgSQL, writing functions and procedures, working with triggers, optimizing queries, handling exceptions, managing transactions, and performance tuning for PostgreSQL applications.

Q: Will I learn how to optimize PostgreSQL performance?
A: Yes, the course covers query optimization, execution plans, join methods, scan methods, and techniques to enhance PostgreSQL performance, including the use of memory settings and optimizer statistics.

Q: Can I learn how to manage PostgreSQL triggers and procedures?
A: Yes, the course includes in-depth coverage of creating and managing triggers, stored procedures, and functions, including when to use them and how to handle exceptions effectively.

Q: Is transaction management included in the course?
A: Yes, the course covers transaction processing in PostgreSQL, including transaction control, isolation levels, multi-version concurrency control (MVCC), and locking mechanisms to ensure efficient database operation.

Q: Will I be able to extend PostgreSQL after the course?
A: Yes, you will learn to extend PostgreSQL by writing PL/pgSQL functions, creating stored procedures, and implementing triggers to enhance database capabilities. You will also gain experience with cursors and custom exception handling.

Submit your interest today !

Contact us