Skip to content

postgres: Use tzdata from PG sources - #2501

Merged
mmlb merged 5 commits into
developfrom
mannymendez/mpg-1289-update-postgres-tzdata-for-albertas-permanent-utc-6-change
Oct 2, 2026
Merged

mmlb merged 5 commits into
developfrom
mannymendez/mpg-1289-update-postgres-tzdata-for-albertas-permanent-utc-6-change

Conversation

@mmlb

@mmlb mmlb commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

What kind of change does this PR introduce?

Feature

What is the current behavior?

PG is built against nixpkgs' tzdata, which is stale and will remain so for a bit still.

What is the new behavior?

PG is built to use its own embedded tzdata which is up to date.

@mmlb
mmlb requested review from a team as code owners September 30, 2026 18:41
@brainrake

Copy link
Copy Markdown
Collaborator

Buys us until next tz change to get rolling updates going.

@blacksmith-sh

This comment has been minimized.

@mmlb

mmlb commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Result from quick build/test:

[16:38:51]-[~/p/g/s/p/src]-[manny@zennix]
                                                                                                               ../start-server.fish
                                                                                                                                    The files belonging to this database system will be owned by user "manny".
This user must also own the server process.

The database cluster will be initialized with this locale configuration:
  locale provider:   builtin
  default collation: C.UTF-8
  LC_COLLATE:  C.UTF-8
  LC_CTYPE:    C.UTF-8
  LC_MESSAGES: C.UTF-8
  LC_MONETARY: C.UTF-8
  LC_NUMERIC:  C.UTF-8
  LC_TIME:     C.UTF-8
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are enabled.

fixing permissions on existing directory /home/manny/projects/github.com/supabase/postgres/src/.working/pgtest/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 100
selecting default "shared_buffers" ... 128MB
selecting default time zone ... America/New_York
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /home/manny/projects/github.com/supabase/postgres/src/result/bin/pg_ctl -D /home/manny/projects/github.com/supabase/postgres/src/.working/pgtest/data -l logfile start

 '--prefix=/nix/store/2vmz8a0qlqzbz1nhfa1zmbjfa1lfvlzh-postgresql-17.11' '--with-openssl' '--with-libxml' '--with-icu' '--sysconfdir=/etc' '--libdir=$(lib)/lib' '--enable-debug' '' '--with-ossp-uuid' '--with-lz4' '--with-zstd' '--with-gssapi' '--with-pam' 'build_alias=' 'host_alias=' 'target_alias=' 'CC=gcc' 'CXX=g++' 'PKG_CONFIG=pkg-config' 'PKG_CONFIG_PATH=/nix/store/5qzr2w5n5gcgh8gp3mi8sdfh6ryypfqj-libxcrypt-4.5.2/lib/pkgconfig:/nix/store/bc1x5zsl9wyqj35yjd9c3f2gf1b4r7qv-libxslt-1.1.45-dev/lib/pkgconfig:/nix/store/srnvjrr38j7xmpcmjpndd6mw31lsfjrl-zlib-1.3.1-dev/lib/pkgconfig:/nix/store/inys8r1mg4mwlxnrwa3wqga3xmp1rmvi-readline-8.3p1-dev/lib/pkgconfig:/nix/store/lrx5q7fas4bldb5m342liwyy693sas0g-ncurses-6.5-dev/lib/pkgconfig:/nix/store/2ivy0r8ab3bnps5957vfrxcjfcgad661-openssl-3.6.0-dev/lib/pkgconfig:/nix/store/5nl2zr46dic7mxcw6cvbq85wa8c2gngh-libxml2-2.15.1-dev/lib/pkgconfig:/nix/store/h5hfqhzcqszmsacj26hh3fngwcal04zs-icu4c-75.1-dev/lib/pkgconfig:/nix/store/sl10j863s32x7dv5vw6wfx1nh22f3xh2-lz4-1.10.0-dev/lib/pkgconfig:/nix/store/di94mxmhhk390zzzv2gvavfwkgww7q6h-zstd-1.5.7-dev/lib/pkgconfig:/nix/store/20dygnb42nwy7mbilwgql2lzz8h69pqz-krb5-1.22.1-dev/lib/pkgconfig:/nix/store/adcxk93kpci5li5plbfka0sciqwq9jdf-linux-pam-1.7.1/lib/pkgconfig:/nix/store/sadhrdhfxqix4skq8phrvhw1qhhyipq3-libossp-uuid-1.6.2/lib/pkgconfig'
