What is the best way to store a Twitter Snowflake string in a PostgresQL database?

1.9k Views Asked by At

https://developer.twitter.com/en/docs/twitter-ids I would like to store such Snowflake ID's in my PostgresQL database, what would be the accurate constraint and datatype for this?

At first I thought "id" VARCHAR(19) NOT NULL, but then I started wondering if there is something more accruate

1

There are 1 best solutions below

5
Stuck On

From the page you linked in the question it says that Twitter ids are 64 bit integers. So you can use bigint for the column type in postgres.