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

Re: getting pg_basebackup to use remote destination

2018-12-31 Thread Chuck Martin
On Mon, Dec 31, 2018 at 12:05 PM Jeff Janes wrote: > On Sun, Dec 30, 2018 at 6:17 PM Chuck Martin > wrote: > >> Maybe I need to rethink ths and take Jeff's advice. I executed this: >> >> pg_basebackup -h [main server's URL] -U postgres -P -v -X s -D >> /mnt/dbraid/data >> >> 8 hours ago, and it

Re: getting pg_basebackup to use remote destination

2018-12-31 Thread Jeff Janes
On Sun, Dec 30, 2018 at 6:17 PM Chuck Martin wrote: > Maybe I need to rethink ths and take Jeff's advice. I executed this: > > pg_basebackup -h [main server's URL] -U postgres -P -v -X s -D > /mnt/dbraid/data > > 8 hours ago, and it is now still at 1%. Should it be that slow? The > database in qu

Thoughts on row-level security for webapps?

2018-12-31 Thread Siegfried Bilstein
Hi all, I'm evaluating using a tool called Postgraphile that generates a GraphSQL server from a postgres setup. The recommended way of handling security is to implement RLS within postgres and simply have the webserver take a cookie or similar and define which user is querying data. I've normally

Relocatable Binaries (RPMs) : custom installation path for PostgreSQL

2018-12-31 Thread chiru r
Hi All, I wanted to install the PostgreSQL-11 Software with Custom installation/binary paths. Currently I am using EDB one click installer software with option file like below to achieve, However EDB stopped and no longer provides one click installer for Linux. *Example:* PostgreSQL install sof

Re: libpq bug?

2018-12-31 Thread Igor Korot
Hi, So, does anybody have an idea? I do have following code at the beginning of the cpp file: #ifdef WIN32 #include #pragma execution_character_set("utf-8") #endif but even running it on OSX, I am getting this same error. Thank you. On Fri, Dec 28, 2018 at 11:30 PM Igor Korot wrote: > > Hi,

Re: In which session context is a trigger run?

2018-12-31 Thread Mitar
Hi! On Mon, Dec 31, 2018 at 2:58 AM Peter J. Holzer wrote: > On 2018-12-30 08:56:13 -0800, Adrian Klaver wrote: > > On 12/30/18 3:08 AM, Peter J. Holzer wrote: > > > If I understood Mitar correctly he wants the trigger to execute in the > > > session where it was declared, not in the sessio where

Re: In which session context is a trigger run?

2018-12-31 Thread Mitar
Hi! On Sun, Dec 30, 2018 at 9:58 PM David G. Johnston wrote: > Doesn’t seem likely. Maybe you can use NOTIFY/LISTEN in your temporary > triggers and have your active client perform the work after being notified. Yes, this is what I ended up doing. I signal the client and then the client dispat

Re: In which session context is a trigger run?

2018-12-31 Thread Peter J. Holzer
On 2018-12-30 08:56:13 -0800, Adrian Klaver wrote: > On 12/30/18 3:08 AM, Peter J. Holzer wrote: > > If I understood Mitar correctly he wants the trigger to execute in the > > session where it was declared, not in the sessio where the statement was > > executed that triggered the trigger. > > Ther