0

I keep getting errors trying to insert data into my table. I have tried:

insert into saferdb_dot_contacts (fax, email, "dot_num_id") 
values( 'nan', 'nan', 4);

ERROR: column "dot_num_id" of relation "saferdb_dot_contacts" >does not exist

I tried:

insert into saferdb_dot_contacts (fax, email, dot_num_id) 
values( 'nan', 'nan', 4);

ERROR: column "dot_num_id" of relation "saferdb_dot_contacts" >does not exist

I tried to access the field via

SELECT dot_num_id FROM saferdb_dot_contacts;

but got :

ERROR: column "dot_num_id" does not exist LINE 1: SELECT dot_num_id FROM >saferdb_dot_contacts;

I tried:

SELECT 'dot_num_id' FROM saferdb_dot_contacts;

Which gave me a strange output of a column labled ?column?

enter image description here

if it helps dot_num_id is has a foreign key relationship to another table.

EDIT: I also tried:

SELECT "dot_num_id" FROM saferdb_dot_contacts;

ERROR: column "dot_num_id" does not exist LINE 2: SELECT "dot_num_id" FROM saferdb_dot_contacts; ^ SQL state: 42703

enter image description hereCharacter: 58

8
  • 1
    Could it be that - as postgres claims - dot_num_id doesn't exist on saferdb_dot_contacts? What is the schema of saferdb_dot_contacts? Commented Nov 11, 2018 at 1:42
  • 1
    BTW, in the last query you are trying to select the constant string 'dot_num_id' from the table, hence the output. Commented Nov 11, 2018 at 1:44
  • 1
    Also, what happens when you try: insert into saferdb_dot_contacts (fax, email, 'dot_num_id') , with single quotes instead of double? Commented Nov 11, 2018 at 2:40
  • 1
    oooh I see, it is DOT_Num_id. Please try: Select "DOT_Num_id" from saferdb_dot_contacts and let me know. Commented Nov 11, 2018 at 3:03
  • 1
    No worries, glad to help :) Commented Nov 11, 2018 at 3:11

1 Answer 1

3

You need to watch out for case sensivity and use double quotes. Try:

insert into saferdb_dot_contacts (fax, email, "DOT_Num_id") 
values( 'nan', 'nan', 4);
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.