Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Hacking PostgreSQL with
Eclipse
Metin Döşlü
metin@citusdata.com
PGCONF.EU 2017
1
Motivation
2
Postgres can’t do everything
You can extend it
Eclipse makes it easy
Extensions
3
postGIS - Spatial and Geographic objects
pg_cron - Run periodic jobs
hll - HyperLogLog (approximate distinct ...
Personal Story
4
Distributed PostgreSQL PostgreSQL Extension
Why Eclipse?
5
Start Fast
Easy Navigation
Rich Features
Demo Outline
6
PostgreSQL Inside Eclipse
Walking Around
Deep Dive
Demo Outline
7
PostgreSQL Inside Eclipse
Walking Around
Deep Dive
Build PostgreSQL
8
./configure CFLAGS=-"O0 -g"
make -s -j4
sudo make install
Import PostgreSQL into Eclipse
9
File -> Import
C/C++ -> Existing Code as Makefile Project
Turn off scalability mode (opti...
Demo Outline
10
PostgreSQL Inside Eclipse
Walking Around
Deep Dive
Attach GDB
11
select pg_backend_pid();
Debug As -> Debug Configurations
C/C++ Attach to Application
PostgreSQL Data Structures
12
Variables window
p pprint(parse)
printf "%s", pretty_format_node_dump(nodeToString(parse))
P...
Errors
13
errstart() in elog.c
if (elevel >= ERROR)
Crashes
14
pg_crasher
Demo Outline
15
PostgreSQL Inside Eclipse
Walking Around
Deep Dive
Gatekeeper
16
watch
Demo Outline
17
PostgreSQL Inside Eclipse
Walking Around
Deep Dive
Summary
18
Postgres can’t do everything
You can extend
Eclipse makes it easy
Hacking PostgreSQL with
Eclipse
Metin Döşlü
metin@citusdata.com
PGCONF.EU 2017
19
Upcoming SlideShare
Loading in …5
×

of

Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 1 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 2 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 3 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 4 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 5 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 6 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 7 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 8 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 9 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 10 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 11 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 12 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 13 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 14 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 15 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 16 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 17 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 18 Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu Slide 19
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

0 Likes

Share

Download to read offline

Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu

Download to read offline

Hacking PostgreSQL, writing patches or creating extensions, might seem intimidating at first. The PostgreSQL codebase is huge and ever-evolving. In this talk, I will show how Eclipse, with the help of gdb, can make it a lot more accessible.

In this interactive talk, we will add the PostgreSQL project and set up gdb inside Eclipse. Then, we will walk step through the code using the debugger to reveal some of PostgreSQL internal data structures. We will show how to see the call stacks of errors and crashes, which saves a lot of headaches during development. Finally, we will show how to add a user-defined function that's written in C.

At the end of the talk, the audience will be more familiar with a simple but powerful environment to hack PostgreSQL.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu

  1. 1. Hacking PostgreSQL with Eclipse Metin Döşlü metin@citusdata.com PGCONF.EU 2017 1
  2. 2. Motivation 2 Postgres can’t do everything You can extend it Eclipse makes it easy
  3. 3. Extensions 3 postGIS - Spatial and Geographic objects pg_cron - Run periodic jobs hll - HyperLogLog (approximate distinct count) citus - Scale across multiple machines
  4. 4. Personal Story 4 Distributed PostgreSQL PostgreSQL Extension
  5. 5. Why Eclipse? 5 Start Fast Easy Navigation Rich Features
  6. 6. Demo Outline 6 PostgreSQL Inside Eclipse Walking Around Deep Dive
  7. 7. Demo Outline 7 PostgreSQL Inside Eclipse Walking Around Deep Dive
  8. 8. Build PostgreSQL 8 ./configure CFLAGS=-"O0 -g" make -s -j4 sudo make install
  9. 9. Import PostgreSQL into Eclipse 9 File -> Import C/C++ -> Existing Code as Makefile Project Turn off scalability mode (optional)
  10. 10. Demo Outline 10 PostgreSQL Inside Eclipse Walking Around Deep Dive
  11. 11. Attach GDB 11 select pg_backend_pid(); Debug As -> Debug Configurations C/C++ Attach to Application
  12. 12. PostgreSQL Data Structures 12 Variables window p pprint(parse) printf "%s", pretty_format_node_dump(nodeToString(parse)) Preferences -> C/C++ -> Debug -> GDB -> Check “Show the GDB traces...”
  13. 13. Errors 13 errstart() in elog.c if (elevel >= ERROR)
  14. 14. Crashes 14 pg_crasher
  15. 15. Demo Outline 15 PostgreSQL Inside Eclipse Walking Around Deep Dive
  16. 16. Gatekeeper 16 watch
  17. 17. Demo Outline 17 PostgreSQL Inside Eclipse Walking Around Deep Dive
  18. 18. Summary 18 Postgres can’t do everything You can extend Eclipse makes it easy
  19. 19. Hacking PostgreSQL with Eclipse Metin Döşlü metin@citusdata.com PGCONF.EU 2017 19

Hacking PostgreSQL, writing patches or creating extensions, might seem intimidating at first. The PostgreSQL codebase is huge and ever-evolving. In this talk, I will show how Eclipse, with the help of gdb, can make it a lot more accessible. In this interactive talk, we will add the PostgreSQL project and set up gdb inside Eclipse. Then, we will walk step through the code using the debugger to reveal some of PostgreSQL internal data structures. We will show how to see the call stacks of errors and crashes, which saves a lot of headaches during development. Finally, we will show how to add a user-defined function that's written in C. At the end of the talk, the audience will be more familiar with a simple but powerful environment to hack PostgreSQL.

Views

Total views

1,291

On Slideshare

0

From embeds

0

Number of embeds

667

Actions

Downloads

8

Shares

0

Comments

0

Likes

0

×