pg_conndefaults Returning empty string

Started by Anushka Chandrababuabout 11 years ago6 messagesgeneral
Jump to latest
#1Anushka Chandrababu
anushka.babu@gmail.com

Hi,

I am accessing postgres database using tcl. I am looking for a way to
change the database in an existing connection, but I saw that this is not
possible in postgresql without creating a new connection.

Then I decided to query pg_conndefaults so that I can get the previous
connection detail, mainly the host ip address. But
it returned blank strings. Is there a way to set the pg_conndefault
values.Then I can use those values to make the new connection. Please
understand that at this point in the code, I have no information about the
previous connection parameters. I only know the new database name to which
it has to be connected.

Please let me know if there is a way to tackle this situation.

Thank You
Anushka

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Anushka Chandrababu (#1)
Re: pg_conndefaults Returning empty string

On 03/09/2015 12:57 AM, Anushka Chandrababu wrote:

Hi,

I am accessing postgres database using tcl. I am looking for a way to
change the database in an existing connection, but I saw that this is
not possible in postgresql without creating a new connection.

Then I decided to query pg_conndefaults so that I can get the previous
connection detail, mainly the host ip address. But
it returned blank strings. Is there a way to set the pg_conndefault
values.Then I can use those values to make the new connection. Please
understand that at this point in the code, I have no information about
the previous connection parameters. I only know the new database name to
which it has to be connected.

Please let me know if there is a way to tackle this situation.

What version of Postgres are you working with?

The last version I can find that has pg_conndefaults is 7.4.

Thank You
Anushka

--
Adrian Klaver
adrian.klaver@aklaver.com

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

#3Anushka Chandrababu
anushka.babu@gmail.com
In reply to: Adrian Klaver (#2)
Re: pg_conndefaults Returning empty string

Hi,

I am using Postgres as a part of another software and the version is 9.3.

I do not know how then the pg_conndefaults command works.

Please help me with some other solution so that I can get the details of a
particular connection such as host ip address and then use that create a
new connection to a different database.

Thank You
Anushka

On Mon, Mar 9, 2015 at 6:47 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

Show quoted text

On 03/09/2015 12:57 AM, Anushka Chandrababu wrote:

Hi,

I am accessing postgres database using tcl. I am looking for a way to
change the database in an existing connection, but I saw that this is
not possible in postgresql without creating a new connection.

Then I decided to query pg_conndefaults so that I can get the previous
connection detail, mainly the host ip address. But
it returned blank strings. Is there a way to set the pg_conndefault
values.Then I can use those values to make the new connection. Please
understand that at this point in the code, I have no information about
the previous connection parameters. I only know the new database name to
which it has to be connected.

Please let me know if there is a way to tackle this situation.

What version of Postgres are you working with?

The last version I can find that has pg_conndefaults is 7.4.

Thank You
Anushka

--
Adrian Klaver
adrian.klaver@aklaver.com

#4Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Anushka Chandrababu (#3)
Re: pg_conndefaults Returning empty string

On 03/09/2015 09:52 AM, Anushka Chandrababu wrote:

Hi,

I am using Postgres as a part of another software and the version is 9.3.

That software would be?

I do not know how then the pg_conndefaults command works.

Please help me with some other solution so that I can get the details of
a particular connection such as host ip address and then use that create
a new connection to a different database.

Well you say you are using tcl, so you will need to elaborate on what
that means?

What library are you using?

Thank You
Anushka

--
Adrian Klaver
adrian.klaver@aklaver.com

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

#5Anushka Chandrababu
anushka.babu@gmail.com
In reply to: Adrian Klaver (#4)
Re: pg_conndefaults Returning empty string

Hi,

Thank you Adrian for showing interest in my query.

The software I am using is Tableau Server. The library for tcl is lib.pgtcl.

Thank You
Anushka

On Mon, Mar 9, 2015 at 11:00 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

Show quoted text

On 03/09/2015 09:52 AM, Anushka Chandrababu wrote:

Hi,

I am using Postgres as a part of another software and the version is 9.3.

That software would be?

I do not know how then the pg_conndefaults command works.

Please help me with some other solution so that I can get the details of
a particular connection such as host ip address and then use that create
a new connection to a different database.

Well you say you are using tcl, so you will need to elaborate on what that
means?

What library are you using?

Thank You
Anushka

--
Adrian Klaver
adrian.klaver@aklaver.com

#6Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Anushka Chandrababu (#5)
Re: pg_conndefaults Returning empty string

On 03/09/2015 10:40 AM, Anushka Chandrababu wrote:

Hi,

Thank you Adrian for showing interest in my query.

The software I am using is Tableau Server. The library for tcl is lib.pgtcl.

Well on here:

https://github.com/flightaware/Pgtcl/blob/master/doc/PGTCL-NOTES

I do not see that pg_conndefaults does anything. Though there is this:

pg_dbinfo connections
This returns the currect connection handles

Maybe you get the information from there.

In any case you might be able to get more useful information from the
library author at the above GitHub reo.

Thank You
Anushka

On Mon, Mar 9, 2015 at 11:00 PM, Adrian Klaver
<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:

On 03/09/2015 09:52 AM, Anushka Chandrababu wrote:

Hi,

I am using Postgres as a part of another software and the
version is 9.3.

That software would be?

I do not know how then the pg_conndefaults command works.

Please help me with some other solution so that I can get the
details of
a particular connection such as host ip address and then use
that create
a new connection to a different database.

Well you say you are using tcl, so you will need to elaborate on
what that means?

What library are you using?

Thank You
Anushka

--
Adrian Klaver
adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>

--
Adrian Klaver
adrian.klaver@aklaver.com

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