Re: initdb.sh fixed

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: initdb.sh fixed
Date: 1999-12-18 16:13:33
Message-ID: Pine.LNX.4.21.9912181430440.356-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

People, I thought you would at least test this once before applying it. I
explicitly (maybe not explicitly enough) mentioned it, because writing
complex shell scripts is a nut job. Maybe this thing should really be
written in C. Then there will be no EUID, no echo, no function, no grep,
no whoami, or other problems. Perhaps the whole genbki.sh thing could be
scrapped then, with initdb interpreting the DATA() macros itself. It
would even reduce the overhead of calling postgres about 12 times and
could get it down to 2 or 3. A project for 7.1?

On 1999-12-17, Bruce Momjian mentioned:

> OK, initdb should now work. There were a variety of non-portable things
> in initdb.sh, like assuming $EUID is defined, and other shell script and
> command args that do not exist on BSDI.

Hmm, that $EUID seems to have be the root of all trouble because then the
'insert ( data data data )' bootstrap commands are containing gaps. On the
other hand, this was one of the key things that were supposed to be
improved because relying on $USER was not su-safe. Maybe $UID would work,
since initdb isn't supposed to be setuid anyway.

> I think I got them all. If anyone sees problems, let me know. This is
> not really Peter's fault. It takes a long time to know what is
> portable and what is not portable.

The more time I spend with this the more I think that the only thing
that's portable is echo. Oh wait, that's not portable either. :)

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-12-18 17:20:50 Re: [HACKERS] SPI header dependencies
Previous Message Peter Eisentraut 1999-12-18 16:13:28 pgindent (Re: [HACKERS] LONG varsize - how to go on)