Re: Can't quote_literal with COPY FROM PROGRAM
От | Rob Sargent |
---|---|
Тема | Re: Can't quote_literal with COPY FROM PROGRAM |
Дата | |
Msg-id | D993AA73-7662-4EF9-ADF5-109585A5815A@gmail.com обсуждение исходный текст |
Ответ на | Can't quote_literal with COPY FROM PROGRAM (Mark Mikulec <mark@mikutech.com>) |
Ответы |
Re: Can't quote_literal with COPY FROM PROGRAM
|
Список | pgsql-general |
Can you pipe the curl output through sed s,\\,\\\\,gHi,This command, which generates a JSON object as output, has some escaped data with backslashes: (see line 91 here: https://pastebin.com/D4it8ybS)C:\\Portable\\curl\\curl.exe -k "https://maps.googleapis.com/maps/api/directions/json?etcVariablesDeleted"'I use the COPY command to pull it into a temp table like so:COPY temp_maps_api from program 'C:\\Portable\\curl\\curl.exe -k "https://maps.googleapis.com/maps/api/directions/json?etcVariablesDeleted"';However copy eats those backslashes. I need to use quote_literal() but that's a syntax error. For some reason the COPY command doesn't allow for ESCAPE to work with programs, only CSV.I tried using WITH BINARY but I get the error message: "COPY file signature not recognized"Does anyone know how to make COPY FROM PROGRAM take the output literally?Thanks,Markᐧ
В списке pgsql-general по дате отправления: