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

feat: add "ANCESTOR TABLE" table type(#3194) #3215

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

peixingzhe
Copy link

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Does ./gradlew styleCheck pass ?
  3. Have you added your new test classes to an existing test suite in alphabetical order?

@davecramer
Copy link
Member

This will require documentation and tests

@peixingzhe
Copy link
Author

This will require documentation and tests

Can you give some examples of documentation and test code?

@davecramer
Copy link
Member

This will require documentation and tests

Can you give some examples of documentation and test code?

https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/test/java/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java#L1194

We should test for ANCESTOR TABLE and PARTITIONED TABLES

As for docs since both of these are not standard we should add this to https://github.com/pgjdbc/pgjdbc/blob/master/docs/content/documentation/use.md somewhere

@peixingzhe
Copy link
Author

This will require documentation and tests

Can you give some examples of documentation and test code?

https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/test/java/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java#L1194

We should test for ANCESTOR TABLE and PARTITIONED TABLES

As for docs since both of these are not standard we should add this to https://github.com/pgjdbc/pgjdbc/blob/master/docs/content/documentation/use.md somewhere

Ok, thank you , i will add these.

@davecramer
Copy link
Member

I don't think we test for PARTITIONED TABLE either. Can you add that test as well?

@peixingzhe
Copy link
Author

@davecramer Hi, I add some test code reference to the #1708 ,but I didn't find any document about "PARTITIONED TABLE", how
do I add it?

@peixingzhe
Copy link
Author

peixingzhe commented Apr 18, 2024

I don't think we test for PARTITIONED TABLE either. Can you add that test as well?

Looks like we already have the test code for PARTITIONED TABLE

void partitionedTables(BinaryMode binaryMode) throws SQLException {

@peixingzhe
Copy link
Author

@davecramer hi,do I need to do anything else?

if (TestUtil.haveMinimumServerVersion(con, ServerVersion.v11)) {
Statement stmt = null;
try {
stmt = con.createStatement();
Copy link
Member

Choose a reason for hiding this comment

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

Us try with resources, please

Copy link
Author

Choose a reason for hiding this comment

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

Because I need to delete the test table in the finally code block, is it necessary to use try-with-resource here?

@davecramer
Copy link
Member

@davecramer hi,do I need to do anything else?

Yes, please add docs here https://github.com/pgjdbc/pgjdbc/blob/master/docs/content/documentation/use.md

@peixingzhe
Copy link
Author

I will and the following document at the bottom of this document. What do you think?

Retrieve Database Metadata

In the standard JDBC API, we can get the database metadata from the connection, and through this metadata object, we can get the database table type, table collection, and so on.

As an extension, PostgreSQL® JDBC Driver provides PARTITIONED TABLE, ANCESTOR TABLE and other table type extensions. Using these two extensions, we can only obtain the table set of the corresponding type from the database.

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.

None yet

2 participants