postgres dblink escape single quote

前端 未结 2 555
闹比i
闹比i 2020-12-20 13:53

Related Link:

  • String literals and escape characters in postgresql

Here is my error:

ERROR:  type \"e\" does not exist
         


        
2条回答
  •  暖寄归人
    2020-12-20 14:25

    Try this query:

    SELECT *
     FROM dblink('host=theHostName port=1234 dbname=theDBName user=theUser password=thePassword',
     'SELECT field_1, 
     CASE WHEN field_2 IS NOT NULL 
     THEN $$inactive$$ ELSE $$active$$ 
     END AS field_status 
     FROM the_table') 
     AS linkresults(field_1 varchar(20),field_2 varchar(8))
    

提交回复
热议问题