Pavel Stehule

Tags:   postgresql    pspg    plpgsql_check   
Category:   Interviews   
Interviewed by: Andreas Scherbaum

PostgreSQL is the World’s most advanced Open Source Relational Database. The interview series “PostgreSQL Person of the Week” presents the people who make the project what it is today. Read all interviews here.

Please tell us about yourself, and where you are from.

I am from the Czech Republic, and live in my home village in Central Czech. I am an independent developer, consultant and lecturer. My work is 100% related to Postgres - training, solving customer performance issues, writing patches, bug fixing …

Pavel Stehule (Photo by Tomas Vondra)

Pavel Stehule (Photo by Tomas Vondra)

How do you spend your free time? What are your hobbies?

I like watersports - mornings or evenings on the river - camping outside under the stars. But most of my time I spent on my house, doing renovations. Or on hacking Postgres. It can be interesting and hypnotic to create some useful, smart feature for Postgres or understand how some things are working.

Any Social Media channels of yours we should be aware of?

I have a blog with mostly technical content, and I’m on LinkedIn.

Last book you read? Or a book you want to recommend to readers?

Nassim N. Taleb - Skin in the game - Mr Taleb is a very smart man. I also like everything from Terry Prachett. I miss people like Terry Prachett too much. And I read all the books from A. Sapkowski.

Any favorite movie, or show?

All the movies from the Monty Python group, I can watch them over and over again.

How would your ideal weekend look like?

Going outside into nature with a tent, a boat and good friends. We have beautiful rivers for canoeing. I like it. Unfortunately the last couple years have been crazy weather.

What is the best advice you ever got?

“Do things well and don’t lie”

When did you start using PostgreSQL, and why?

My first contact with PostgreSQL was not a success - very early versions of Postgres had a lot of memory leaks, and I could not import my data there (on a computer with 32MB memory). It was a really dark age - we tested every software which was available, because commercial SQL databases were terribly expensive in my country. The second project was a success - it was work for some state agency where I had a possibility to choose any free software, and I like stored procedures - and Postgres was the only free db with stored procedure support. I moved from MS SQL and PLpgSQL, and Postgres’s SQL was several levels better than MSSQL. On top of that, there was the option to enhance and improve Postgres. My first patch for Postgres was the CONTINUE statement for PLpgSQL.

Do you remember which version of PostgreSQL you started with?

The first experience was maybe with 6.4, and real usage started maybe with 7.2, but sure 7.3.

Yes, I studied CVUT - civil engineering - system engineering. One part of my study was related to informatics and project management, and I think it is useful. I had great teachers, although some technologies that we used were really legacy. Broken project management is common (it is in the minds, not in the tools), and these professors taught us to do software as a good craft.

What other databases are you using? Which one is your favorite?

I started with FoxPro, used MS Access and MS SQL twenty years ago, but for the last 15 years I have only used Postgres (and sometimes Oracle, when I prepare a migration from Oracle to Postgres). Surely, I prefer Postres.

I designed and wrote pspg (pager for psql and today for other databases), plpgsql_check and Orafce. Almost all work is done, but sometimes I have some ideas that I try to implement, or some customers have new requests or they find bugs that need to be fixed.

How do you contribute to PostgreSQL?

Over the time I wrote a lot of patches - variadic arguments, default values for arguments, XMLTABLE, RETURN QUERY, format function, … and every year I do a few reviews.

Any contributions to PostgreSQL which do not involve writing code?

Together with Tomas Vondra and a few others I started CSPUG (Czech and Slowak Postgres User Group), and I helped (a little bit) with the organization of the yearly P2D2 conference. Every year I have more than 20 2-3 days courses related to PostgreSQL or PLpgSQL. I write a lot of articles about Postgres.

What is your favorite PostgreSQL extension?

I don’t have one favorite - this is one of the strongest benefits of PostgreSQL, so there are a lot of extensions available. For VACUUM explanation pgstattuple is very good. For good performance: pg_stat_statements and auto_explain, for development in PLpgSQL: plpgsql_check, hstore was important as a pioneer of some non atomic data types, pg_trgm shows the power of PostgreSQL indexes. And a lot of people use Postgres because they use PostGIS, …

What is the most annoying PostgreSQL thing you can think of? And any chance to fix it?

I miss a simple, but robust built-in HA solution. Sure, it can be fixed. BDR can be a way, but it will not be available by tomorrow. And some variant of ONLINE VACUUM FULL without exclusive lock, plus a built-in connection pooler can be included too.

What is the feature you like most in the latest PostgreSQL version?

Index key deduplication is great, incremental sort too, and safe hash_agg is a long wanted feature.

Adding to that, what feature/mechanism would you like to see in PostgreSQL? And why?

I am working on porting applications from Oracle to Postgres. There are three missing features that increase the difficulty of this work: global temporary tables, autonomous transactions, and package variables. GTT and package variables (in Postgres schema variables) are patches in the pool, so there is a chance it can go into Postgres 14.

Could you describe your PostgreSQL development toolbox?

I don’t use anything complex - mc, mcedit, gdb, perf, git, gcc

Which skills are a must have for a PostgreSQL developer/user?

Patience - today’s development cycle is very long - easy implemented features are mostly implemented, and the implementation of new complex features needs years. It is the cost of software maturity and quality. Assertivity is good to have too. In the PostgreSQL world, implementation is usually more simple than finding a good consensus for the design.

Do you use any git best practices, which makes working with PostgreSQL easier?

No, unfortunately I am forever a beginner git user.

Which PostgreSQL conferences do you visit? Do you submit talks?

I have a lot of talks in my home conference P2D2, and I had the opportunity to visit and talk in Moscow at the Russian Postgres conference.

Do you think Postgres has a high entry barrier?

That depends. It is easy to install and use Postgres. But when you have more data or higher workload, then it is good (and sometimes necessary) to understand a few fundamental principles. It is not complicated, but people use it under higher load without necessary knowledge and it will not work well. This results in bad performance, and frustration. Only a few days of training are enough. Tuning PostgreSQL is not hard or complex.

What is your advice for people who want to start PostgreSQL developing - as in, contributing to the project. Where and how should they start?

The most important advice is motivation, respect and good assertivity. I don’t know any other project with similarly high quality C code and similarly accent to software quality. There is no business or market stress. There are very good smart people that are very good developers who write really good code. I can disagree with some opinions on some features, but I don’t doubt their technical or human skills. Sometimes I have to rewrite and update my patch many times, but in the end the work is close to perfect. For me it was an important and good learning process, how to develop complex, mature and long living software with very happy users.

Do you think PostgreSQL will be here for many years in the future?

Sure - it will be around forever. Without any change it works well and there is a lot of inprocess work.

Would you recommend Postgres for business, or for side projects?

Sure - anywhere where there is a need for a stable mature transactional relational database with powerful SQL, Postgres is a great fit. If you can use this type of database, then Postgres will work.

Are you reading the -hackers mailinglist? Any other list?

I am active on the pgsql_hackers mailing list, but don’t read other lists.

What other places do you hang out?

I have a account on Stack Overflow.

Which other Open Source projects are you involved or interested in?

I watch revitalization of old Borland Turbo Vision.

Anything else you like to add?

No, thank you for this interview.