shardingsphere
shardingsphere copied to clipboard
Postgresql : not support function row_number()
Bug Report
For English only, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed GitHub issues.
- Read documentation: ShardingSphere Doc.
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?
5.4.1
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy apache-shardingsphere-5.4.1-shardingsphere-proxy-bin
Expected behavior
create table sql
CREATE TABLE memberinfo ( id INT PRIMARY KEY, name VARCHAR(50), idcard VARCHAR(50), house_id VARCHAR(50),relation INT;
insert into sample data.
insert into memberinfo (id, name, idcard, house_id, relation) values (1, '张三', '421106199901011234', "123456houseid", 1) ,(2, '李四', '42110619900101789', "123456houseid", 1)
query sql
select house_id, relation, row_number() over (partition by house_id ORDER BY relation asc ) AS relation_index from memberinfo where house_id = '123456houseid'
sharding-config
###expected result:
Actual behavior
relation_xuhao coloum 1,1 is error.
expected result relation_index is 1,2.
Reason analyze (If you can)
in postgrmaybe not support.
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
Example codes for reproduce this issue (such as a github link).
in database: Postgresql
query sql 'select house_id, relation, row_number() over (partition by house_id ORDER BY relation asc ) AS relation_index from memberinfo where house_id = '123456houseid''
in Postgresql, function row_number() is not work
Hi @agoodcoolman , Thanks for your feedback, are you intrested in improving it?
I'll try it.
@RaigorJiang sorry, I don't have time to modify this issue.
@agoodcoolman OK, I'll mark this issue as volunteer wanted, thank you~
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
mysql not support ROW_NUMBER() OVER (ORDER BY id)
too ,in shardingshpere5.3.2 @RaigorJiang
dose it will support in next version? or plan to support it
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Hey @agoodcoolman I've been trying to reproduce the issue, using ShardingSphereProxy 5.4.1 and Postgres 16.2 with Zookeeper 3.9.2 as Cluster Type . Have used the sharding-config you have posted (naming it as sharding_db).
But row_number() seems to be working fine:
can you share postgres version, mode configuration and probably a sample dataset to look into this further.
also, @RaigorJiang , i'll like to try resolving this issue. Thanks
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.