-2

i'm using for the first times Postgres and i'm experiencing problems adding a new row by SQL code.

Here is my table structure:

enter image description here

And here is the code that i'm executing:

INSERT INTO recensione (testo, voto, utente, merchant) VALUES
('this is a text', 2, 'username', 1234567);

I get this error:

ERROR:  syntax error at or near "INTO" LINE 1: SELECT COUNT(*) AS     total FROM (INSERT INTO recensione (testo...

I'm sure it is easy to solve, but i'm getting crazy about it. Thank you.

5
  • Based on the error you seem to have the INSERT INTO as a sub-query of something else. Commented May 25, 2015 at 15:03
  • 1
    Show all code involved please. You don't have SELECT COUNT(*)... in the code shown... Commented May 25, 2015 at 15:03
  • That's not the script you're executing. Commented May 25, 2015 at 15:04
  • Please do not downvote me, the query i posted above is that i'm executing! Commented May 25, 2015 at 15:05
  • Do not use PhpPgAdmin. In any reasonable SQL editor you wont get such error. Commented May 25, 2015 at 16:19

1 Answer 1

2

it happens only when checkbox "Paginate results" on query page is set to on. Try unchecking that.

try looking at this example. Postgres sql insert query syntax error from phpPgAdmin

Sign up to request clarification or add additional context in comments.

1 Comment

Works, thank you! Someone downvote my question because was not so expert like you!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.