Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more references to serial() being outdated #502

Open
dmint789 opened this issue Feb 9, 2025 · 1 comment
Open

Add more references to serial() being outdated #502

dmint789 opened this issue Feb 9, 2025 · 1 comment

Comments

@dmint789
Copy link
Contributor

dmint789 commented Feb 9, 2025

This page states:

🎉 PostgreSQL Identity Columns

[Source](https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_serial): As mentioned, the serial type in Postgres is outdated and should be deprecated. Ideally, you should not use it. Identity columns are the recommended way to specify sequences in your schema, which is why we are introducing the identity columns feature

But the rest of the docs reference serial() all over the place. I was lucky to randomly stumble upon this notice when I was searching for info on generatedAlwaysAsIdentity(), but I could have very easily missed it. For example, this page has serial() used a ton, and I think it would be best to make it clear that it's best not to use it anymore.

@dmint789
Copy link
Contributor Author

dmint789 commented Feb 9, 2025

Also, what if I just need an integer that auto-increments? Because this makes it sound like serial() shouldn't be used in general, not just for primary keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant