Hi, I have just subscribed to the hackers mailinglist to telll what my  
adventures are with 7.4.b2 and OS X so far.

I have encountered some problems, and have some solutions, off which I  
do not know if they break the port, or do something wrong.

gcc3.3
=====
First, gcc3.3 on 10.2.x and 10.3.x  does nog get postgresql compiled.  
It seems to have to do with #ifdef indentation in the include files. I  
found some other references to it. I could work around some of the  
problems by removing spaces all "# ifdef" and "#  ifdef" and related  
commands in the include files, but in the end compilations failed on  
bootstrap.c, with an error message about y.tab.c. It seems Apple has  
some more work to do on gcc3.3.

I decided to try another compiler with the command gcc_select 3.1  
(which chooses the gcc 3.1 compiler).

That did a lot better. The beta compiled and installed.

initdb
====
I did however, encounter a problem with the supplied initdb. It seems  
that the test of the of shared memory segment is not used in the rest  
of the scripts: (log follows).

======================================================================== 
================================
bash-2.05a$ /usr/local/bin/initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user  
"postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.

fixing permissions on existing directory /usr/local/pgsql/data... ok
creating directory /usr/local/pgsql/data/base... ok
creating directory /usr/local/pgsql/data/global... ok
creating directory /usr/local/pgsql/data/pg_xlog... ok
creating directory /usr/local/pgsql/data/pg_clog... ok
selecting default shared_buffers... 400
selecting default max_connections... 20
creating configuration files... ok
creating template1 database in /usr/local/pgsql/data/base/1... FATAL:   
could not create shared memory segment: Invalid argument
DETAIL:  Failed syscall was shmget(key=1, size=10444800, 03600).
HINT:  This error usually means that PostgreSQL's request for a shared  
memory segment exceeded your kernel's SHMMAX parameter.  You can either  
reduce the request size or reconfigure the kernel with larger SHMMAX.  
To reduce the request size (currently 10444800 bytes), reduce  
PostgreSQL's shared_buffers parameter (currently 1000) and/or its  
max_connections parameter (currently 100).
If the request size is already small, it's possible that it is less  
than your kernel's SHMMIN parameter, in which case raising the request  
size or reconfiguring SHMMIN is called for.
The PostgreSQL documentation contains more information about shared  
memory configuration.

initdb: failed


====================================================================




I could work around it by adding the arguments that were found by the  
test to the PGSQL_OPTS.

*** /usr/local/bin/initdb       Mon Sep  1 21:59:17 2003
--- /usr/local/bin/initdb.org   Mon Sep  1 16:50:05 2003
***************
*** 598,604 ****
         "$PGDATA"/postgresql.conf

   echo "ok"
- PGSQL_OPT="$PGSQL_OPT -c shared_buffers=$nbuffers -c  
max_connections=$nconns"

    
######################################################################## 
##
   #
--- 598,603 ----

With this patch I got the thing working.


test database with array.
===================

Finally, I reloaded the 7.3 dumped database. All loaded until the test  
database.

This is the log:

=============================
You are now connected to database "test".
SET
SET
psql:/Users/Shared/testsql.txt:24: ERROR:  syntax error at or near  
"array" at character 152
psql:/Users/Shared/testsql.txt:32: ERROR:  syntax error at or near  
"array" at character 40
psql:/Users/Shared/testsql.txt:33: invalid command \N
psql:/Users/Shared/testsql.txt:33: invalid command \N
psql:/Users/Shared/testsql.txt:34: invalid command \.
psql:/Users/Shared/testsql.txt:35: ERROR:  syntax error at or near "1"  
at character 1
=================================

The part of the reload that caused this mayhem was:


=================================
\connect test
--
-- PostgreSQL database dump
--

SET SESSION AUTHORIZATION 'johan';

SET search_path = public, pg_catalog;

--
-- TOC entry 2 (OID 28932)
-- Name: test; Type: TABLE; Schema: public; Owner: johan
--

CREATE TABLE test (
     id integer,
     name text,
     val text,
     score double precision,
     date timestamp without time zone DEFAULT 'now()',
     array text[]
);


--
-- Data for TOC entry 3 (OID 28932)
-- Name: test; Type: TABLE DATA; Schema: public; Owner: johan
--

COPY test (id, name, val, score, date, array) FROM stdin;
1       foo     horse   \N      2003-07-01 23:01:48.239622      \N
\.
========================================


hope this helps.



-johan

Johan Henselmans


Mon, 1 Sep 2003 22:14:29 +0200
Johan Henselmans <johan@netsense.nl>
7.4beta2 experiences working on OS X 10.[2-3].x
Johan Henselmans <johan@netsense.nl> writes:
> [ odd problems with gcc 3.3 ]

That seems strange.  We've not heard other reports of trouble with
gcc 3.3.

> I did however, encounter a problem with the supplied initdb. It seems  
> that the test of the of shared memory segment is not used in the rest  
> of the scripts: (log follows).

This is my error :-(.  It'll be fixed for beta3.

> Finally, I reloaded the 7.3 dumped database. All loaded until the test  
> database.

ARRAY is a reserved word now.  Sorry about that ...

			regards, tom lane

Mon, 01 Sep 2003 16:47:06 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: 7.4beta2 experiences working on OS X 10.[2-3].x 
Johan Henselmans wrote:
> Hi, I have just subscribed to the hackers mailinglist to telll what my  
> adventures are with 7.4.b2 and OS X so far.
> 
> I have encountered some problems, and have some solutions, off which I  
> do not know if they break the port, or do something wrong.
> 
> gcc3.3
> =====
> First, gcc3.3 on 10.2.x and 10.3.x  does nog get postgresql compiled.  
> It seems to have to do with #ifdef indentation in the include files. I  
> found some other references to it. I could work around some of the  
> problems by removing spaces all "# ifdef" and "#  ifdef" and related  
> commands in the include files, but in the end compilations failed on  
> bootstrap.c, with an error message about y.tab.c. It seems Apple has  
> some more work to do on gcc3.3.
> 
> I decided to try another compiler with the command gcc_select 3.1  
> (which chooses the gcc 3.1 compiler).
> 
> That did a lot better. The beta compiled and installed.

Yes, I saw that in Atlanta.  gcc 3.3 is broken when you one of the
compiler flags that OS X defines during PostgreSQL compiles.

-- 
  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

Mon, 1 Sep 2003 23:14:43 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: 7.4beta2 experiences working on OS X 10.[2-3].x