0

I've created a new table but I'm struggling to insert any data

The table looks like the below where the id column is an auto incrementing integer and name is a string column

select * from transaction_categories;
category_id | name 
------------+------
(0 rows)

and this is the query I'm trying to run:

INSERT INTO transaction_categories (category_id, name)
VALUES (1,’General’);

but I'm getting this error:

ERROR:  column "’general’" does not exist
LINE 2: VALUES (1,’General’);

Everything I've found so far on SO has pointed to using single quotes instead of double quotes, which I am. I have literally taken the basic insert statement from postgres documentation and copied and pasted the relevant table / column names, but I'm still running into this issue

What am I missing?!

3
  • Try simple quotes 'General' Commented Feb 7, 2018 at 22:29
  • Thanks, I didn't know there was a difference! or why the same key I've always used now types "non-simple" single quotes? Commented Feb 7, 2018 at 22:34
  • It's going to be because you have either weird keyboard or your operating system language is non standard Commented Feb 7, 2018 at 22:35

1 Answer 1

1

Please try this, traditional quotes and we do not need here to tell column names for insert query:

INSERT INTO transaction_categories 
VALUES (1,'General');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.