Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: bug in PG_VERSION_NUM patch


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
  • Cc: pgsql-hackers(at)postgreSQL(dot)org
  • Subject: Re: bug in PG_VERSION_NUM patch
  • Date: Tue, 28 Feb 2006 17:29:08 -0500
  • Message-id: <2385(dot)1141165748(at)sss(dot)pgh(dot)pa(dot)us>

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> OK, I reread the manual page:

>        As  each input record is read, gawk splits the record into
>        fields, using the value of the FS variable  as  the  field
>        separator.   If FS is a single character, fields are sepa-
>        rated by that character.  If FS is the null  string,  then
>        each  individual character becomes a separate field.  Oth-
>        erwise, FS is expected to be a  full  regular  expression.

Hpmh.  The HPUX man page for plain awk says

          -F fs          Specify regular expression used to separate
                         fields.  The default is to recognize space and tab
                         characters, and to discard leading spaces and
                         tabs.  If the -F option is used, leading input
                         field separators are no longer discarded.

which makes me think we are treading on mighty thin ice here --- there
are lots of different versions of awk around, and some of them are
probably going to treat -F '.' as a regexp.

I'd suggest splitting the input with something more standardized.
Perhaps

sed 's/\./ /g' | $AWK '{printf ...

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group