PostgreSQL

1199 readers
1 users here now

The world's most advanced open source relational database

Project
Events
Podcasts
Related Fediverse communities

founded 2 years ago
MODERATORS
1
2
3
4
5
6
7
8
9
 
 

Example usage:

-- Register with default settings (41 timestamp bits, 10 type bits, 12 counter bits)
CALL snowflake.register('user_id');

-- Generate a user ID
SELECT snowflake.generate_user_id(now(), 1, 1);

-- Register with custom bit allocation
CALL snowflake.register('order_id', 42, 8, 13);

-- Generate an order ID with specific type and counter
SELECT snowflake.generate_order_id('2023-12-01 10:30:00 UTC', 5, 1000);
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
 

I came across this blog and thought it was a nice demonstration of the backup, recovery and migration options in CNPG, and the cloud-native way of working in a tough situation: treat your servers as cattle, not as pets. Spin up a new container and kill the problematic old one.

view more: next ›