M
M
Mikhail Ivanov2017-07-02 15:22:37
PostgreSQL
Mikhail Ivanov, 2017-07-02 15:22:37

PostgreSQL bigint and int as PK?

A lot of records will be stored in the database of the project I am developing.
In some tables there will be more than 2147483647 records, and therefore for these tables the PK type int is not suitable. There are not so many tables in which the number of records will exceed the maximum value of int.
Question: is it normal to use int in some tables and bigint as PK in some tables? Will it be possible in the future to change the type if it turns out that int is not enough for some table?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Mokrinsky, 2017-07-02
@nazarpc

Yes, good. And yes, you can change it after, but keep in mind that for large tables it can take a long time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question