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

Add parser support for <explicit table> #11382

Closed
KamilaBorowska opened this issue Feb 8, 2021 · 2 comments
Closed

Add parser support for <explicit table> #11382

KamilaBorowska opened this issue Feb 8, 2021 · 2 comments

Comments

@KamilaBorowska
Copy link

SQL translator incorrectly translates this query:

TABLE foo;

TABLE is a PostgreSQL-specific command.

Parser output:

Unexpected content after end of field input: [1:7] TABLE [*]foo;
@lukaseder lukaseder added this to the Version 3.15.0 milestone Feb 8, 2021
@lukaseder lukaseder added this to To do in 3.15 Other improvements via automation Feb 8, 2021
@lukaseder lukaseder changed the title PostgreSQL's TABLE command cannot be translated Add support for standard SQL <explicit table> as standalone query Feb 8, 2021
@lukaseder
Copy link
Member

lukaseder commented Feb 8, 2021

Thanks a lot for your suggestion.

The <explicit table> is a possible <query primary> (and thus <query expression body>) according to the SQL standard, not just according to PostgreSQL. It's not a command on its own, it's just one of many things you can put in a query. For example, you can do this:

create table t as select 1 a;
table t union all table t;

It would definitely make sense to support it, both

  • in jOOQ (will be implemented later)
  • in the parser.

I could have sworn we already had an issue for this, but I cannot seem to find it...

@lukaseder
Copy link
Member

Parser support will be added to jOOQ 3.15. API support is more tricky, and probably not very urgent (similar to VALUES constructor support, which is implemented in the parser, but not in the API).

3.15 Other improvements automation moved this from To do to Done Feb 8, 2021
@lukaseder lukaseder changed the title Add support for standard SQL <explicit table> as standalone query Add parser support for <explicit table> Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants