Re: psql - better support pipe line - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: psql - better support pipe line
Date
Msg-id 55DFB983.2070007@BlueTreble.com
Whole thread Raw
In response to Re: psql - better support pipe line  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: psql - better support pipe line  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
List pgsql-hackers
On 8/27/15 8:37 AM, Pavel Stehule wrote:
>
>     I don't think we can detect and remove the default values from this
>     output in a reliable way?
>
>
> This is pretty difficult - any parameter can be important, and hard to
> identify default values on client side without connect to server side. I
> don't see any other way, than hold bitmap for identification entered
> values and default values from the input.

That would be nice, but probably not that big a deal.

What I think would be more useful is a way to exclude the password if 
you didn't need it.

It occurs to me the most flexible thing that could be done here would be 
providing a libpq function that spits out JSON connection parameters and 
have psql turn that into a variable. It would be easy to feed that to a 
SQL statement and do whatever you want with it at that point, including 
format it to a connection URI.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: pg_extension_config_dump() doesn't register owned sequences
Next
From: Jim Nasby
Date:
Subject: Re: Support for N synchronous standby servers - take 2