Re: fix in --help output

Lists: pgsql-patches
From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: pgsql-patches(at)postgresql(dot)org
Subject: fix in --help output
Date: 2008-02-21 17:10:02
Message-ID: 47BDB06A.3070700@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

I attach fix for --help output. I replaced --NAME... with -NAME and add some
example. getopt parse -- as a end of options and rest of line is not parsed.
This should be backported for 8.3 and 8.2 as well. PG8.1 does not have this options.

Thanks Zdenek

Attachment Content-Type Size
help.patch text/x-patch 1.4 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-21 17:57:06
Message-ID: 12754.1203616626@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> I attach fix for --help output. I replaced --NAME... with -NAME and add some
> example. getopt parse -- as a end of options and rest of line is not parsed.

Surely this is outright wrong. Or if you do have a getopt that acts
that way, the bug is that we are using it rather than one that acts
the way we want.

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>
Subject: Re: fix in --help output
Date: 2008-02-21 20:10:32
Message-ID: 200802212110.32672.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Zdenek Kotala wrote:
> I attach fix for --help output. I replaced --NAME... with -NAME

But that is wrong.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-21 21:16:15
Message-ID: 47BDEA1F.8060605@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Tom Lane napsal(a):
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
>> I attach fix for --help output. I replaced --NAME... with -NAME and add some
>> example. getopt parse -- as a end of options and rest of line is not parsed.
>
> Surely this is outright wrong. Or if you do have a getopt that acts
> that way, the bug is that we are using it rather than one that acts
> the way we want.

Ah, sorry it really does not work.

However, I get following error on Solaris:

bash-3.2$ /usr/postgres/8.2/bin/postgres -D /tmp/db --share_buffers=16000
/usr/postgres/8.2/bin/postgres: illegal option -- share_buffers=16000
Try "postgres --help" for more information.

but following command works fine:

/usr/postgres/8.2/bin/postgres -D /tmp/db -c shared_buffers=16000

By my opinion problem is in getopt which interprets -- as a end of
options list.

See
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
Guideline 10

It maybe work on linux but I think it is not portable solution.

Zdenek


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-21 21:21:21
Message-ID: 20080221212121.GF4615@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Zdenek Kotala wrote:

> It maybe work on linux but I think it is not portable solution.

What we should do is avoid using Solaris' getopt_long and instead use
the copy we have in src/port/.

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


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-21 21:28:38
Message-ID: 47BDED06.4000008@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Alvaro Herrera napsal(a):
> Zdenek Kotala wrote:
>
>> It maybe work on linux but I think it is not portable solution.
>
> What we should do is avoid using Solaris' getopt_long and instead use
> the copy we have in src/port/.
>

If I looked correctly there is no getopt_long. There is only getopt with
- as a option. See PostmasterMain:

while ((opt = getopt(argc, argv,
"A:B:c:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:W:-:")) != -1)

If I understand correctly the POSIX standard "-" should not used in a
option list.

Zdenek


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-21 21:31:41
Message-ID: 47BDEDBD.6020303@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Zdenek Kotala wrote:
> Tom Lane napsal(a):
>> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
>>> I attach fix for --help output. I replaced --NAME... with -NAME and
>>> add some example. getopt parse -- as a end of options and rest of
>>> line is not parsed.
>>
>> Surely this is outright wrong. Or if you do have a getopt that acts
>> that way, the bug is that we are using it rather than one that acts
>> the way we want.
>
> Ah, sorry it really does not work.
>
> However, I get following error on Solaris:
>
> bash-3.2$ /usr/postgres/8.2/bin/postgres -D /tmp/db --share_buffers=16000
> /usr/postgres/8.2/bin/postgres: illegal option -- share_buffers=16000
> Try "postgres --help" for more information.
>
> but following command works fine:
>
> /usr/postgres/8.2/bin/postgres -D /tmp/db -c shared_buffers=16000
>
>
> By my opinion problem is in getopt which interprets -- as a end of
> options list.
>
> See
> http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
>
> Guideline 10
>
> It maybe work on linux but I think it is not portable solution.
>
>
>

-- on its own might indicate the end of arguments, but that's quite
different from --foo=bar. Guideline 10 of the above surely only refers
to -- as an entire argument, not to -- as the first two characters of an
argument. If your getopt treats *any* -- as the end of options then I
think it is broken (complain to your vendor ;-) ). And the answer is
known - use the one we have in src/port.

cheers

andrew


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-21 22:22:52
Message-ID: 47BDF9BC.6070605@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Andrew Dunstan napsal(a):
>
>
> Zdenek Kotala wrote:
>> Tom Lane napsal(a):
>>> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
>>>> I attach fix for --help output. I replaced --NAME... with -NAME and
>>>> add some example. getopt parse -- as a end of options and rest of
>>>> line is not parsed.
>>>
>>> Surely this is outright wrong. Or if you do have a getopt that acts
>>> that way, the bug is that we are using it rather than one that acts
>>> the way we want.
>>
>> Ah, sorry it really does not work.
>>
>> However, I get following error on Solaris:
>>
>> bash-3.2$ /usr/postgres/8.2/bin/postgres -D /tmp/db --share_buffers=16000
>> /usr/postgres/8.2/bin/postgres: illegal option -- share_buffers=16000
>> Try "postgres --help" for more information.
>>
>> but following command works fine:
>>
>> /usr/postgres/8.2/bin/postgres -D /tmp/db -c shared_buffers=16000
>>
>>
>> By my opinion problem is in getopt which interprets -- as a end of
>> options list.
>>
>> See
>> http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
>>
>> Guideline 10
>>
>> It maybe work on linux but I think it is not portable solution.
>>
>>
>>
>
> -- on its own might indicate the end of arguments, but that's quite
> different from --foo=bar. Guideline 10 of the above surely only refers
> to -- as an entire argument, not to -- as the first two characters of an
> argument. If your getopt treats *any* -- as the end of options then I
> think it is broken (complain to your vendor ;-) ). And the answer is
> known - use the one we have in src/port.

You are not correct (I pointed to wrong Guidline). If you look to
Guidline 3 it specific only alphanumeric character. And you can read
"The implementation may accept other characters as an extension." in
http://www.opengroup.org/onlinepubs/009695399/functions/getopt.html

It means that Solaris implementation is OK. Linux uses some extensions
but it is not portable. If we want to use long options. We have
getop_long for it.

Zdenek


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-22 03:20:23
Message-ID: 20080222032023.GG4615@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Zdenek Kotala wrote:

> If I looked correctly there is no getopt_long. There is only getopt with
> - as a option. See PostmasterMain:
>
>
> while ((opt = getopt(argc, argv,
> "A:B:c:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:W:-:")) != -1)
>
> If I understand correctly the POSIX standard "-" should not used in a
> option list.

