
I had occasion (and a perfectly good reason) to install 7.1.3 on 
a fresh server [1]. Installation succeeded as normal, data failed
to load because some relation names go beyond
31 characters. <smack forehead>, alter NAMEDATALEN,
recompile. initdb fails immediately after the message
"creating template1 database in...". There followed much
wrinkling of brows, gnashing of directories, recompilation from afresh
etcera, during the course of which I noticed the following output from
configure:

 configure: warning:
*** Without Bison you will not be able to build PostgreSQL from CVS or       
*** change any of the parser definition files.  You can obtain Bison from
*** a GNU mirror site.  (If you are using the official distribution of       
*** PostgreSQL then you do not need to worry about this because the Bison
*** output is pre-generated.)  To use a different yacc program (possible,      
*** but not recommended), set the environment variable YACC before running
*** 'configure'.  

This being because I had omitted to install Bison. As I wasn't building from
CVS, and mucking around with the parser definition files was not high on
my list of priorities, it was only much later I hit on the idea of installing
Bison, then rebuilding with higher NAMEDATALEN. And as if by magic
initdb succeeded. (Note: initdb with no Bison but unchanged NAMEDATALEN
also succeeded).

For reference, 7.2.1 exhibits exactly the same behaviour [2]. I have poked
around but have no idea what I'm looking for, so I'm not sure if this
is intended behaviour.

Questions:
- Does src/include/postgres_ext.h count as a parser definition file?
- If not shouldn't the above warning include something like "And
  don't even think about changing NAMEDATALEN"?

Apologies if I've missed something obvious.


Ian Barwick
barwick@gmx.net


[1] FreeBSD 4.6, installing from source
[2] Sample output from initdb:

ian > /home/ian/devel/postgres/pg721a/bin/initdb -D /tmp/pg721
The files belonging to this database system will be owned by user "ian".
This user must also own the server process.

creating directory /tmp/pg721... ok
creating directory /tmp/pg721/base... ok
creating directory /tmp/pg721/global... ok
creating directory /tmp/pg721/pg_xlog... ok
creating directory /tmp/pg721/pg_clog... ok
creating template1 database in /tmp/pg721/base/1... 
initdb failed.
Removing /tmp/pg721.



Tue, 30 Jul 2002 00:11:47 +0200
Ian Barwick <barwick@gmx.net>
No bison and NAMEDATALEN > 31: initdb failure?
Ian Barwick <barwick@gmx.net> writes:
> - Does src/include/postgres_ext.h count as a parser definition file?

No, it doesn't.  Your experience sounds like you may have neglected to
do a full rebuild after altering NAMEDATALEN.  (By default, we don't
compute object-file dependencies, so it's up to you to do "make clean"
after changing fundamental parameters.)  It's unlikely that installing
Bison per se affected anything --- unless possibly you had corrupted
copies of gram.c etc.

			regards, tom lane

Mon, 29 Jul 2002 18:23:28 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: No bison and NAMEDATALEN > 31: initdb failure? 
On Tuesday 30 July 2002 00:23, Tom Lane wrote:
> Ian Barwick <barwick@gmx.net> writes:
> > - Does src/include/postgres_ext.h count as a parser definition file?
>
> No, it doesn't.  Your experience sounds like you may have neglected to
> do a full rebuild after altering NAMEDATALEN.  (By default, we don't
> compute object-file dependencies, so it's up to you to do "make clean"
> after changing fundamental parameters.)  

Exactly what I thought. I actually deleted the source tree and unpacked
at a different location, several times. It was only after installing initdb 
Bison that initdb suddenly worked...

> It's unlikely that installing
> Bison per se affected anything --- unless possibly you had corrupted
> copies of gram.c etc.

... tried the same with a fresh source download on a Linux machine
and got similar results.

Clearly something odd is happening, but I assume it's a local problem. As
it's not the most important issue right now, will see if I can make any sense 
(and report back should I find anything of interest).

Thanks,


Ian Barwick
barwick@gmx.net

PS The subject should have read "(...) NAMEDATELEN > 32 (...)", i.e. the
default value.


Wed, 31 Jul 2002 23:34:40 +0200
Ian Barwick <barwick@gmx.net>
Re: No bison and NAMEDATALEN > 31: initdb failure?