Skip to content

pg_journal: init at 0.2.0 & fixed some PostgreSQL plugins related issues#44379

Closed
basvandijk wants to merge 3 commits intoNixOS:masterfrom
LumiGuide:pg_journal
Closed

pg_journal: init at 0.2.0 & fixed some PostgreSQL plugins related issues#44379
basvandijk wants to merge 3 commits intoNixOS:masterfrom
LumiGuide:pg_journal

Conversation

@basvandijk
Copy link
Member

Motivation for this change

Triggered by Discourse: Q: Services logging to stderr preferred over logging to syslog? I packaged the pg_journal plugin that logs PostgreSQL messages to the systemd journal.

Things done
  • packaged pg_journal at version 0.2.0 (including some patches)

  • fixed some PostgreSQL plugins related issues.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

CC @ocharles as maintainer of the postgresql package. Ollie, what do you think?

PostgreSQL plugins need to link with the configured version of the
postgresql package otherwise the server will crash with an error like:

  FATAL:  incompatible library
    "/nix/store/...-postgresql-and-plugins-10.4/lib/pg_journal.so":
    version mismatch
  DETAIL:  Server is version 10, library is version 9.6.

To fix this we'll override every plugin by setting postgresql to the
configured package. Note that this does require every plugin to have
postgresql in its arguments but every plugin already needs this.
…gins derivation

This is needed because some PostgreSQL plugins don't have a bin
directory. If only these plugins are listed in cfg.extraPlugins
buildEnv will turn $out/bin into a symbolic link to ${pg}/bin. Lateron
we try to rm $out/bin/{pg_config,postgres,pg_ctl} which will then fail
because $out/bin will be read-only.
For logging PostgreSQL messages to the systemd journal
@GrahamcOfBorg GrahamcOfBorg added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Aug 2, 2018
@basvandijk
Copy link
Member Author

@GrahamcOfBorg test postgresql

@basvandijk
Copy link
Member Author

@thoughtpolice this will probably conflict with your #38698.

@basvandijk
Copy link
Member Author

@thoughtpolice it's probably best to rebase my work on your #38698 right?

@thoughtpolice
Copy link
Member

@basvandijk Yes, I think rebasing it would be appropriate, thank you! I can actually integrate your changes into my branch directly...

In the mean time maybe I should just add my own name to the maintainers field so I'm CC'd in the future... and get done pushing that work in. :)

@thoughtpolice
Copy link
Member

@basvandijk These changes are now incorporated in my branch in #38698, but I didn't include the PostgreSQL tests you added for pg_journal (I still have some WIP changes to update more things before merging.)

@basvandijk
Copy link
Member Author

basvandijk commented Aug 4, 2018

@thoughtpolice thank you!

Closing in favour of #38698.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants