You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/10 06:44:21 UTC

[GitHub] [shardingsphere] LeasyZhang opened a new issue, #8946: Sharding JDBC don't work with Postgres jsonb type

LeasyZhang opened a new issue, #8946:
URL: https://github.com/apache/shardingsphere/issues/8946

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   4.1.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   Data should be inserted into table successfully.
   
   ### Actual behavior
   Insert failed and throw the following error message: 
   "column "content" is of type jsonb but expression is of type character varying"
   
   ### Reason analyze (If you can)
   ShardingSphere remove the jsonb function before it's processed by PgPreparedStatement. But it works on version 3.0.0.M1.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   - Prepare raw sql "insert into news(title, author, content) values (?, ?, ?::jsonb)"
   - Do insert with PreparedStatement.executeUpdate method
   
   ### Example codes for reproduce this issue (such as a github link).
   `Session session = entityManager.unwrap(Session.class);
   
           return session.doReturningWork(connection -> {
               String sql = "insert into news(title, author, content) values (?, ?, ?::jsonb)";
               PreparedStatement ps = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
               int paramIndex = 1;
               ps.setString(paramIndex++, news.getTitle());
               ps.setString(paramIndex++, news.getAuthor());
               ps.setString(paramIndex, news.getContent());
               ps.executeUpdate();
               ResultSet result = ps.getGeneratedKeys();
               while (result.next()) {
                   news.setId(result.getLong(1));
               }
               ps.close();
               return news;
           });`
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Sharding JDBC don't work with Postgres jsonb type [shardingsphere]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8946:
URL: https://github.com/apache/shardingsphere/issues/8946#issuecomment-2026023372

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] susongyan commented on issue #8946: Sharding JDBC don't work with Postgres jsonb type

Posted by GitBox <gi...@apache.org>.
susongyan commented on issue #8946:
URL: https://github.com/apache/shardingsphere/issues/8946#issuecomment-1182815869

   is pg's    jsonb and  ::     supported in  5.x version  now? 


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] susongyan commented on issue #8946: Sharding JDBC don't work with Postgres jsonb type

Posted by "susongyan (via GitHub)" <gi...@apache.org>.
susongyan commented on issue #8946:
URL: https://github.com/apache/shardingsphere/issues/8946#issuecomment-1461516759

   need support  ::   to cast jsonb?
   
   i'd like to have a try


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zxz-github commented on issue #8946: Sharding JDBC don't work with Postgres jsonb type

Posted by GitBox <gi...@apache.org>.
zxz-github commented on issue #8946:
URL: https://github.com/apache/shardingsphere/issues/8946#issuecomment-1238853076

   `cast(? as json)` is supported


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] jpaterso commented on issue #8946: Sharding JDBC don't work with Postgres jsonb type

Posted by "jpaterso (via GitHub)" <gi...@apache.org>.
jpaterso commented on issue #8946:
URL: https://github.com/apache/shardingsphere/issues/8946#issuecomment-1428922190

   Hi, this issue still appears to exist in ShardingSphere 5.3.1 where inserting into a table with a JSONB column generates an incorrect number of parameters to the insert statement. Is there any workaround for this? Thanks


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] commented on issue #8946: Sharding JDBC don't work with Postgres jsonb type

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #8946:
URL: https://github.com/apache/shardingsphere/issues/8946#issuecomment-1272350953

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] closed issue #8946: Sharding JDBC don't work with Postgres jsonb type

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #8946: Sharding JDBC don't work with Postgres jsonb type
URL: https://github.com/apache/shardingsphere/issues/8946


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org