Обсуждение: initdb

Поиск
Список
Период
Сортировка

initdb

От
Andrew Dunstan
Дата:
I now have a C implementation of initdb, which successfully runs with
"make check" on my several linux machines, and compiles on Windows/MinGW
too (can't run make check on Windows because we haven't got a native
postgres yet - I'm going to create a small dummy Windows postgres that
will let me check if this program works there).

There's a little work still to go (see below), but I'd appreciate some
eyeballs on it to see if I have made any major booboos, or could have
done things better. What's the best way to proceed? (All told it's about
2500 lines of C.)

cheers

andrew

 From the heading comment:

/ *
 * initdb
 *
 * This is a C implementation of the previous shell script for setting up a
 * PostgreSQL cluster location, and should be highly compatible with it.
 *
 * TODO:
 *   - signal handling
 *   - more error checking, partiularly on the file i/o
 *   - check if we need workaround for timing error on win32 rmdir()?
 *   - clean up find_postgres code and return values
 *   - free up used memory? (probably not worth it - if we can't load this
 *     much data into memory how will we ever run postgres anyway?)
 */


Re: initdb

От
Tom Lane
Дата:
Andrew Dunstan <andrew@dunslane.net> writes:
> I now have a C implementation of initdb, ...
> There's a little work still to go (see below), but I'd appreciate some
> eyeballs on it to see if I have made any major booboos, or could have
> done things better. What's the best way to proceed?

Put it on a web page and post the link, or if you don't have a website,
send it to pgsql-patches (clearly marked as "not ready to apply").

            regards, tom lane

Re: [pgsql-hackers-win32] initdb

От
"Andrew Dunstan"
Дата:
Excellent idea.

Here's the URL: http://www.dunslane.net/~andrew/Initdb_In_C.html

cheers

andrew

----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>

> Andrew Dunstan <andrew@dunslane.net> writes:
> > I now have a C implementation of initdb, ...
> > There's a little work still to go (see below), but I'd appreciate some
> > eyeballs on it to see if I have made any major booboos, or could have
> > done things better. What's the best way to proceed?
>
> Put it on a web page and post the link, or if you don't have a website,
> send it to pgsql-patches (clearly marked as "not ready to apply").
>


Re: [pgsql-hackers-win32] initdb

От
Bruce Momjian
Дата:
I have added this URL to the Win32 page, and removed the "initdb C" TODO
item.  Great job.  Do you wantt this in Win32 CVS or should we just wait
for 7.5 to start?

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

Andrew Dunstan wrote:
>
> Excellent idea.
>
> Here's the URL: http://www.dunslane.net/~andrew/Initdb_In_C.html
>
> cheers
>
> andrew
>
> ----- Original Message -----
> From: "Tom Lane" <tgl@sss.pgh.pa.us>
>
> > Andrew Dunstan <andrew@dunslane.net> writes:
> > > I now have a C implementation of initdb, ...
> > > There's a little work still to go (see below), but I'd appreciate some
> > > eyeballs on it to see if I have made any major booboos, or could have
> > > done things better. What's the best way to proceed?
> >
> > Put it on a web page and post the link, or if you don't have a website,
> > send it to pgsql-patches (clearly marked as "not ready to apply").
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: [pgsql-hackers-win32] initdb

От
"Andrew Dunstan"
Дата:
There will be a new version out there soon. When I am happy with it I will
let you know - right now I am dealing with 2 issues - setlocale(LC_ALL,"")
doesn't read from the environment on Windows, and the program is possibly
not picking up the buffers/connections properly.

Please don't put the version currently out there in CVS - the files won't
even be the same - initdb-scripts.h will disappear and there will be a new
file called "system_views.sql".

There is no urgency about this - until we have a working postgres executable
on Windows initdb is useless anyway. My aim has been to have initdb ready
when postgres is ready. Of course, I test against Unix all the time to make
sure nothing gets broken.

cheers

andrew


----- Original Message -----
From: "Bruce Momjian" <pgman@candle.pha.pa.us>
To: "Andrew Dunstan" <andrew@dunslane.net>
Cc: "Postgresql Hackers" <pgsql-hackers@postgresql.org>;
"pgsql-hackers-win32" <pgsql-hackers-win32@postgresql.org>
Sent: Thursday, October 09, 2003 9:39 PM
Subject: Re: [pgsql-hackers-win32] [HACKERS] initdb


>
> I have added this URL to the Win32 page, and removed the "initdb C" TODO
> item.  Great job.  Do you wantt this in Win32 CVS or should we just wait
> for 7.5 to start?
>
> --------------------------------------------------------------------------
-
>
> Andrew Dunstan wrote:
> >
> > Excellent idea.
> >
> > Here's the URL: http://www.dunslane.net/~andrew/Initdb_In_C.html
> >
> > cheers
> >
> > andrew
> >
> > ----- Original Message -----
> > From: "Tom Lane" <tgl@sss.pgh.pa.us>
> >
> > > Andrew Dunstan <andrew@dunslane.net> writes:
> > > > I now have a C implementation of initdb, ...
> > > > There's a little work still to go (see below), but I'd appreciate
some
> > > > eyeballs on it to see if I have made any major booboos, or could
have
> > > > done things better. What's the best way to proceed?
> > >
> > > Put it on a web page and post the link, or if you don't have a
website,
> > > send it to pgsql-patches (clearly marked as "not ready to apply").
> > >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> >                http://archives.postgresql.org
> >
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania
19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings


Re: [pgsql-hackers-win32] initdb

От
Bruce Momjian
Дата:
Andrew Dunstan wrote:
> There will be a new version out there soon. When I am happy with it I will
> let you know - right now I am dealing with 2 issues - setlocale(LC_ALL,"")
> doesn't read from the environment on Windows, and the program is possibly
> not picking up the buffers/connections properly.
>
> Please don't put the version currently out there in CVS - the files won't
> even be the same - initdb-scripts.h will disappear and there will be a new
> file called "system_views.sql".
>
> There is no urgency about this - until we have a working postgres executable
> on Windows initdb is useless anyway. My aim has been to have initdb ready
> when postgres is ready. Of course, I test against Unix all the time to make
> sure nothing gets broken.

Fine.  We have the URL on the win32 web site, and that's all we need.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: [pgsql-hackers-win32] initdb

От
"Andrew Dunstan"
Дата:
There's a new version available at
http://www.dunslane.net/~andrew/Initdb_In_C.html - I think it takes care of
all of Peter's comments. I removed initdb-scripts.h - the smaller scripts
were moved into initdb.c with SQL comments turned into C comments, and the
large script to set up system views becomes its own file, which is now
passed to postgres with single line mode turned off.

I have just realised that I seem to have skipped the bki file version check.
I will fix that in the next version.

cheers

andrew


----- Original Message -----
From: "Bruce Momjian" <pgman@candle.pha.pa.us>
To: "Andrew Dunstan" <andrew@dunslane.net>
Cc: "Postgresql Hackers" <pgsql-hackers@postgresql.org>;
"pgsql-hackers-win32" <pgsql-hackers-win32@postgresql.org>
Sent: Thursday, October 09, 2003 10:07 PM
Subject: Re: [pgsql-hackers-win32] [HACKERS] initdb


> Andrew Dunstan wrote:
> > There will be a new version out there soon. When I am happy with it I
will
> > let you know - right now I am dealing with 2 issues -
setlocale(LC_ALL,"")
> > doesn't read from the environment on Windows, and the program is
possibly
> > not picking up the buffers/connections properly.
> >
> > Please don't put the version currently out there in CVS - the files
won't
> > even be the same - initdb-scripts.h will disappear and there will be a
new
> > file called "system_views.sql".
> >
> > There is no urgency about this - until we have a working postgres
executable
> > on Windows initdb is useless anyway. My aim has been to have initdb
ready
> > when postgres is ready. Of course, I test against Unix all the time to
make
> > sure nothing gets broken.
>
> Fine.  We have the URL on the win32 web site, and that's all we need.
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania
19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings


Re: [pgsql-hackers-win32] initdb

От
"Andrew Dunstan"
Дата:
Bruce,

I think this is now ready to import into the WIN32 branch. I have ironed out
the cygwin dependencies, and posted a note about what we'll need to do
inside postgres to handle the environment values for setlocale() on Windows.

If you want to rip out the unlink stuff (see previous email thread) we'll
need a version of dirmod.c that is compiled with -DFRONTEND - I guess libpq
is the obvious place for that.

Apart from initdb.c we'll need the file system_views.sql, which can be taken
without change (unless someone want to add comments to it), and Makefile
modifications (see my Makefile on the web for an example, but it probably
doesn't comply with our standard way of doing things).

Anything broken can then be fixed with patches - I have about 7 versions on
5 machines now and my head is starting to swim -).

pg_id and pg_encoding now become redundant in their entirety, as does
initdb.sh.

cheers

andrew


----- Original Message -----
From: "Bruce Momjian" <pgman@candle.pha.pa.us>
To: "Andrew Dunstan" <andrew@dunslane.net>
Cc: "Postgresql Hackers" <pgsql-hackers@postgresql.org>;
"pgsql-hackers-win32" <pgsql-hackers-win32@postgresql.org>
Sent: Thursday, October 09, 2003 10:07 PM
Subject: Re: [pgsql-hackers-win32] [HACKERS] initdb


> Andrew Dunstan wrote:
> > There will be a new version out there soon. When I am happy with it I
will
> > let you know - right now I am dealing with 2 issues -
setlocale(LC_ALL,"")
> > doesn't read from the environment on Windows, and the program is
possibly
> > not picking up the buffers/connections properly.
> >
> > Please don't put the version currently out there in CVS - the files
won't
> > even be the same - initdb-scripts.h will disappear and there will be a
new
> > file called "system_views.sql".
> >
> > There is no urgency about this - until we have a working postgres
executable
> > on Windows initdb is useless anyway. My aim has been to have initdb
ready
> > when postgres is ready. Of course, I test against Unix all the time to
make
> > sure nothing gets broken.
>
> Fine.  We have the URL on the win32 web site, and that's all we need.
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania
19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly