0

The below statement is failing by saying syntax error, I do not see the syntax error, please help:

SELECT dblink_exec(
     'dbname=billing  user=billing password=billing port=5432',
     'insert into md.radacct values('2013-01-01 00:00:00+01:30')');

table was created like this

create table md.radacct(date_time timestamp with time zone);
Trinimon
  • 13,839
  • 9
  • 44
  • 60
user2594853
  • 67
  • 1
  • 9

1 Answers1

1

You need to double up your single-quotes inside the outermost single-quotes.

select dblink_exec('...', ' insert into ... values(''2013-01-01 ... '')');
bma
  • 9,424
  • 2
  • 33
  • 22
  • 2
    Or just use dollar quoting for clarity: `select dblink_exec('...', $$insert into ... values('2013-01-01 ... ')$$);` – Tometzky Sep 17 '13 at 21:00