SlideShare a Scribd company logo
Must-Know Postgres Extensions
for DBAs and Developers During
Migration
Deepak Mahto
DataCloudGaze Consulting
© 2024 All Rights Reserved
About Me
I am Deepak Mahto, and I like to call myself a
Database Guy.
● Founder of DataCloudGaze Consulting.
● I have 15+ years of database experience,
with more than 7 years in cloud and
migrations.
● I have published 150+ technical blogs on
databases.
● I live in Mumbai and have a 3-year-old child.
● Loves to explore street food.
© 2024 All Rights Reserved
Agenda
● What are Postgres Extensions and Their Importance
● Some Fun Facts About Extensions
● List of Extensions to Aid in Migration from Heterogeneous Sources Like
Oracle and MSSQL
© 2024 All Rights Reserved
What is extension?
PostgreSQL's extensibility allows for seamless integration of extensions,
making them function like built-in features, thus enhancing its capabilities
and flexibility.
© 2024 All Rights Reserved
Extensive versatility of Extension’s
Reference - https://cloud.tembo.io
© 2024 All Rights Reserved
Create Extension in Postgres
CREATE EXTENSION loads and manages new extensions, requiring appropriate
privileges.
© 2024 All Rights Reserved
Postgres fun fact - default extension.
PL/pgSQL is a loadable procedural language for the PostgreSQL database
system that is default extension created with each new database.
© 2024 All Rights Reserved
More supported Procedural Language as extensions
● PL/R - PostgreSQL support for R as a procedural language (PL)
● PL/V8 - A procedural language in JavaScript powered by V8
● PL/Tcl - Tcl procedural language for PostgreSQL.
● PL/Perl - The Perl procedural language for PostgreSQL.
● PL/Rust - Procedural language in the Rust programming.
● PL/Python - Untrusted procedural language for PostgreSQL.
More..
pg_stat_statements
Track statistics of SQL planning and execution
pg_stat_statements - toplevel to track nested calls.
Problematic SQL!
pg_stat_statements - toplevel to track nested calls.
*pg_stat_statements.track = 'all' (only for non prod or specific session)
Identify problematic sql within procedural
block.
© 2024 All Rights Reserved
pg_hint_plan - Influence sql performance
Makes it possible to tweak PostgreSQL execution plans using so-called
"hints" in SQL comments
Influence access
path and
Join method
hypopg - Invisible Indexes
PostgreSQL extension adding support for hypothetical indexes
Validate and test indexes
before actually creating
it.
orafce - Oracle’s compatibility functions and packages
Emulate a subset of functions and packages from the Oracle RDBMS.
oracle_fdw - Foreign Data Wrapper for Oracle
Facilitate seamless data migration and integration between Oracle databases
and PostgreSQL.
pgtt - Temporary Table across schema
Use Oracle-style Global Temporary Tables and the others RDBMS.
Session 1
Session 2
pgaudit - Compliance and Regulatory
provides detailed session and/or object audit logging via the standard
PostgreSQL logging facility.
pgaudit
Configuring custom logging based on compliance requirement.
Table Partitioning Maintenance –
pg_partman/pg_cron
© 2024 All Rights Reserved
PL/pgSQL Conversion - Challenge
postgres=# SELECT func_demo1();
ERROR: column "col1" does not exist
LINE 1: SELECT 1 WHERE COL1 =
1
QUERY: SELECT 1
WHERE COL1 = 1
CONTEXT: PL/pgSQLfunction
func_demo1() line 4 at SQL statement
PL/pgSQL functions aren't syntax-checked until executed.
© 2024 All Rights Reserved
plpgsql_check extension to rescue.
Extension serves as a comprehensive linter for plpgsql in Postgres
● Utilizes the internal PostgreSQL parser/evaluator to display runtime errors.
● Parses SQL inside routines to identify errors not typically found during
"CREATE PROCEDURE/FUNCTION" commands.
● The plpgsql_check extension detects issues in PL/pgSQL code:
undefined/unused variables, type mismatches, control flow errors, incorrect
function calls, trigger problems, and SQL statement errors.
© 2024 All Rights Reserved
Some more essential extensions
- pg_repack - lets you remove bloat from tables and indexes as online.
- pglogical - PostgreSQL Logical Replication - Change Data Capture.
- hydra_columnar - Analytics- Columnar storage for Postgres
- passwordcheck* - Checks and rejects weak passwords.
- postgresql_anonymizer - Anonymization & Data Masking.
- auto_explain - logging execution plans of slow statements
automatically.
© 2024 All Rights Reserved
Thank you!
https://www.datacloudgaze.com/
https://www.linkedin.com/in/mahtodeepak/
https://x.com/mahtodeepak05
https://databaserookies.wordpress.com/

