proposal: option --application_name for psql

Started by Pavel Stehuleover 12 years ago8 messages
#1Pavel Stehule
pavel.stehule@gmail.com

Hello

we like to use psql in combination with bash - just like postgresql driver.

Actually there is no simple possibility (from command line) to set
application_name. We would to use different name than psql - for
example "splunk", ...

I tested PGAPPNAME, but it doesn't work.

so my propose:

1) fix psql to respect PGAPPNAME

2) enhance --application_name parameter

Options, ideas, comments ?

Regards

Pavel

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Erik Rijkers
er@xs4all.nl
In reply to: Pavel Stehule (#1)
Re: proposal: option --application_name for psql

On Tue, May 14, 2013 21:04, Pavel Stehule wrote:

Hello

we like to use psql in combination with bash - just like postgresql driver.

Actually there is no simple possibility (from command line) to set
application_name. We would to use different name than psql - for
example "splunk", ...

I tested PGAPPNAME, but it doesn't work.

It does work:

$ PGAPPNAME=splunk psql -c "select application_name from pg_stat_activity;"
application_name
------------------
splunk
(1 row)

But perhaps I misunderstood your intention?

Thanks,

Erik Rijkers

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: Erik Rijkers (#2)
Re: proposal: option --application_name for psql

2013/5/14 Erik Rijkers <er@xs4all.nl>:

On Tue, May 14, 2013 21:04, Pavel Stehule wrote:

Hello

we like to use psql in combination with bash - just like postgresql driver.

Actually there is no simple possibility (from command line) to set
application_name. We would to use different name than psql - for
example "splunk", ...

I tested PGAPPNAME, but it doesn't work.

It does work:

$ PGAPPNAME=splunk psql -c "select application_name from pg_stat_activity;"
application_name
------------------
splunk
(1 row)

But perhaps I misunderstood your intention?

I was wrong - PGAPPNAME works, thank you

but command line --application_name option should be a useful option I
am thinking still

Regards

Pavel

Thanks,

Erik Rijkers

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Magnus Hagander
magnus@hagander.net
In reply to: Pavel Stehule (#3)
Re: proposal: option --application_name for psql

On Tue, May 14, 2013 at 9:25 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:

2013/5/14 Erik Rijkers <er@xs4all.nl>:

On Tue, May 14, 2013 21:04, Pavel Stehule wrote:

Hello

we like to use psql in combination with bash - just like postgresql driver.

Actually there is no simple possibility (from command line) to set
application_name. We would to use different name than psql - for
example "splunk", ...

I tested PGAPPNAME, but it doesn't work.

It does work:

$ PGAPPNAME=splunk psql -c "select application_name from pg_stat_activity;"
application_name
------------------
splunk
(1 row)

But perhaps I misunderstood your intention?

I was wrong - PGAPPNAME works, thank you

but command line --application_name option should be a useful option I
am thinking still

That goes for a lot of the parameters that go in a connection string,
I'm not sure application_name is common enough to have it's own
argument if other parameters don't. And you can still set it as long
as you use psql in "connection string mode", as you can with all the
libpq parameters.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Pavel Stehule
pavel.stehule@gmail.com
In reply to: Magnus Hagander (#4)
Re: proposal: option --application_name for psql

2013/5/14 Magnus Hagander <magnus@hagander.net>:

psql in "connection string mode"

Hi Magnus, can me send some link?

Thank you

Pavel

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Magnus Hagander
magnus@hagander.net
In reply to: Pavel Stehule (#5)
Re: proposal: option --application_name for psql

On Tue, May 14, 2013 at 9:36 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:

2013/5/14 Magnus Hagander <magnus@hagander.net>:

psql in "connection string mode"

Hi Magnus, can me send some link?

http://www.postgresql.org/docs/9.2/static/app-psql.html

"If this parameter contains an = sign or starts with a valid URI
prefix (postgresql:// or postgres://), it is treated as a conninfo
string. See Section 31.1 for more information."

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Pavel Stehule
pavel.stehule@gmail.com
In reply to: Magnus Hagander (#6)
Re: proposal: option --application_name for psql

2013/5/14 Magnus Hagander <magnus@hagander.net>:

On Tue, May 14, 2013 at 9:36 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:

2013/5/14 Magnus Hagander <magnus@hagander.net>:

psql in "connection string mode"

Hi Magnus, can me send some link?

http://www.postgresql.org/docs/9.2/static/app-psql.html

"If this parameter contains an = sign or starts with a valid URI
prefix (postgresql:// or postgres://), it is treated as a conninfo
string. See Section 31.1 for more information."

I was blind, thank you

Pavel

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#8Pavel Stehule
pavel.stehule@gmail.com
In reply to: Pavel Stehule (#7)
Re: proposal: option --application_name for psql

2013/5/14 Pavel Stehule <pavel.stehule@gmail.com>:

2013/5/14 Magnus Hagander <magnus@hagander.net>:

On Tue, May 14, 2013 at 9:36 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:

2013/5/14 Magnus Hagander <magnus@hagander.net>:

psql in "connection string mode"

Hi Magnus, can me send some link?

http://www.postgresql.org/docs/9.2/static/app-psql.html

"If this parameter contains an = sign or starts with a valid URI
prefix (postgresql:// or postgres://), it is treated as a conninfo
string. See Section 31.1 for more information."

I was blind, thank you

After comments from Erik and Magnus my proposal has no sense.

Regards

Pavel

Pavel

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers