fanfuxiaoran opened a new issue, #1072:
URL: https://github.com/apache/cloudberry/issues/1072

   ### Apache Cloudberry version
   
   cloudberry: Latest
   jdbc--42.7.5
   
   ### What happened
   
   ```
   import java.sql.*;
   
   public class JdbcTest {
       public static void main(String[] args) {
           /* create table tab_jdbc_metadata (a numeric(38,4) not null, b int 
not null); */
   
           try (Connection connection = 
DriverManager.getConnection("jdbc:postgresql://localhost:5432/gpadmin", 
"gpadmin", "gpadmin")) {
   
               System.out.println("Connected to PostgreSQL database!");
   
               Statement statement = connection.createStatement();
               ResultSet resultSet = statement.executeQuery("SELECT * FROM 
tab_jdbc_metadata WHERE 1=0");
   
               ResultSetMetaData metaData = resultSet.getMetaData();
               int ncolumns = metaData.getColumnCount();
               for (int i = 1; i <= ncolumns; i++) {
                   System.out.println("Column name: " + 
metaData.getColumnName(i) +
                           ", Precision: " +metaData.getPrecision(i) +
                           ", Scale: " + metaData.getScale(i) +
                           ", Nullable: " + metaData.isNullable(i));
               }
           } catch (Exception e) {
               System.out.println("Connection failure.");
               e.printStackTrace();
           }
       }
   }
   ```
   expected result is :
   ```
   Column name: a, Precision: 38, Scale: 4, Nullable: 0
   Column name: b, Precision: 10, Scale: 0, Nullable: 0
   ```
   but result is in cloudberry is :
   ```
   Column name: a, Precision: 38, Scale: 4, Nullable: 2
   Column name: b, Precision: 10, Scale: 0, Nullable: 2
   
   
   ### What you think should happen instead
   
   _No response_
   
   ### How to reproduce
   
   see above
   
   ### Operating System
   
   centos7/macos
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes, I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/cloudberry/blob/main/CODE_OF_CONDUCT.md).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to