Skip to content

Conversation

@iPeluwa
Copy link
Contributor

@iPeluwa iPeluwa commented Apr 10, 2025

@sunng87

Add information_schema support and enhance PostgreSQL compatibility

  • Added information_schema.schemata, tables, and columns in information_schema.rs for schema introspection using DataFusion catalogs.
  • Integrated information_schema queries in handlers.rs with schemata_df, tables_df, and columns_df.
  • Implemented mock pg_catalog.pg_namespace in handlers.rs to return catalog_name, improving pgcli compatibility.
  • Enhanced handlers.rs with SHOW search_path support, returning catalog_name as the search path.
  • Refined query qualification in do_query to exclude information_schema and pg_catalog, preventing planning errors.
  • Added debug logging in handlers.rs for incoming queries (requires log dependency).
  • Updated main.rs with basic table registration and catalog name handling, setting the stage for further enhancements.
  • Updated datafusion-postgres/Cargo.toml to include log dependency for debugging.

Note: main.rs still uses println! and lacks log integration; to be addressed in a future commit.

iPeluwa and others added 2 commits April 10, 2025 00:13
…\n- Added , , and in for schema introspection using DataFusion catalogs.\n- Integrated queries in with , , and .\n- Implemented mock in to return , improving compatibility.\n- Enhanced with support, returning as the search path.\n- Refined query qualification in to exclude and , preventing planning errors.\n- Added debug logging in for incoming queries (requires dependency).\n- Updated with basic table registration and catalog name handling, setting the stage for further enhancements.\n- Updated to include dependency for debugging.\n\nNote: still uses and lacks integration; to be addressed in a future commit.
@sunng87
Copy link
Member

sunng87 commented Apr 10, 2025

Awesome! This looks great to me. Thank you @iPeluwa for this great patch!

pgwire = { workspace = true }
datafusion = { workspace = true }
tokio = { version = "1.0", features = ["sync"] }
arrow = "54.2.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd better use arrow re-exported from datafusion. Otherwise we will have to trace arrow compatibility with datafusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, definitely agree with you.

@sunng87
Copy link
Member

sunng87 commented Apr 10, 2025

The integration test is broken. It seems we can no longer access the table from default catalog/schema.

Also it would be nice if you can include some integration tests for show statements and information_schema

@iPeluwa
Copy link
Contributor Author

iPeluwa commented Apr 10, 2025

The integration test is broken. It seems we can no longer access the table from default catalog/schema.

Also it would be nice if you can include some integration tests for show statements and information_schema

Yes ofcourse, I'd fix this and push in a bit

@sunng87
Copy link
Member

sunng87 commented Apr 10, 2025

@iPeluwa just connect you on linkedin. I'm curious about your use of this library (I guess you are using it in a project, right?). We can talk more about this.

@iPeluwa
Copy link
Contributor Author

iPeluwa commented Apr 10, 2025

@iPeluwa just connect you on linkedin. I'm curious about your use of this library (I guess you are using it in a project, right?). We can talk more about this.

Yes Definitely.

@gauravverma
Copy link

Hi @sunng87 !

Is there any plan to merge this? If there is any more capabilities required for this to be merged, maybe me and my team can contribute. Would love to hear your thoughts.

@sunng87
Copy link
Member

sunng87 commented Apr 30, 2025

We just need to get CI pass.

@iPeluwa do you have time working on this? I can pick this up and move on.

@iPeluwa
Copy link
Contributor Author

iPeluwa commented May 1, 2025

We just need to get CI pass.

@iPeluwa do you have time working on this? I can pick this up and move on.

Yeah I would work on the CI passing today

@sunng87
Copy link
Member

sunng87 commented May 6, 2025

@iPeluwa I just merged this in #71. I will do some refactoring in near future. Thank you so much for the contribution!

@sunng87 sunng87 closed this May 6, 2025
@iPeluwa
Copy link
Contributor Author

iPeluwa commented May 6, 2025

@sunng87 Currently working on this at the moment.

@sunng87
Copy link
Member

sunng87 commented May 7, 2025

@iPeluwa No problem. You can rebase to master and create a new PR. Thank you!

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.

3 participants