Hacking PostgreSQL with Eclipse Metin Dl metin@citusdata.com - - PowerPoint PPT Presentation

hacking postgresql with eclipse
SMART_READER_LITE
LIVE PREVIEW

Hacking PostgreSQL with Eclipse Metin Dl metin@citusdata.com - - PowerPoint PPT Presentation

Hacking PostgreSQL with Eclipse Metin Dl metin@citusdata.com PGCONF.EU 2017 1 Motivation Postgres cant do everything You can extend it Eclipse makes it easy 2 Extensions postGIS - Spatial and Geographic objects pg_cron - Run


slide-1
SLIDE 1

Hacking PostgreSQL with Eclipse

Metin Döşlü

metin@citusdata.com

PGCONF.EU 2017

1

slide-2
SLIDE 2

Motivation

2

Postgres can’t do everything You can extend it Eclipse makes it easy

slide-3
SLIDE 3

Extensions

3

postGIS - Spatial and Geographic objects pg_cron - Run periodic jobs hll - HyperLogLog (approximate distinct count) citus - Scale across multiple machines

slide-4
SLIDE 4

Personal Story

4

Distributed PostgreSQL PostgreSQL Extension

slide-5
SLIDE 5

Why Eclipse?

5

Start Fast Easy Navigation Rich Features

slide-6
SLIDE 6

Demo Outline

6

PostgreSQL Inside Eclipse Walking Around Deep Dive

slide-7
SLIDE 7

Demo Outline

7

PostgreSQL Inside Eclipse Walking Around Deep Dive

slide-8
SLIDE 8

Build PostgreSQL

8

./configure CFLAGS=-"O0 -g" make -s -j4 sudo make install

slide-9
SLIDE 9

Import PostgreSQL into Eclipse

9

File -> Import C/C++ -> Existing Code as Makefile Project Turn off scalability mode (optional)

slide-10
SLIDE 10

Demo Outline

10

PostgreSQL Inside Eclipse Walking Around Deep Dive

slide-11
SLIDE 11

Attach GDB

11

select pg_backend_pid(); Debug As -> Debug Configurations C/C++ Attach to Application

slide-12
SLIDE 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...”

slide-13
SLIDE 13

Errors

13

errstart() in elog.c if (elevel >= ERROR)

slide-14
SLIDE 14

Crashes

14

pg_crasher

slide-15
SLIDE 15

Demo Outline

15

PostgreSQL Inside Eclipse Walking Around Deep Dive

slide-16
SLIDE 16

Gatekeeper

16

watch

slide-17
SLIDE 17

Demo Outline

17

PostgreSQL Inside Eclipse Walking Around Deep Dive

slide-18
SLIDE 18

Summary

18

Postgres can’t do everything You can extend Eclipse makes it easy

slide-19
SLIDE 19

Hacking PostgreSQL with Eclipse

Metin Döşlü

metin@citusdata.com

PGCONF.EU 2017

19