waiting for server to start.... done
server started
                                    version
-------------------------------------------------------------------------------
 PostgreSQL 17.11 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 15.2.0, 64-bit
(1 row)

psql (17.11)
Type "help" for help.

postgres=# select '2026-12-15 18:00+00'::timestamptz at time zone 'America/Edmonton';
      timezone
---------------------
 2026-12-15 12:00:00
(1 row)

postgres=#
\q
waiting for server to shut down.... done
server stopped

@mmlb
mmlb force-pushed the mannymendez/mpg-1289-update-postgres-tzdata-for-albertas-permanent-utc-6-change branch from fa273ee to 29196e6 Compare October 1, 2026 13:27
@blacksmith-sh

blacksmith-sh Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Blacksmith runners detected OOM events on the following jobs:

Job Details
Package Dependency Analysis View Job

@mmlb
mmlb force-pushed the mannymendez/mpg-1289-update-postgres-tzdata-for-albertas-permanent-utc-6-change branch from 29196e6 to 14c7bc6 Compare October 1, 2026 17:15
@mmlb

mmlb commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

GHA wasn't happy with the nix-eval step and I couldn't quite debug it from logs available. I had some not-quite-working code to split the run nix-eval-jobs, process nix-eval-jobs output in github-matrix into 2 parts that I cleaned up/finished and now things are ok. Will keep it in.

mmlb added 5 commits October 1, 2026 13:56
Better to save/load the expensive step (nix-eval-jobs) instead of some
intermediate step after further processing. Can't save via stdout
because the GHA notice/warning/... functions have send to stdout
themselves (because GHA doesn't read from stderr) which makes for
invalid json.
The eval/gen-matrix step is not currently working without much info to
go on. I suspect that since I'm doing a change to the base postgres
derivation and causing a mass rebuild it generates a huge json that
likely exceeds GHA's max payload for ::notice:: messages. All I can see
is that the notice message printed to stdout is truncated with plenty of
more chars left to print.

So lets rework the script so the important part comes first, setting the
outputs then we can inform any watchers/readers of what needs building.
I switched to just dumping to stdout because that large of a notice
isn't really necessary in the GH UI, log file is fine.
This all happens on an ephemeral runner, no need to stop nix daemon or
much of anything else being done. There's no pipes so no need for
pipefail, no bash vars so no need for -u, no subshells so no need for -E
and .#blah is not a shell comment so no need to escape.
Not sure whats going on in CI, logs are being truncated and the matrix
isn't being populated. I thought the previous commit setting outputs
first would be helpful but that doesn't seem to be the case. I suspect
nix-eval-jobs isn't allowed to finish or something so lets break the
execution up.
Lets let PG use its own copy of tzdata instead of nixpkgs since we're
likely to be faster at updating PG over nixpkgs going forward.

Morocco is already on permanent UTC+00 and Alberta will be permanent
UTC-06 in November, PG's tzdata was updated[1] but our nixpkgs' tzdata
has not and will not in a timely fashion.

[1]: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=669438aed
@mmlb
mmlb force-pushed the mannymendez/mpg-1289-update-postgres-tzdata-for-albertas-permanent-utc-6-change branch from 14c7bc6 to 8d07184 Compare October 1, 2026 17:56
@mmlb
mmlb added this pull request to the merge queue Oct 2, 2026
Merged via the queue into develop with commit d04eb94 Oct 2, 2026
1112 of 1124 checks passed
@mmlb
mmlb deleted the mannymendez/mpg-1289-update-postgres-tzdata-for-albertas-permanent-utc-6-change branch October 2, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants