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

INSERT without fields or values should result in a different SQL syntax #4

Open
akarelas opened this issue Oct 28, 2021 · 2 comments
Open

Comments

@akarelas
Copy link

  • SQL::Abstract::Pg version: 1.0
  • Perl version: v5.34
  • Operating system: Ubuntu Linux 20.04

Steps to reproduce the behavior

When I do:

say $abstract->insert('a_table', {});

...I get:

INSERT INTO a_table VALUES ()

...which is invalid syntax in PostgreSQL v14 (results in error ERROR: syntax error at or near ")")

Expected behavior

The following SQL string should be output:

INSERT INTO a_table DEFAULT VALUES
@kraih
Copy link
Member

kraih commented Oct 28, 2021

Interesting idea.

@akarelas
Copy link
Author

According to https://www.postgresql.org/docs/7.1/sql-insert.html, DEFAULT VALUES is supported all the way back to PostgreSQL v7.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants