Re: pg_dumpall asking for password for each database

Lists: pgsql-general
From: Krzysztof Barlik <kbarlik(at)wp(dot)pl>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dumpall asking for password for each database
Date: 2008-07-05 00:39:46
Message-ID: 200807050239.46251.kbarlik@wp.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

> What version are you running? IIRC it should remember the password
> between databases.

8.4.0 on Linux/x86_64. It does not, and man page clearly says:

"pg_dumpall needs to connect several times to the
PostgreSQL server (once per database). If you use password
authentication it will ask for a password each time."

Is there any specific reason for this behaviour ?

Thanks for Scott and Joshua - I read documentation about
.pgpass and PGPASSWORD, I just thought it would be a bit
more convenient and possibly safer to do it without
storing password in files or environment variables.

Thanks,
Krzysztof


From: Krzysztof Barlik <kbarlik(at)wp(dot)pl>
To: pgsql-general(at)postgresql(dot)org
Subject: Column names in rowsets returned from function
Date: 2009-09-26 16:32:55
Message-ID: 200909261832.55653.kbarlik@wp.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,

I have a question - is it possible to rename
columns in rowset returned from plpgsql function
delared as 'returns table(...)' ?

It seems it's not possible, even using
'as "column_name"' in internal query and
column names are always the same as in
'table(...)' definition.

If not, could it be possible in the future ?

Thanks,
Krzysztof


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Krzysztof Barlik <kbarlik(at)wp(dot)pl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Column names in rowsets returned from function
Date: 2009-09-26 17:15:00
Message-ID: 22896.1253985300@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Krzysztof Barlik <kbarlik(at)wp(dot)pl> writes:
> I have a question - is it possible to rename
> columns in rowset returned from plpgsql function
> delared as 'returns table(...)' ?

Sure ...

regression=# create function foo() returns table (a int, b text) as
regression-# $$ values (1,'one'), (2,'two') $$ language sql;
CREATE FUNCTION
regression=# select * from foo();
a | b
---+-----
1 | one
2 | two
(2 rows)

regression=# select * from foo() as x(y,z);
y | z
---+-----
1 | one
2 | two
(2 rows)

If that's not what you are talking about, you need to be more
specific about what you are talking about.

regards, tom lane


From: Krzysztof Barlik <kbarlik(at)wp(dot)pl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Column names in rowsets returned from function
Date: 2009-09-26 19:49:03
Message-ID: 200909262149.04027.kbarlik@wp.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi Tom,

> If that's not what you are talking about, you need to be more
> specific about what you are talking about.

you are right, I was not specific enough.

I meant a situation where returned rowset
may have different set of column names depending
on data in the database, not on explicit user request.

Regards,
Krzysztof


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Krzysztof Barlik <kbarlik(at)wp(dot)pl>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Column names in rowsets returned from function
Date: 2009-09-26 20:12:38
Message-ID: 162867790909261312g22a0dfd6u87d8f32d92c611de@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

2009/9/26 Krzysztof Barlik <kbarlik(at)wp(dot)pl>:
> Hi Tom,
>
>> If that's not what you are talking about, you need to be more
>> specific about what you are talking about.
>
> you are right, I was not specific enough.
>
> I meant a situation where returned rowset
> may have different set of column names depending
> on data in the database, not on explicit user request.

no this isn't possible yet

regards
Pavel Stehule
>
> Regards,
> Krzysztof
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>


From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Krzysztof Barlik <kbarlik(at)wp(dot)pl>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Column names in rowsets returned from function
Date: 2009-09-26 20:57:32
Message-ID: 200909261357.32990.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Saturday 26 September 2009 12:49:03 pm Krzysztof Barlik wrote:
> Hi Tom,
>
> > If that's not what you are talking about, you need to be more
> > specific about what you are talking about.
>
> you are right, I was not specific enough.
>
> I meant a situation where returned rowset
> may have different set of column names depending
> on data in the database, not on explicit user request.
>
> Regards,
> Krzysztof

Just to make things clear, is this the same question and situation that Jerzy
Bialas brought up in another post?

http://archives.postgresql.org/pgsql-general/2009-09/msg00922.php

--
Adrian Klaver
aklaver(at)comcast(dot)net


From: Krzysztof Barlik <kbarlik(at)wp(dot)pl>
To: pgsql-general(at)postgresql(dot)org
Cc: Adrian Klaver <aklaver(at)comcast(dot)net>
Subject: Re: Column names in rowsets returned from function
Date: 2009-09-26 22:53:48
Message-ID: 200909270053.48281.kbarlik@wp.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

> Just to make things clear, is this the same question and situation that
> Jerzy Bialas brought up in another post?
>
> http://archives.postgresql.org/pgsql-general/2009-09/msg00922.php

Yes, I didn't know he posted it earlier.
Sorry for the confusion and thanks for response.

Regards,
Krzysztof


From: Krzysztof Barlik <kbarlik(at)wp(dot)pl>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_dumpall asking for password for each database
Date: 2009-10-06 20:59:32
Message-ID: 200910062259.32192.kbarlik@wp.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,

is it possible to force pg_dumpall to ask for
password only once (connecting as superuser 'postgres') ?

Entering it for every database is a bit annoying.

Thanks,
Krzysztof


From: Scott Mead <scott(dot)lists(at)enterprisedb(dot)com>
To: Krzysztof Barlik <kbarlik(at)wp(dot)pl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dumpall asking for password for each database
Date: 2009-10-06 21:11:57
Message-ID: d3ab2ec80910061411p132248f4t91bdab0bf32852a1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

2009/10/6 Krzysztof Barlik <kbarlik(at)wp(dot)pl>

> Hi,
>
> is it possible to force pg_dumpall to ask for
> password only once (connecting as superuser 'postgres') ?
>
> Entering it for every database is a bit annoying.
>

Kind of, you'll either use an environment variable:

http://www.postgresql.org/docs/8.4/interactive/libpq-envars.html
(specifically PGPASSWORD)

or the pgpass file:

http://www.postgresql.org/docs/ยด8.4/interactive/libpq-pgpass.html

--Scott


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Krzysztof Barlik <kbarlik(at)wp(dot)pl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dumpall asking for password for each database
Date: 2009-10-06 21:45:58
Message-ID: 1254865558.30674.1610.camel@jd-desktop.unknown.charter.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Tue, 2009-10-06 at 22:59 +0200, Krzysztof Barlik wrote:
> Hi,
>
> is it possible to force pg_dumpall to ask for
> password only once (connecting as superuser 'postgres') ?
>
> Entering it for every database is a bit annoying.

take a look at .pgpass documentation

>
> Thanks,
> Krzysztof
>
>
>
>
--
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564
Consulting, Training, Support, Custom Development, Engineering
If the world pushes look it in the eye and GRR. Then push back harder. - Salamander


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Krzysztof Barlik <kbarlik(at)wp(dot)pl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dumpall asking for password for each database
Date: 2009-10-06 22:59:59
Message-ID: 20091006225959.GT5929@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Krzysztof Barlik wrote:
> Hi,
>
> is it possible to force pg_dumpall to ask for
> password only once (connecting as superuser 'postgres') ?
>
> Entering it for every database is a bit annoying.

What version are you running? IIRC it should remember the password
between databases.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.