pgflake icon indicating copy to clipboard operation
pgflake copied to clipboard

Generating a ID overwrites instance ID GUC & issues with the time values

Open pdeaudney opened this issue 1 year ago • 0 comments

Have manually set the GUCs in a config file:

cat /etc/postgresql/14/main/conf.d/pgflake.conf
pgflake.start_epoch = 1719611959
pgflake.instance_id = 100

Reloaded PostgreSQL. Installed the extension and generate an ID and the GUC values are being overwritten:

paul=# show pgflake.instance_id;
 pgflake.instance_id
---------------------
 100
(1 row)
paul=# show pgflake.start_epoch;
 pgflake.start_epoch
---------------------
 1719611959
(1 row)
paul=# select pgflake_generate();
  pgflake_generate
---------------------
 7205366207539986432
(1 row)
paul=# show pgflake.start_epoch;
 pgflake.start_epoch
---------------------
 start_epoch
(1 row)
paul=# show pgflake.instance_id;
 pgflake.instance_id
---------------------
 22026
(1 row)

And additionally there is some weird time movement going on. The instance.id was also reset??

paul=# select pgflake_generate();
  pgflake_generate
---------------------
 7205367237581357056
(1 row)

paul=# show pgflake.instance_id;
 pgflake.instance_id
---------------------
 0
(1 row)

paul=# select pgflake_extract_sequence('7205367237581357056');
 pgflake_extract_sequence
--------------------------
                        0
(1 row)

paul=# select pgflake_extract_time('7205367237581357056');
 pgflake_extract_time
----------------------
        1717893418689
(1 row)

paul=# select to_timestamp(pgflake_extract_time('7205367237581357056'));
          to_timestamp
--------------------------------
 56407-11-17 03:18:08.999936+11
(1 row)

pdeaudney avatar Jun 28 '24 22:06 pdeaudney