Live data from Hacker News

The PostgreSQL documentation and the limitations of community

rhaas.blogspot.com

51–60 of 61 posts

Re: The PostgreSQL documentation and the limitations of community

#51
post #30

I was recently reading the documentation for pgcrypto to implement user authentication in SQLPage: https://www.postgresql.org/docs/current/pgcrypto.html The page contains the documentation of many functions, all of which raise the following error by default when you run them: No function matches the given name and argument types. It turns out you first have to "install" them by running "create extension pgcrypto", wh…

You just click `Up` to go a level higher in the documentation and it explains everything. This is just intellectual laziness.

Its like complaining your car manual doesn't say you have to open the hood of the car on the same page it explains how to change the wiper fluid.

Re: The PostgreSQL documentation and the limitations of community

#52
post #2

I think the main limitation of our docs is that it mostly explains what the pieces do, not how to use them to achieve a particular goal. For example, we have pretty good documentation of all the pieces to do HA, we just don't tell people how to assemble them together. The reason is, I think, that flexibility is a pretty fundamental part of the project. We're great at providing building blocks (and documenting them),…

From the post:

> But, you know, I was a loyal servant of the community process. I was asked to document that stuff, and I did, and I put it in the documentation in the place where it most logically seemed to go. The fact that the overall structure of the documentation probably isn't for the best is not my fault, nor is correcting it my responsibility. And it's not anyone else's responsibility, either.

...

> It's not difficult to understand why this happens. If I add a new feature to do a certain thing to PostgreSQL, I am the expert on that feature. There's nobody else who knows better than I do what the documentation for that feature ought to say. My work might have shortcomings just like anyone else's, but especially if I'm just adding new entries to tables that already contain dozens or hundreds of existing entries, how much difference of opinion can there reasonably be? It's more likely that reading the documentation will cause someone to take issue with the design of the feature itself than it is that they won't like the way it's documented.

Which, I think, is blind to the bigger issue.

As you note:

> The reason is, I think, that flexibility is a pretty fundamental part of the project. We're great at providing building blocks (and documenting them), but we steer clear of describing a particular way to assemble them together.

...

> In other words, our docs are written by devs for devs, and we leave the higher level stuff to tutorials written by others etc.

The deeper and more common problem between those two symptoms, which the OP misses, is that the people writing the docs often don't use, and maybe haven't ever used, the tool or features they're documenting in their most common productive modes. The most productive devs are often the least knowledgable people in how most, or even many, users use it.

Companies often hire (and compensate) someone to try to take the giant mess of dev-written reference content and make guides out of them. But if those people don't use the product either, you just get better-organized docs that still miss the point.

Most tools need usage experts writing docs far more than they need feature or software experts. The time of open-source tools' usage experts — "written by others etc." — is often as or more valuable than the time of the open-source project's engineers'. Usage experts are likely being compensated to do almost anything but document the open-source tool, or might even be compensated to document the tools privately or internally for others in an organization to use them better than potential competitors — the opposite of community.

The kinds of tools where this trends toward open tutorial creation and documentation tend to have communities of users who aren't as focused on specific tools or narrow usage as systems tools like PostgreSQL — gamedev and media production tools come to mind.

"Make a game" or "make a movie" are no less varied than "make an app" or "make a service", and can still be prone to tooling disputes (ie. using Unity vs. Unreal vs. Godot, Premiere vs. Final Cut vs. Davinci), but seem to fall into the trap of hoarding tool knowledge less often. Maybe because there's more authorship and recognition to those types of work, I'm not sure.

Re: The PostgreSQL documentation and the limitations of community

#53
post #8
post #2

I think the main limitation of our docs is that it mostly explains what the pieces do, not how to use them to achieve a particular goal. For example, we have pretty good documentation of all the pieces to do HA, we just don't tell people how to assemble them together. The reason is, I think, that flexibility is a pretty fundamental part of the project. We're great at providing building blocks (and documenting them),…

Another good example is the differences in the documentation for Indexes, vs the https://use-the-index-luke.com/ that explains many of the reasons WHY you want to organize it with great examples. A problem I have is so many tutorials, or 'best practices' I find on the internet are for older versions that don't really apply as well in newer versions of postgres. Like searching for logical replication, you find lots of…

> I would love to see a 'tutorials/guide' and 'best practices' part of the documentation that is updated with each new release, that give examples of the most common tasks, and when/why to use them, and when to move to something more advanced.

Tutorials and best practices come about from real-world usage, which is why they're often out of date — by the time someone becomes enough of an expert on features specific to a version to write good-quality content of that nature, a new version is out. The only way to update those is through real-world usage, which means shipping pre-release versions for long-enough periods of time and having them used to ship real things, all before the release.

Does PostgreSQL do this? It hasn't in my experience, but it's admittedly limited to the last 5-6 years.

Re: The PostgreSQL documentation and the limitations of community

#54
post #2

I think the main limitation of our docs is that it mostly explains what the pieces do, not how to use them to achieve a particular goal. For example, we have pretty good documentation of all the pieces to do HA, we just don't tell people how to assemble them together. The reason is, I think, that flexibility is a pretty fundamental part of the project. We're great at providing building blocks (and documenting them),…

How-to and guides are an amazing way to do docs. I love the guides of Ruby on Rails. I rarely used the API documentation.

There is a great article talking about the 4 different types of documentation named the “document system”.

https://documentation.divio.com/

Re: The PostgreSQL documentation and the limitations of community

#55
post #8
post #2

I think the main limitation of our docs is that it mostly explains what the pieces do, not how to use them to achieve a particular goal. For example, we have pretty good documentation of all the pieces to do HA, we just don't tell people how to assemble them together. The reason is, I think, that flexibility is a pretty fundamental part of the project. We're great at providing building blocks (and documenting them),…

Another good example is the differences in the documentation for Indexes, vs the https://use-the-index-luke.com/ that explains many of the reasons WHY you want to organize it with great examples. A problem I have is so many tutorials, or 'best practices' I find on the internet are for older versions that don't really apply as well in newer versions of postgres. Like searching for logical replication, you find lots of…

> Like searching for logical replication, you find lots of information for pg_logical for older versions of postgres, but many of those parts are now baked into postgres, but with a different syntax, etc.

I tend to see this as duality of static/ephemeral. On one hand you have "vendors" treating software as rolling moving target - latest and greatest is all there is. On the other hand, there are community guides and tutorials that are out there and never retracted or amended.

Let's say I find an article that luckily states being written against older version of software. How do I know whether the information is still valid and applicable to a newer version? Well, if I am lucky and the vendor publishes growing changelog I have to read it and judge of the changes are applicable. Maybe I have to hunt down changelogs from all the interim versions just to see if anything important to me changed. Most probably I will find a very succinct summary of the change like "toll x was merged into tool y" or "updated interface of x". Now I have to try and find the discussion around the change in mailing lists (hopefully the team has not migrated to Discord).

Contrast this with hardware. Quite possibly I will find erratas and/or product change notices discussing the changes, maybe even application guides discussing how to apply changes. Unless there is an entirely new product line being released there is high change there will be rather detailed documentation on changes. Software is usually majorly lacking in this regard.

And no, versioned documentation is not the answer. Documentation gets updated not only technically, but also as discussed structurally. Once a piece of documentation gets moved to another section or even reworded I can no longer reasonably search for changes. Documentation of a changing, evolving thing is hard and interestingly this is where open source gets hit the most - there are almost no incentives for someone to write good documentation.

Re: The PostgreSQL documentation and the limitations of community

#56
post #37

Earlier quoted context omitted.

We're seeing similar things at work as the postgres documentation has. We in infra-ops can give you more details about how our database clusters are designed for resilience, security, safety than you want on more levels than most people in the company know exist. We also have reasoning for all of this available. This is really good to have for customer question sets during sales. However, this doesn't tell a develope…

How many small/new services do you have, and how many developers / teams do you have? If most of your developers are working on "small-scale applications running queries", aren't you just spending a lot of developer time on repeating the same work over and over again?

20 - 30 development teams deploying 100 - 150 services in usually multiple stages. About half or a little more are rather new.

And we have different angles of approach here. For example, we from infra-ops have setup a bunch of reusable and versioned template modules. These modules encapsulate all of the gritty consul/nomad/certificate handling and someone actually using our databases mostly needs to supply the module with the necessary environment variables their application needs. This in turn has been extended by a bunch of these teams to provide preset templates for spring boot, .Net, python, libpq so most applications just need to configure "I'm springdev and need to go to this database".

And currently another team is looking at building our own spring boot seeds, and/or using tools like cookiecutter or backstage to provide skeleton templates including most necessary boilerplate. We've started to maintain a template nomad job for simple applications as well.

With these things maturing, getting a simple service stood up can be done fairly rapidly if you know what you're doing. Setup the skeleton, throw out a couple of things you don't need, be done in an hour or so.

This however doesn't solve the initial problem. It's still tricky to know how to approach this stack and it takes time to either teach people how to approach this stack, or to condense all of this into simple how-to documents and/or workflows to get systems going.

Re: The PostgreSQL documentation and the limitations of community

#57
post #30

I was recently reading the documentation for pgcrypto to implement user authentication in SQLPage: https://www.postgresql.org/docs/current/pgcrypto.html The page contains the documentation of many functions, all of which raise the following error by default when you run them: No function matches the given name and argument types. It turns out you first have to "install" them by running "create extension pgcrypto", wh…

You just click `Up` to go a level higher in the documentation and it explains everything. This is just intellectual laziness. Its like complaining your car manual doesn't say you have to open the hood of the car on the same page it explains how to change the wiper fluid.

I am not complaining. What I am saying is that the current experience for most users is the following:

I want to compute a sha1 hash in postgres. I make a google search, I click the first link. It says I should run `digest('mystring', 'sha1')`. It doesn't work.

Whereas it could be the following just by adding one line to the documentation:

I click the first link. It says I should run `CREATE EXTENSION pgcrypto` first. Then `digest('mystring', 'sha1')`. It works.

Re: The PostgreSQL documentation and the limitations of community

#58
post #33
post #2

I think the main limitation of our docs is that it mostly explains what the pieces do, not how to use them to achieve a particular goal. For example, we have pretty good documentation of all the pieces to do HA, we just don't tell people how to assemble them together. The reason is, I think, that flexibility is a pretty fundamental part of the project. We're great at providing building blocks (and documenting them),…

> I think the main limitation of our docs is that it mostly explains what the pieces do, not how to use them to achieve a particular goal I honestly prefer this type of documentation. ASP.NET Core has the complete opposite problem where it's too example based.

For many things it's simple enough to read the code, did this e.g. for the Configuration system in ASP.NET Core. Dunno, if I could do this with postgres.

Re: The PostgreSQL documentation and the limitations of community

#59
post #58
post #33

Earlier quoted context omitted.

> I think the main limitation of our docs is that it mostly explains what the pieces do, not how to use them to achieve a particular goal I honestly prefer this type of documentation. ASP.NET Core has the complete opposite problem where it's too example based.

For many things it's simple enough to read the code, did this e.g. for the Configuration system in ASP.NET Core. Dunno, if I could do this with postgres.

Yeah you'll end up reading the source code regardless if it's simple or not though haha. I've had to read through tons of the Identity and Auth code to get a handle on how to integrate with it and there are TONS of interfaces, implementations, and etc you have to cross-reference and hunt down to start building a mental model. You don't even get a diagram in the docs explaining how all the different filters and crap tie together(on top of auth having ITS OWN MIDDLEWARE PIPELINE) lol.

Combine that with maybe the info you are looking for actually is in the docs, but it's sprinkled across loads of examples so it's hard to find or build a comprehensive understanding of.

Re: The PostgreSQL documentation and the limitations of community

#60
post #12

Here's my perspective. I've been a technical writer (TW) for ~10 years. 3 at an IoT startup, 7 at Google. > The strengths of this process are also its weaknesses. A developer is, by definition, someone who spends the majority of their time doing development, which is to say writing code. Updating the documentation becomes a task that must be completed so that the code one has written can get committed so that one can…

Just curious. Where do you think that an open source project like PostgreSQL gets a budget to hire anyone? Let alone to dictate a new line of authority to the volunteers who are already maintaining it? And don't forget that there are valuable volunteers who are likely to go elsewhere if too many new rules are added that they don't want to live with.

> Where do you think that an open source project like PostgreSQL gets a budget to hire anyone?

From rough memory of an informal discussion with one of the members involved in the PG sponsorship area a while back, they had something like several hundred thousand US$ sitting around mostly unused.

The real problem is proposing something like this, and getting it okay-d. Seems like a tough (political) challenge.

Post reply on HN