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 2021/03/22 20:24:07 UTC
[GitHub] [shardingsphere] jiang-wei opened a new issue #9774: no viable alternative error for Postgresql sequence
jiang-wei opened a new issue #9774:
URL: https://github.com/apache/shardingsphere/issues/9774
## 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?
5.0.0-alpha
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
sharidingsphere-jdbc
### Expected behavior
create a sequence in PG
### Actual behavior
Hibernate: create sequence coin_account_id_seq start 1 increment 1
line 1:7 no viable alternative at input 'createsequence'
### Reason analyze (If you can)
I guess ANTLR failed to parse the SQL
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
Create an entity class with
@GeneratedValue
and set
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create
I guess you can reproduce it by running the sequence creation against shardingshpere-proxy
### Example codes for reproduce this issue (such as a github link).
```
spring:
jpa:
generate-ddl: true
show-sql: true
open-in-view: false
hibernate:
ddl-auto: create-only
```
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #9774: no viable alternative error for Postgresql sequence
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #9774:
URL: https://github.com/apache/shardingsphere/issues/9774#issuecomment-804804205
@jiang-wei Thank you very much for your feedback. The create sequence statement is not currently supported, and we will support it in subsequent versions as soon as possible. 😀
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] jiang-wei commented on issue #9774: no viable alternative error for Postgresql sequence
Posted by GitBox <gi...@apache.org>.
jiang-wei commented on issue #9774:
URL: https://github.com/apache/shardingsphere/issues/9774#issuecomment-804455164
More details:
```
@Test
public void contextLoads() throws SQLException {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
stmt.execute("select 1");
stmt.execute("create sequence foo");
}
```
logs
```
2021-03-22 19:09:21.052 INFO 53223 --- [ main] ShardingSphere-SQL : Logic SQL: select 1
2021-03-22 19:09:21.053 INFO 53223 --- [ main] ShardingSphere-SQL : SQLStatement: PostgreSQLSelectStatement(limit=Optional.empty, lock=Optional.empty)
2021-03-22 19:09:21.053 INFO 53223 --- [ main] ShardingSphere-SQL : Actual SQL: ds0 ::: select 1
line 1:7 no viable alternative at input 'createsequence'
```
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tristaZero commented on issue #9774: no viable alternative error for Postgresql sequence
Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #9774:
URL: https://github.com/apache/shardingsphere/issues/9774#issuecomment-808871646
Hi @jiang-wei ,
@zhujunxxxxx raised a great PR for your issue and will be merged later. But Just a remainder, `create sequence` is for traditional single PostgreSQL, which may not work well in sharding databases.
If you want to have the global ID in the sharding scenario, I recommend [Distributed Sequence](https://shardingsphere.apache.org/document/current/cn/features/sharding/concept/key-generator/).
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tristaZero closed issue #9774: no viable alternative error for Postgresql sequence
Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #9774:
URL: https://github.com/apache/shardingsphere/issues/9774
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #9774: no viable alternative error for Postgresql sequence
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #9774:
URL: https://github.com/apache/shardingsphere/issues/9774#issuecomment-808986092
@zhujunxxxxx Great, I will assign this issue to you. 👍
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] zhujunxxxxx commented on issue #9774: no viable alternative error for Postgresql sequence
Posted by GitBox <gi...@apache.org>.
zhujunxxxxx commented on issue #9774:
URL: https://github.com/apache/shardingsphere/issues/9774#issuecomment-809039678
@strongduanmu I have open a PR for this issue. you can assign this issue to me 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu edited a comment on issue #9774: no viable alternative error for Postgresql sequence
Posted by GitBox <gi...@apache.org>.
strongduanmu edited a comment on issue #9774:
URL: https://github.com/apache/shardingsphere/issues/9774#issuecomment-808986092
@zhujunxxxxx Great, you can leave a comment on this issue, and I will assign this issue to you. 👍
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org