pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PQconninfoParse()
11+ messages / 3 participants
[nested] [flat]

* PQconninfoParse()
@ 2011-09-27 13:13 Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-10 17:00 ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Dmitriy Igrishin @ 2011-09-27 13:13 UTC (permalink / raw)
  To: pgsql-docs

Hey,

I suggest to clarify the documentation of PQconninfoParse().

First,
"Returns parsed connection options from the provided connection string."
Its false. The returned array contains all options, rather than which only
parsed from the provided connection string. This fact must be specified in
the documentation becase the name of the function mismatches its behaviour.

Second,
"Note that only options explicitly specified in the string will have values
set
in the result array; no defaults are inserted."
Its true. But instead of "no defaults are inserted" I suggest "values of
other
options will have NULL values."

-- 
// Dmitriy.

^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: PQconninfoParse()
  2011-09-27 13:13 PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
@ 2011-10-10 17:00 ` Robert Haas <robertmhaas@gmail.com>
  2011-10-10 17:31   ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Robert Haas @ 2011-10-10 17:00 UTC (permalink / raw)
  To: Dmitriy Igrishin <dmitigr@gmail.com>; +Cc: pgsql-docs

On Tue, Sep 27, 2011 at 9:13 AM, Dmitriy Igrishin <dmitigr@gmail.com> wrote:
> First,
> "Returns parsed connection options from the provided connection string."
> Its false. The returned array contains all options, rather than which only
> parsed from the provided connection string. This fact must be specified in
> the documentation becase the name of the function mismatches its behaviour.

What do you mean by "all" options?  Where else are they coming from
besides the connection string?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: PQconninfoParse()
  2011-09-27 13:13 PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-10 17:00 ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
@ 2011-10-10 17:31   ` Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-15 10:25     ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Dmitriy Igrishin @ 2011-10-10 17:31 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: pgsql-docs

Hey Robert,

2011/10/10 Robert Haas <robertmhaas@gmail.com>

> On Tue, Sep 27, 2011 at 9:13 AM, Dmitriy Igrishin <dmitigr@gmail.com>
> wrote:
> > First,
> > "Returns parsed connection options from the provided connection string."
> > Its false. The returned array contains all options, rather than which
> only
> > parsed from the provided connection string. This fact must be specified
> in
> > the documentation becase the name of the function mismatches its
> behaviour.
>
> What do you mean by "all" options?  Where else are they coming from
> besides the connection string?
>
I mean options from
static const PQconninfoOption PQconninfoOptions[]
from interfaces/libpq/fe-connect.c

>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



-- 
// Dmitriy.

^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: PQconninfoParse()
  2011-09-27 13:13 PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-10 17:00 ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-10 17:31   ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
@ 2011-10-15 10:25     ` Robert Haas <robertmhaas@gmail.com>
  2011-10-15 10:33       ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-15 15:24       ` Re: PQconninfoParse() Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 11+ messages in thread

From: Robert Haas @ 2011-10-15 10:25 UTC (permalink / raw)
  To: Dmitriy Igrishin <dmitigr@gmail.com>; +Cc: pgsql-docs

On Mon, Oct 10, 2011 at 1:31 PM, Dmitriy Igrishin <dmitigr@gmail.com> wrote:
> Hey Robert,
>
> 2011/10/10 Robert Haas <robertmhaas@gmail.com>
>>
>> On Tue, Sep 27, 2011 at 9:13 AM, Dmitriy Igrishin <dmitigr@gmail.com>
>> wrote:
>> > First,
>> > "Returns parsed connection options from the provided connection string."
>> > Its false. The returned array contains all options, rather than which
>> > only
>> > parsed from the provided connection string. This fact must be specified
>> > in
>> > the documentation becase the name of the function mismatches its
>> > behaviour.
>>
>> What do you mean by "all" options?  Where else are they coming from
>> besides the connection string?
>
> I mean options from
> static const PQconninfoOption PQconninfoOptions[]
> from interfaces/libpq/fe-connect.c

Maybe we should change this:

Note that only options explicitly specified in the string will have
values set in the result array; no defaults are inserted.

To say something like this:

All legal options will be present in the result array, but only those
explicitly specified in the string will have a corresponding value; no
defaults are inserted.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: PQconninfoParse()
  2011-09-27 13:13 PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-10 17:00 ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-10 17:31   ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-15 10:25     ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
@ 2011-10-15 10:33       ` Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-15 11:12         ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  1 sibling, 1 reply; 11+ messages in thread

From: Dmitriy Igrishin @ 2011-10-15 10:33 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: pgsql-docs

2011/10/15 Robert Haas <robertmhaas@gmail.com>

> On Mon, Oct 10, 2011 at 1:31 PM, Dmitriy Igrishin <dmitigr@gmail.com>
> wrote:
> > Hey Robert,
> >
> > 2011/10/10 Robert Haas <robertmhaas@gmail.com>
> >>
> >> On Tue, Sep 27, 2011 at 9:13 AM, Dmitriy Igrishin <dmitigr@gmail.com>
> >> wrote:
> >> > First,
> >> > "Returns parsed connection options from the provided connection
> string."
> >> > Its false. The returned array contains all options, rather than which
> >> > only
> >> > parsed from the provided connection string. This fact must be
> specified
> >> > in
> >> > the documentation becase the name of the function mismatches its
> >> > behaviour.
> >>
> >> What do you mean by "all" options?  Where else are they coming from
> >> besides the connection string?
> >
> > I mean options from
> > static const PQconninfoOption PQconninfoOptions[]
> > from interfaces/libpq/fe-connect.c
>
> Maybe we should change this:
>
> Note that only options explicitly specified in the string will have
> values set in the result array; no defaults are inserted.
>
> To say something like this:
>
> All legal options will be present in the result array, but only those
> explicitly specified in the string will have a corresponding value; no
> defaults are inserted.
>
Exactly! Perfect!

>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



-- 
// Dmitriy.

^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: PQconninfoParse()
  2011-09-27 13:13 PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-10 17:00 ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-10 17:31   ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-15 10:25     ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-15 10:33       ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
@ 2011-10-15 11:12         ` Dmitriy Igrishin <dmitigr@gmail.com>
  0 siblings, 0 replies; 11+ messages in thread

From: Dmitriy Igrishin @ 2011-10-15 11:12 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: pgsql-docs

2011/10/15 Dmitriy Igrishin <dmitigr@gmail.com>

>
>
> 2011/10/15 Robert Haas <robertmhaas@gmail.com>
>
>> On Mon, Oct 10, 2011 at 1:31 PM, Dmitriy Igrishin <dmitigr@gmail.com>
>> wrote:
>> > Hey Robert,
>> >
>> > 2011/10/10 Robert Haas <robertmhaas@gmail.com>
>> >>
>> >> On Tue, Sep 27, 2011 at 9:13 AM, Dmitriy Igrishin <dmitigr@gmail.com>
>> >> wrote:
>> >> > First,
>> >> > "Returns parsed connection options from the provided connection
>> string."
>> >> > Its false. The returned array contains all options, rather than which
>> >> > only
>> >> > parsed from the provided connection string. This fact must be
>> specified
>> >> > in
>> >> > the documentation becase the name of the function mismatches its
>> >> > behaviour.
>> >>
>> >> What do you mean by "all" options?  Where else are they coming from
>> >> besides the connection string?
>> >
>> > I mean options from
>> > static const PQconninfoOption PQconninfoOptions[]
>> > from interfaces/libpq/fe-connect.c
>>
>> Maybe we should change this:
>>
>> Note that only options explicitly specified in the string will have
>> values set in the result array; no defaults are inserted.
>>
>> To say something like this:
>>
>> All legal options will be present in the result array, but only those
>> explicitly specified in the string will have a corresponding value; no
>> defaults are inserted.
>>
> Exactly! Perfect!
>
Also, I would say something about deprecated options
such as "authtype" which are still presents in the returned
array.

>
>> --
>> Robert Haas
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
>
> --
> // Dmitriy.
>
>
>


-- 
// Dmitriy.

^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: PQconninfoParse()
  2011-09-27 13:13 PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-10 17:00 ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-10 17:31   ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-15 10:25     ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
@ 2011-10-15 15:24       ` Tom Lane <tgl@sss.pgh.pa.us>
  2011-10-15 17:21         ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-19 00:07         ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  1 sibling, 2 replies; 11+ messages in thread

From: Tom Lane @ 2011-10-15 15:24 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Dmitriy Igrishin <dmitigr@gmail.com>; pgsql-docs

Robert Haas <robertmhaas@gmail.com> writes:
> Maybe we should change this:

> Note that only options explicitly specified in the string will have
> values set in the result array; no defaults are inserted.

> To say something like this:

> All legal options will be present in the result array, but only those
> explicitly specified in the string will have a corresponding value; no
> defaults are inserted.

Uh, is that actually a true statement?  I thought the result *did*
include default values.  That's more or less the point of returning them
all, after all.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: PQconninfoParse()
  2011-09-27 13:13 PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-10 17:00 ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-10 17:31   ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-15 10:25     ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-15 15:24       ` Re: PQconninfoParse() Tom Lane <tgl@sss.pgh.pa.us>
@ 2011-10-15 17:21         ` Dmitriy Igrishin <dmitigr@gmail.com>
  1 sibling, 0 replies; 11+ messages in thread

From: Dmitriy Igrishin @ 2011-10-15 17:21 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Robert Haas <robertmhaas@gmail.com>; pgsql-docs

2011/10/15 Tom Lane <tgl@sss.pgh.pa.us>

> Robert Haas <robertmhaas@gmail.com> writes:
> > Maybe we should change this:
>
> > Note that only options explicitly specified in the string will have
> > values set in the result array; no defaults are inserted.
>
> > To say something like this:
>
> > All legal options will be present in the result array, but only those
> > explicitly specified in the string will have a corresponding value; no
> > defaults are inserted.
>
> Uh, is that actually a true statement?  I thought the result *did*
> include default values.  That's more or less the point of returning them
> all, after all.
>
Oops, indeed, if I understand your correctly thats what
I meant in my first post - "values of other options will have
NULL values" instead of "no defaults are inserted".

>
>                        regards, tom lane
>



-- 
// Dmitriy.

^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: PQconninfoParse()
  2011-09-27 13:13 PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-10 17:00 ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-10 17:31   ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-15 10:25     ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-15 15:24       ` Re: PQconninfoParse() Tom Lane <tgl@sss.pgh.pa.us>