Hmm, right. Our current parsing of --long-opts is quite a hack, it
seems :-( Having to list all GUC options in the getopt_long array would
be a mess. Any other ideas?

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


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: fix in --help output
Date: 2008-02-22 07:44:44
Message-ID: 200802220844.44889.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Zdenek Kotala wrote:
> However, I get following error on Solaris:
>
> bash-3.2$ /usr/postgres/8.2/bin/postgres -D /tmp/db --share_buffers=16000
> /usr/postgres/8.2/bin/postgres: illegal option -- share_buffers=16000
> Try "postgres --help" for more information.
>
> but following command works fine:
>
> /usr/postgres/8.2/bin/postgres -D /tmp/db -c shared_buffers=16000

share_buffers is not the same as shared_buffers.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: fix in --help output
Date: 2008-02-22 07:56:35
Message-ID: 47BE8033.8010501@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Peter Eisentraut napsal(a):
> Zdenek Kotala wrote:
>> However, I get following error on Solaris:
>>
>> bash-3.2$ /usr/postgres/8.2/bin/postgres -D /tmp/db --share_buffers=16000
>> /usr/postgres/8.2/bin/postgres: illegal option -- share_buffers=16000
>> Try "postgres --help" for more information.
>>
>> but following command works fine:
>>
>> /usr/postgres/8.2/bin/postgres -D /tmp/db -c shared_buffers=16000
>
> share_buffers is not the same as shared_buffers.

Yeah, it was a typo but it does not work anyway.

Zdenek


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: fix in --help output
Date: 2008-02-22 09:44:07
Message-ID: 200802221044.07536.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Am Freitag, 22. Februar 2008 schrieb Zdenek Kotala:
> Peter Eisentraut napsal(a):
> > Zdenek Kotala wrote:
> >> However, I get following error on Solaris:
> >>
> >> bash-3.2$ /usr/postgres/8.2/bin/postgres -D /tmp/db
> >> --share_buffers=16000 /usr/postgres/8.2/bin/postgres: illegal option --
> >> share_buffers=16000 Try "postgres --help" for more information.
> >>
> >> but following command works fine:
> >>
> >> /usr/postgres/8.2/bin/postgres -D /tmp/db -c shared_buffers=16000
> >
> > share_buffers is not the same as shared_buffers.
>
> Yeah, it was a typo but it does not work anyway.

Well, if it doesn't work you can use the -c option.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-22 10:01:51
Message-ID: 47BE9D8F.20707@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Alvaro Herrera napsal(a):
> Zdenek Kotala wrote:
>
>> If I looked correctly there is no getopt_long. There is only getopt with
>> - as a option. See PostmasterMain:
>>
>>
>> while ((opt = getopt(argc, argv,
>> "A:B:c:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:W:-:")) != -1)
>>
>> If I understand correctly the POSIX standard "-" should not used in a
>> option list.
>
> Hmm, right. Our current parsing of --long-opts is quite a hack, it
> seems :-( Having to list all GUC options in the getopt_long array would
> be a mess. Any other ideas?
>

I attached patch which replaces any "--..." occurrence with "-c..." on
command line.

Zdenek

Attachment Content-Type Size
getopt.patch text/x-patch 1.8 KB

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: fix in --help output
Date: 2008-02-22 10:07:52
Message-ID: 47BE9EF8.2080200@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Peter Eisentraut napsal(a):
> Am Freitag, 22. Februar 2008 schrieb Zdenek Kotala:
>> Peter Eisentraut napsal(a):
>>> Zdenek Kotala wrote:
>>>> However, I get following error on Solaris:
>>>>
>>>> bash-3.2$ /usr/postgres/8.2/bin/postgres -D /tmp/db
>>>> --share_buffers=16000 /usr/postgres/8.2/bin/postgres: illegal option --
>>>> share_buffers=16000 Try "postgres --help" for more information.
>>>>
>>>> but following command works fine:
>>>>
>>>> /usr/postgres/8.2/bin/postgres -D /tmp/db -c shared_buffers=16000
>>> share_buffers is not the same as shared_buffers.
>> Yeah, it was a typo but it does not work anyway.
>
> Well, if it doesn't work you can use the -c option.

Yes, but it is confusing. For example see following message:

postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the
PGDATA environment variable.

config-file is there mention as a hint, but it does not work and I think
there are more places where usage of "--.." is mentioned. It is
confusing for the user and there is no clue.

Zdenek


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-22 12:46:33
Message-ID: 20080222124633.GB6001@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Zdenek Kotala wrote:
> Alvaro Herrera napsal(a):

>> Hmm, right. Our current parsing of --long-opts is quite a hack, it
>> seems :-( Having to list all GUC options in the getopt_long array would
>> be a mess. Any other ideas?
>
> I attached patch which replaces any "--..." occurrence with "-c..." on
> command line.

Actually I meant a way to make our current hack work on your platform.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-22 15:15:35
Message-ID: 3484.1203693335@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> I attached patch which replaces any "--..." occurrence with "-c..." on
> command line.

Please see whether forcibly using src/port/getopt.c fixes this,
instead. A saner patch would probably add something like this
to configure.in:

if test "$PORTNAME" = "solaris"; then
AC_LIBOBJ(getopt)
AC_LIBOBJ(getopt_long)
fi

regards, tom lane


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-22 20:41:35
Message-ID: 47BF337F.6040807@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Tom Lane napsal(a):
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
>> I attached patch which replaces any "--..." occurrence with "-c..." on
>> command line.
>
> Please see whether forcibly using src/port/getopt.c fixes this,
> instead. A saner patch would probably add something like this
> to configure.in:
>
> if test "$PORTNAME" = "solaris"; then
> AC_LIBOBJ(getopt)
> AC_LIBOBJ(getopt_long)
> fi

Yeah, this is the best solution. I attach a patch. Is possible to
backport it back to 8.3, 8.2?

Just for completeness Solaris getopt function has a extension which
processes long option argument. This extension is called CLIP. This
implementation collides with unusual getopt usage for long option
processing in PostgreSQL.

More info are there:
http://docs.sun.com/app/docs/doc/819-2243/getopt-3c?l=en&a=view
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/getopt.c
http://docs.sun.com/app/docs/doc/819-2239/6n4hsf6e5?l=en&a=view

By the way old solaris getopt version is similary with postgres
implementation. :-)

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libbc/libc/gen/common/getopt.c

Thanks for help
Zdenek


From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To:
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-02-22 21:02:32
Message-ID: 47BF3868.5070405@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Ups. Patch attached

Zdenek

Zdenek Kotala napsal(a):
> Tom Lane napsal(a):
>> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
>>> I attached patch which replaces any "--..." occurrence with "-c..."
>>> on command line.
>>
>> Please see whether forcibly using src/port/getopt.c fixes this,
>> instead. A saner patch would probably add something like this
>> to configure.in:
>>
>> if test "$PORTNAME" = "solaris"; then
>> AC_LIBOBJ(getopt)
>> AC_LIBOBJ(getopt_long)
>> fi
>
> Yeah, this is the best solution. I attach a patch. Is possible to
> backport it back to 8.3, 8.2?
>
> Just for completeness Solaris getopt function has a extension which
> processes long option argument. This extension is called CLIP. This
> implementation collides with unusual getopt usage for long option
> processing in PostgreSQL.
>
> More info are there:
> http://docs.sun.com/app/docs/doc/819-2243/getopt-3c?l=en&a=view
> http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/getopt.c
>
> http://docs.sun.com/app/docs/doc/819-2239/6n4hsf6e5?l=en&a=view
>
> By the way old solaris getopt version is similary with postgres
> implementation. :-)
>
> http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libbc/libc/gen/common/getopt.c
>
>
>
> Thanks for help
> Zdenek
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

Attachment Content-Type Size
getopt.patch text/x-patch 776 bytes

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: fix in --help output
Date: 2008-03-02 20:30:16
Message-ID: 200803022030.m22KUGY09336@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Zdenek Kotala wrote:
> Ups. Patch attached

Tom has applied this patch to CVS HEAD and all relevant back-branches.

---------------------------------------------------------------------------

>
> Zdenek
>
> Zdenek Kotala napsal(a):
> > Tom Lane napsal(a):
> >> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
> >>> I attached patch which replaces any "--..." occurrence with "-c..."
> >>> on command line.
> >>
> >> Please see whether forcibly using src/port/getopt.c fixes this,
> >> instead. A saner patch would probably add something like this
> >> to configure.in:
> >>
> >> if test "$PORTNAME" = "solaris"; then
> >> AC_LIBOBJ(getopt)
> >> AC_LIBOBJ(getopt_long)
> >> fi
> >
> > Yeah, this is the best solution. I attach a patch. Is possible to
> > backport it back to 8.3, 8.2?
> >
> > Just for completeness Solaris getopt function has a extension which
> > processes long option argument. This extension is called CLIP. This
> > implementation collides with unusual getopt usage for long option
> > processing in PostgreSQL.
> >
> > More info are there:
> > http://docs.sun.com/app/docs/doc/819-2243/getopt-3c?l=en&a=view
> > http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/getopt.c
> >
> > http://docs.sun.com/app/docs/doc/819-2239/6n4hsf6e5?l=en&a=view
> >
> > By the way old solaris getopt version is similary with postgres
> > implementation. :-)
> >
> > http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libbc/libc/gen/common/getopt.c
> >
> >
> >
> > Thanks for help
> > Zdenek
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: Don't 'kill -9' the postmaster
>

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +