postgres column “X” does not exist

后端 未结 1 1849
无人共我
无人共我 2020-12-02 03:06

I have this postgrse code:

CREATE TABLE IF NOT EXISTS config_change_log
(
  id                    serial primary key,
  last_config_version   varchar(255) NO         


        
1条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 03:28

    Use single quotes for string constants

    INSERT INTO config_change_log(last_config_version, is_done, change_description )
    VALUES('5837-2016-08-24_09-12-22', false, '{ ''key'':''value''}');
    

    Also you can escape single quotes in data by doubling them

    • SQL FIDDLE DEMO

    0 讨论(0)
提交回复
热议问题