Reputation: 4101
I've created a database, a table within that database, and now I'm having trouble inserting values into the table.
I've followed what the documentation suggests for inserting a row. I'm trying to create a row of users:
Insert into users (column1, column2, column3)
values (user1, user2, user3);
And I'm getting this as an error:
university=# insert into users (column1, column2, column3)
university-# values (user1, user2, user3);
ERROR: column "column1" of relation "users" does not exist
LINE 1: insert into users (column1, column2, column3)
I do know that I'm connected to the university
database and there is in fact a users
table.
Upvotes: 1
Views: 54
Reputation: 311448
You need to use the actual names of the columns you have. Also note that the string values should be denoted by single quotes ('
):
insert into users (id, name, password)
values (1, 'user1', 'password1')
Upvotes: 1