Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hacking PostgreSQL with Eclipse | PGConf EU 201...

Citus Data
October 26, 2017

Hacking PostgreSQL with Eclipse | PGConf EU 2017 | Metin Doslu

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.

Citus Data

October 26, 2017
Tweet

More Decks by Citus Data

Other Decks in Technology

Transcript

  1. Extensions 3 postGIS - Spatial and Geographic objects pg_cron -

    Run periodic jobs hll - HyperLogLog (approximate distinct count) citus - Scale across multiple machines
  2. Import PostgreSQL into Eclipse 9 File -> Import C/C++ ->

    Existing Code as Makefile Project Turn off scalability mode (optional)
  3. 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...”