Search code examples
sqlgoogle-cloud-sql

Google Cloud SQL: Column Does Not Exist Error When Inserting Row


I have a SQL table on Google Cloud (which I will call table_name here). It has three columns, which I will refer to as:

  1. col_1 (with data type 'character varying')
  2. col_2 (with data type 'character varying')
  3. col_3 (with data type 'timestamp without time zone')

I am trying to enter a new row with the following query:

insert into table_name (col_1, col_2, col_3) 
values ("some_string", "some_string_2", "2021-08-01 04:28:00");

However, it is returning an error

column "some_string" does not exist

All of the data types should be correct, and I'm pretty sure the syntax of this query is correct, so what could be happening here?


Solution

  • Change double-quotes to single-quotes:

    values ('some_string', 'some_string_2', '2021-08-01 04:28:00'); 
    

    Double-quotes are not used to indicate strings in SQL. Enforcement varies with database vendors.