-
Notifications
You must be signed in to change notification settings - Fork 285
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
partition_data_*() not work when table PK defined with GENERATED ALWAYS #724
Comments
So I'm not able to re-produced this issue when using the Below is a similar example to what you've given (I just make it all lower case and only set the NOT NULL columns to be the relevant ones to make an easier test case). It works fine ignoring the column and allows the partitioned table to generate the ID columns automatically. If you can provide me a working example of where you're running into an error, maybe we can figure out a better solution to allow users to override identities if desired.
|
Created some new unit tests for version 5.2.4 to test the bug I fixed there. I also had those test use GENERATED IDENTITY columns, one even using it for the partition key, and all seems to be working fine as long as I set So just let me know if you're still having issues even when using the ignored columns options |
Actually, I think I just found the issue. I was testing this in PG17, but apparently the ability for partitioned tables to properly honor IDENTITY was not added until 17! https://www.postgresql.org/docs/17/release-17.html
I got this error when I tested in PG16.
So, this is actually an issue that has been fixed properly in core as of PG17. I don't think I want to allow an override option to get around this for now. The recommended fix would be to upgrade to PostgreSQL 17. |
I use pgmq with pg_parten,
got error when calling partition_data_time()
Cause Column "msg_id" is an identity column defined as GENERATED ALWAYS:
I committed a PR to handle this situation : #723
The text was updated successfully, but these errors were encountered: