I'm running PostgreSQL version 9.5.1 on my Mac - I'm trying to make a simple insert statement, but it's spitting an error that I don't quite understand... for some reason, it seems to think that one of the values that I'm inserting is actually one of the column names. Here's the scenario...
\d+ group_members
Column | Type |
------------+-----------------------------+
id | integer |
group_id | integer |
user_id | integer |
role | character varying(255) |
inserted_at | timestamp without time zone |
updated_at | timestamp without time zone |
Indexes:
"group_members_pkey" PRIMARY KEY, btree (id)
"group_members_group_id_index" btree (group_id)
"group_members_user_id_index" btree (user_id)
When I try to run
insert into group_members (group_id, user_id, role, inserted_at, updated_at)
values (1, 2, ’member’, current_timestamp, current_timestamp);
I get the error:
ERROR: column "’member’" does not exist
LINE 1: ...user_id,role,inserted_at,updated_at) values (1,2,’member’,c...
^
Well yes, I agree, the column 'member' does not exist... but I'm not sure I understand why PostgreSQL thinks that this is my intention. I have made numerous inserts into other tables and had now such problem but I can't seem to insert into this table. Can anyone see where I've gone wrong?