Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from

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
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants