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

Handle unconvertible CREATE TABLE statements #546

Merged
merged 9 commits into from
Dec 18, 2024

Conversation

andrew-farries
Copy link
Collaborator

@andrew-farries andrew-farries commented Dec 18, 2024

There are many options for the CREATE TABLE statement in Postgres, most of which are not currently representable by the pgroll OpCreateTable operation.

Add tests to ensure that sql2proll.Convertfalls back to raw SQL operations when these unconvertible options are present in a SQL statement.

Part of #504

Temporary tables are not representable as `pgroll` `OpCreateTable`
operations.
Unlogged tables are not representable as `pgroll` `OpCreateTable`
operations.
`CREATE TABLE IF NOT EXISTS` is not representable as a `pgroll`
operation.
`CREATE TABLE ... INHERITS` is not representable as a `pgroll`
operation.
Paritioned tables are not representable as an `OpCreateTable` operation.
Different table access methods are not representable as an
`OpCreateTable` operation.
Storage options are not representable as an `OpCreateTable` operation.
On commit options are not representable as an `OpCreateTable` operation.
Tablespace options are not representable as an `OpCreateTable`
operation.
@andrew-farries andrew-farries added the sql2pgroll Issues relating to the sql2pgroll package label Dec 18, 2024
@andrew-farries andrew-farries marked this pull request as ready for review December 18, 2024 08:27
@andrew-farries andrew-farries merged commit a849534 into main Dec 18, 2024
28 checks passed
@andrew-farries andrew-farries deleted the unconvertable-create-table-statements branch December 18, 2024 09:03
andrew-farries added a commit that referenced this pull request Dec 18, 2024
Build on #546 and ensure that more `CREATE TABLE` statements with
options and clauses that are not representable as `pgroll`
`OpCreateTable` operations fall back to raw SQL.

Part of #504
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql2pgroll Issues relating to the sql2pgroll package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants