Re: Can't quote_literal with COPY FROM PROGRAM

2018-12-31 Thread Andrew Gierth
> "Mark" == Mark Mikulec writes: Mark> To be honest this whole affair with COPY FROM program seems like Mark> a bug to me though. Perhaps you're misunderstanding what COPY FROM PROGRAM is actually for. Its purpose is to do exactly what COPY does, that is to say, take as input a file in eit

Re: Can't quote_literal with COPY FROM PROGRAM

2018-12-31 Thread Adrian Klaver
On 12/31/18 12:58 PM, Mark Mikulec wrote: I changed it to be just the single float value I needed to extract out of the JSON object, but originally it was a text column that held the entire JSON object. Might want to look at: https://www.postgresql.org/docs/10/datatype-json.html Might handle

Re: Can't quote_literal with COPY FROM PROGRAM

2018-12-31 Thread Mark Mikulec
I changed it to be just the single float value I needed to extract out of the JSON object, but originally it was a text column that held the entire JSON object. ᐧ On Mon, Dec 31, 2018 at 3:52 PM Adrian Klaver wrote: > On 12/31/18 9:36 AM, Mark Mikulec wrote: > > Hi, > > > > This command, which g

Re: Can't quote_literal with COPY FROM PROGRAM

2018-12-31 Thread David G. Johnston
On Monday, December 31, 2018, Mark Mikulec wrote: > > Does anyone know how to make COPY FROM PROGRAM take the output literally? > Not that I can think of. I’d avoid COPY FROM PROGRAM and move the logic to psql. Roughly: \set varname `cmd`; select :’varname’; David J.

Re: Can't quote_literal with COPY FROM PROGRAM

2018-12-31 Thread Adrian Klaver
On 12/31/18 9:36 AM, Mark Mikulec wrote: Hi, 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?etcVariablesDele

Re: Can't quote_literal with COPY FROM PROGRAM

2018-12-31 Thread Mark Mikulec
Thanks Rob, Since I'm on Windows and Windows batch sucks I just ended up doing the JSON parsing with node.js To be honest this whole affair with COPY FROM program seems like a bug to me though. On Mon, Dec 31, 2018 at 1:59 PM Rob Sargent wrote: > > > On Dec 31, 2018, at 10:36 AM, Mark Mikulec

Re: Can't quote_literal with COPY FROM PROGRAM

2018-12-31 Thread Rob Sargent
> On Dec 31, 2018, at 10:36 AM, Mark Mikulec wrote: > > Hi, > > 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/dire

Can't quote_literal with COPY FROM PROGRAM

2018-12-31 Thread Mark Mikulec
Hi, 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 int