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

Support PostgreSQL 10+ partitioning #26

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

skissane
Copy link
Contributor

@skissane skissane commented Jun 2, 2022

Include partitioned tables, but ignore their partitions. Without this change, it would fail on database schemas involving partitioning.

Note the use of the row_to_json() function is to permit backward compatibility with PostgreSQL 9 and 10. The relispartition column does not exist until PostgreSQL 10 and the conparentid column does not exist until PostgreSQL 11. Directly referencing these columns, while simpler, would cause the query to fail in those earlier versions. While another approach would be to generate different SQL for different PostgreSQL versions, that seems like it would be more work. Note however that this use of JSON means it will no longer work on PostgreSQL 9.2 and earlier, since the necessary JSON support was introduced in 9.3. That's hopefully not a big issue, given 9.2 reached its end-of-support date almost 5 years ago.

Include partitioned tables, but ignore their partitions. Without this
change, it would fail on database schemas involving partitioning.

Note the use of the row_to_json() function is to permit backward
compatibility with PostgreSQL 9 and 10. The relispartition column
does not exist until PostgreSQL 10 and the conparentid column does
not exist until PostgreSQL 11. Directly referencing these columns,
while simpler, would cause the query to fail in those earlier
versions. While another approach would be to generate different SQL for
different PostgreSQL versions, that seems like it would be more work.
Note however that this use of JSON means it will no longer work on
PostgreSQL 9.2 and earlier, since the necessary JSON support was
introduced in 9.3
@achiku
Copy link
Owner

achiku commented Jan 23, 2024

Thanks a lot!

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

Successfully merging this pull request may close these issues.

2 participants