Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BIGSERIAL vs SERIAL in PostgreSQL

I'm new on PostgreSQL for auto-increment we have to use BIGSERIAL or SERIAL, so can anyone please explain which one we have to use when creating a table. Which one be the best please explain scenario wise.

like image 234
Dilip Kr Singh Avatar asked Nov 26 '25 00:11

Dilip Kr Singh


1 Answers

From the docs:

serial      4 bytes     autoincrementing integer        1 to 2147483647
bigserial   8 bytes     large autoincrementing integer  1 to 9223372036854775807
like image 149
S-Man Avatar answered Nov 28 '25 16:11

S-Man



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!