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

bug: PostgreSQL identity column officially recommended over serial #1980

Open
meows opened this issue Sep 6, 2024 · 0 comments
Open

bug: PostgreSQL identity column officially recommended over serial #1980

meows opened this issue Sep 6, 2024 · 0 comments

Comments

@meows
Copy link

meows commented Sep 6, 2024

Provide environment information

This isn't an issue with any specific hardware or OS environment.

Describe the bug

Recent Drizzle now supports PostgreSQL identity columns. PostgreSQL officially recommends that identity columns be preferred over serial by default.

The reasons for using identity columns over serial are well discussed and easily searched and so I won't go into detail, but in short there are mild security, type protection, and DX concerns, and identity columns are in line with sql standards whereas serial is a bit more of a historical artifact.

Reproduction repo

https://github.com/meows/create-t3-app/tree/psql-identity-column

To reproduce

This is an issue with defaults running against PostgreSQL official recommendations. The issue is in the codebase.

Additional information

No response

@meows meows changed the title bug: postgresql identity column officially recommended over serial bug: PostgreSQL identity column officially recommended over serial Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant