I created a table and I'm trying to modify it but I get this error

Question:

I started tody with Python SQL Database conexion (or in general python databse collection i guess)
and I was following a tutorial on youtube about how to create and modify the table, but at the moment when I tried to modify it this happens.

I am not sure because I was reading here some solutions and sometimes there is a problem with the reference (I guess table name) or if you created the table out of the public or something like that.

I attach a picture to have a better reference, thank you if you help me

enter image description here

I tried searching on PostgreSQL documentation, rewatching the video and searching here on stackoverflow but there’s some sort of thing that I still don’t know about working with PostgreSQL so I didn’t triet

Asked By: Rodrigo Bonilla

||

Answers:

You have 2 problems with your statement. 1: Your table name contains upper case letters. This indicates it was created with the name in double quotes("…"). Double quoting makes the name case sensitive and requires that you always use them when referencing the table. 2: You also incorrectly used double quotes in the values clause. In this case double quoting indicates the name of an object (here a column). Literal values take single quotes. Try

insert into "PersonaPrueba"(Nonbre,Apellido) 
  values ('Susana','Maricia');

The double quote requirement will also apply to column names if they were also created with double quotes.

Answered By: Belayer
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.