More Related Content

Similar to Must Know Postgres Extension for DBA and Developer during Migration (20)

PDF
PostgreSQL Server Programming 2nd Edition Usama Dar
obdlioubysz
 
PDF
PostgreSQL Server Programming 2nd Edition Usama Dar
mavriclasme
 
PDF
Advanced pg_stat_statements: Filtering, Regression Testing & more
Lukas Fittl
 
PPTX
PostgreSQL Performance Problems: Monitoring and Alerting
Grant Fritchey
 
PDF
Get PostgreSQL Server Programming - Second Edition Dar free all chapters
kapuilakna
 
PDF
PostgreSQL Extension APIs are Changing the Face of Relational Databases | PGC...
Teresa Giacomini
 
KEY
Building and Distributing PostgreSQL Extensions Without Learning C
David Wheeler
 
KEY
PostgreSQL
Reuven Lerner
 
PDF
PostgreSQL Server Programming Second Edition Usama Dar Hannu Krosing Jim Mlod...
trddarvai
 
PDF
PostgreSQL Server Programming Second Edition Usama Dar Hannu Krosing Jim Mlod...
servanjervy
 
PPTX
Oracle to Postgres Schema Migration Hustle
EDB
 
PDF
0292-introduction-postgresql.pdf
Mustafa Keskin
 
PDF
Migrating to postgresql
botsplash.com
 
PDF
PostgreSQL Server Programming 2nd Edition Usama Dar
bhaveeranirh
 
PDF
Rohit_vyas_PGDay_Presentation
Rohit vyas
 
PDF
Case Studies on PostgreSQL
InMobi Technology
 
KEY
Releasing PostgreSQL Extension on PGXN
David Wheeler
 
PPTX
TechEvent PostgreSQL Best Practices
Trivadis
 
PDF
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
PROIDEA
 
PPTX
Migrating To PostgreSQL
Grant Fritchey
 
PostgreSQL Server Programming 2nd Edition Usama Dar
obdlioubysz
 
PostgreSQL Server Programming 2nd Edition Usama Dar
mavriclasme
 
Advanced pg_stat_statements: Filtering, Regression Testing & more
Lukas Fittl
 
PostgreSQL Performance Problems: Monitoring and Alerting
Grant Fritchey
 
Get PostgreSQL Server Programming - Second Edition Dar free all chapters
kapuilakna
 
PostgreSQL Extension APIs are Changing the Face of Relational Databases | PGC...
Teresa Giacomini
 
Building and Distributing PostgreSQL Extensions Without Learning C
David Wheeler
 
PostgreSQL
Reuven Lerner
 
PostgreSQL Server Programming Second Edition Usama Dar Hannu Krosing Jim Mlod...
trddarvai
 
PostgreSQL Server Programming Second Edition Usama Dar Hannu Krosing Jim Mlod...
servanjervy
 
Oracle to Postgres Schema Migration Hustle
EDB
 
0292-introduction-postgresql.pdf
Mustafa Keskin
 
Migrating to postgresql
botsplash.com
 
PostgreSQL Server Programming 2nd Edition Usama Dar
bhaveeranirh
 
Rohit_vyas_PGDay_Presentation
Rohit vyas
 
Case Studies on PostgreSQL
InMobi Technology
 
Releasing PostgreSQL Extension on PGXN
David Wheeler
 
TechEvent PostgreSQL Best Practices
Trivadis
 
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
PROIDEA
 
Migrating To PostgreSQL
Grant Fritchey
 

More from Mydbops (20)

PDF
Scaling TiDB for Large-Scale Application
Mydbops
 
PDF
AWS MySQL Showdown - RDS vs RDS Multi AZ vs Aurora vs Serverless - Mydbops...
Mydbops
 
PDF
Mastering Vector Search with MongoDB Atlas - Manosh Malai - Mydbops MyWebinar 39
Mydbops
 
PDF
Migration Journey To TiDB - Kabilesh PR - Mydbops MyWebinar 38
Mydbops
 
PDF
AWS Blue Green Deployment for Databases - Mydbops
Mydbops
 
PDF
What's New In MySQL 8.4 LTS Mydbops MyWebinar Edition 36
Mydbops
 
PDF
What's New in PostgreSQL 17? - Mydbops MyWebinar Edition 35
Mydbops
 
PDF
What's New in MongoDB 8.0 - Mydbops MyWebinar Edition 34
Mydbops
 
PDF
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
PDF
Read/Write Splitting using MySQL Router - Mydbops Meetup16
Mydbops
 
PDF
TiDB - From Data to Discovery: Exploring the Intersection of Distributed Dat...
Mydbops
 
PDF
MySQL InnoDB Storage Engine: Deep Dive - Mydbops
Mydbops
 
PDF
Demystifying Real time Analytics with TiDB
Mydbops
 
PDF
Efficient MySQL Indexing and what's new in MySQL Explain
Mydbops
 
PDF
Scale your database traffic with Read & Write split using MySQL Router
Mydbops
 
PDF
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
Mydbops
 
PDF
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Mydbops
 
PDF
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mydbops
 
PDF
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Mydbops
 
PDF
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
Mydbops
 
Scaling TiDB for Large-Scale Application
Mydbops
 
AWS MySQL Showdown - RDS vs RDS Multi AZ vs Aurora vs Serverless - Mydbops...
Mydbops
 
Mastering Vector Search with MongoDB Atlas - Manosh Malai - Mydbops MyWebinar 39
Mydbops
 
Migration Journey To TiDB - Kabilesh PR - Mydbops MyWebinar 38
Mydbops
 
AWS Blue Green Deployment for Databases - Mydbops
Mydbops
 
What's New In MySQL 8.4 LTS Mydbops MyWebinar Edition 36
Mydbops
 
What's New in PostgreSQL 17? - Mydbops MyWebinar Edition 35
Mydbops
 
What's New in MongoDB 8.0 - Mydbops MyWebinar Edition 34
Mydbops
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
Read/Write Splitting using MySQL Router - Mydbops Meetup16
Mydbops
 
TiDB - From Data to Discovery: Exploring the Intersection of Distributed Dat...
Mydbops
 
MySQL InnoDB Storage Engine: Deep Dive - Mydbops
Mydbops
 
Demystifying Real time Analytics with TiDB
Mydbops
 
Efficient MySQL Indexing and what's new in MySQL Explain
Mydbops
 
Scale your database traffic with Read & Write split using MySQL Router
Mydbops
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
Mydbops
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Mydbops
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mydbops
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Mydbops
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
Mydbops
 
Ad

Recently uploaded (20)

PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Ad

Must Know Postgres Extension for DBA and Developer during Migration

  • 1. Must-Know Postgres Extensions for DBAs and Developers During Migration Deepak Mahto DataCloudGaze Consulting
  • 2. © 2024 All Rights Reserved About Me I am Deepak Mahto, and I like to call myself a Database Guy. ● Founder of DataCloudGaze Consulting. ● I have 15+ years of database experience, with more than 7 years in cloud and migrations. ● I have published 150+ technical blogs on databases. ● I live in Mumbai and have a 3-year-old child. ● Loves to explore street food.
  • 3. © 2024 All Rights Reserved Agenda ● What are Postgres Extensions and Their Importance ● Some Fun Facts About Extensions ● List of Extensions to Aid in Migration from Heterogeneous Sources Like Oracle and MSSQL
  • 4. © 2024 All Rights Reserved What is extension? PostgreSQL's extensibility allows for seamless integration of extensions, making them function like built-in features, thus enhancing its capabilities and flexibility.
  • 5. © 2024 All Rights Reserved Extensive versatility of Extension’s Reference - https://cloud.tembo.io
  • 6. © 2024 All Rights Reserved Create Extension in Postgres CREATE EXTENSION loads and manages new extensions, requiring appropriate privileges.
  • 7. © 2024 All Rights Reserved Postgres fun fact - default extension. PL/pgSQL is a loadable procedural language for the PostgreSQL database system that is default extension created with each new database.
  • 8. © 2024 All Rights Reserved More supported Procedural Language as extensions ● PL/R - PostgreSQL support for R as a procedural language (PL) ● PL/V8 - A procedural language in JavaScript powered by V8 ● PL/Tcl - Tcl procedural language for PostgreSQL. ● PL/Perl - The Perl procedural language for PostgreSQL. ● PL/Rust - Procedural language in the Rust programming. ● PL/Python - Untrusted procedural language for PostgreSQL. More..
  • 9. pg_stat_statements Track statistics of SQL planning and execution
  • 10. pg_stat_statements - toplevel to track nested calls. Problematic SQL!
  • 11. pg_stat_statements - toplevel to track nested calls. *pg_stat_statements.track = 'all' (only for non prod or specific session) Identify problematic sql within procedural block.
  • 12. © 2024 All Rights Reserved pg_hint_plan - Influence sql performance Makes it possible to tweak PostgreSQL execution plans using so-called "hints" in SQL comments Influence access path and Join method
  • 13. hypopg - Invisible Indexes PostgreSQL extension adding support for hypothetical indexes Validate and test indexes before actually creating it.
  • 14. orafce - Oracle’s compatibility functions and packages Emulate a subset of functions and packages from the Oracle RDBMS.
  • 15. oracle_fdw - Foreign Data Wrapper for Oracle Facilitate seamless data migration and integration between Oracle databases and PostgreSQL.
  • 16. pgtt - Temporary Table across schema Use Oracle-style Global Temporary Tables and the others RDBMS. Session 1 Session 2
  • 17. pgaudit - Compliance and Regulatory provides detailed session and/or object audit logging via the standard PostgreSQL logging facility.
  • 18. pgaudit Configuring custom logging based on compliance requirement.
  • 19. Table Partitioning Maintenance – pg_partman/pg_cron
  • 20. © 2024 All Rights Reserved PL/pgSQL Conversion - Challenge postgres=# SELECT func_demo1(); ERROR: column "col1" does not exist LINE 1: SELECT 1 WHERE COL1 = 1 QUERY: SELECT 1 WHERE COL1 = 1 CONTEXT: PL/pgSQLfunction func_demo1() line 4 at SQL statement PL/pgSQL functions aren't syntax-checked until executed.
  • 21. © 2024 All Rights Reserved plpgsql_check extension to rescue. Extension serves as a comprehensive linter for plpgsql in Postgres ● Utilizes the internal PostgreSQL parser/evaluator to display runtime errors. ● Parses SQL inside routines to identify errors not typically found during "CREATE PROCEDURE/FUNCTION" commands. ● The plpgsql_check extension detects issues in PL/pgSQL code: undefined/unused variables, type mismatches, control flow errors, incorrect function calls, trigger problems, and SQL statement errors.
  • 22. © 2024 All Rights Reserved Some more essential extensions - pg_repack - lets you remove bloat from tables and indexes as online. - pglogical - PostgreSQL Logical Replication - Change Data Capture. - hydra_columnar - Analytics- Columnar storage for Postgres - passwordcheck* - Checks and rejects weak passwords. - postgresql_anonymizer - Anonymization & Data Masking. - auto_explain - logging execution plans of slow statements automatically.
  • 23. © 2024 All Rights Reserved Thank you! https://www.datacloudgaze.com/ https://www.linkedin.com/in/mahtodeepak/ https://x.com/mahtodeepak05 https://databaserookies.wordpress.com/