@ 2011-10-19 00:07         ` Robert Haas <robertmhaas@gmail.com>
  2011-10-19 00:27           ` Re: PQconninfoParse() Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 11+ messages in thread

From: Robert Haas @ 2011-10-19 00:07 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Dmitriy Igrishin <dmitigr@gmail.com>; pgsql-docs

On Sat, Oct 15, 2011 at 11:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> Maybe we should change this:
>
>> Note that only options explicitly specified in the string will have
>> values set in the result array; no defaults are inserted.
>
>> To say something like this:
>
>> All legal options will be present in the result array, but only those
>> explicitly specified in the string will have a corresponding value; no
>> defaults are inserted.
>
> Uh, is that actually a true statement?  I thought the result *did*
> include default values.  That's more or less the point of returning them
> all, after all.

Well, then I'm confused, because you and Dmitriy seem to be saying
opposite things.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: PQconninfoParse()
  2011-09-27 13:13 PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-10 17:00 ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-10 17:31   ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-15 10:25     ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-15 15:24       ` Re: PQconninfoParse() Tom Lane <tgl@sss.pgh.pa.us>
  2011-10-19 00:07         ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
@ 2011-10-19 00:27           ` Tom Lane <tgl@sss.pgh.pa.us>
  2012-03-23 02:12             ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Tom Lane @ 2011-10-19 00:27 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Dmitriy Igrishin <dmitigr@gmail.com>; pgsql-docs

Robert Haas <robertmhaas@gmail.com> writes:
> On Sat, Oct 15, 2011 at 11:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Uh, is that actually a true statement?  I thought the result *did*
>> include default values.  That's more or less the point of returning them
>> all, after all.

> Well, then I'm confused, because you and Dmitriy seem to be saying
> opposite things.

[ after experimenting with the code ... ]  Oh, I had been thinking that 
PQconndefaults gives the same result as PQconninfoParse with an
empty-string argument, but that's not the case.  Indeed, the former
fills in default values as current values, but the latter does not.

The proposed wording change seems reasonable, except that "have a
corresponding value" seems a bit vague.  Maybe better "have a non-null
val field".

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: PQconninfoParse()
  2011-09-27 13:13 PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-10 17:00 ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-10 17:31   ` Re: PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
  2011-10-15 10:25     ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-15 15:24       ` Re: PQconninfoParse() Tom Lane <tgl@sss.pgh.pa.us>
  2011-10-19 00:07         ` Re: PQconninfoParse() Robert Haas <robertmhaas@gmail.com>
  2011-10-19 00:27           ` Re: PQconninfoParse() Tom Lane <tgl@sss.pgh.pa.us>
@ 2012-03-23 02:12             ` Robert Haas <robertmhaas@gmail.com>
  0 siblings, 0 replies; 11+ messages in thread

From: Robert Haas @ 2012-03-23 02:12 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Dmitriy Igrishin <dmitigr@gmail.com>; pgsql-docs

On Tue, Oct 18, 2011 at 8:27 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Sat, Oct 15, 2011 at 11:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Uh, is that actually a true statement?  I thought the result *did*
>>> include default values.  That's more or less the point of returning them
>>> all, after all.
>
>> Well, then I'm confused, because you and Dmitriy seem to be saying
>> opposite things.
>
> [ after experimenting with the code ... ]  Oh, I had been thinking that
> PQconndefaults gives the same result as PQconninfoParse with an
> empty-string argument, but that's not the case.  Indeed, the former
> fills in default values as current values, but the latter does not.
>
> The proposed wording change seems reasonable, except that "have a
> corresponding value" seems a bit vague.  Maybe better "have a non-null
> val field".

I've committed something along these lines.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



^ permalink  raw  reply  [nested|flat] 11+ messages in thread


end of thread, other threads:[~2012-03-23 02:12 UTC | newest]

Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-09-27 13:13 PQconninfoParse() Dmitriy Igrishin <dmitigr@gmail.com>
2011-10-10 17:00 ` Robert Haas <robertmhaas@gmail.com>
2011-10-10 17:31   ` Dmitriy Igrishin <dmitigr@gmail.com>
2011-10-15 10:25     ` Robert Haas <robertmhaas@gmail.com>
2011-10-15 10:33       ` Dmitriy Igrishin <dmitigr@gmail.com>
2011-10-15 11:12         ` Dmitriy Igrishin <dmitigr@gmail.com>
2011-10-15 15:24       ` Tom Lane <tgl@sss.pgh.pa.us>
2011-10-15 17:21         ` Dmitriy Igrishin <dmitigr@gmail.com>
2011-10-19 00:07         ` Robert Haas <robertmhaas@gmail.com>
2011-10-19 00:27           ` Tom Lane <tgl@sss.pgh.pa.us>
2012-03-23 02:12             ` Robert Haas <robertmhaas@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox