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

Re: SOS, help me please, one problem towards the postgresql developement on windows

From: "FAST PostgreSQL" <fastpgs(at)fast(dot)fujitsu(dot)com(dot)au>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SOS, help me please, one problem towards the postgresql developement on windows
Date: 2007-04-30 05:10:50
Message-ID: 46357A5A.90609@fast.fujitsu.com.au (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
I assume you are trying to create a built-in function, right?

If thats the case you may want to create an entry in pg_proc (That seems
to be missing). Search for box_add in the source code and you will get
an idea what code needs to be added where.

Rgds,
Arul Shaji


shieldy wrote:
>     my postgresql source code is at c:/mingw/postgresql and instal to
>     C:/msys/1.0/local/pgsql/
>     I add a function to src\backend\utils\adt\geo_ops.c as the following:
>     /Datum
>     box_add2(PG_FUNCTION_ARGS)
>     {
>      BOX     *box = PG_GETARG_BOX_P(0);
>      Point    *p = PG_GETARG_POINT_P(1);/
> 
>     / PG_RETURN_BOX_P(box_construct((box->high.x + 2* p->x),
>               (box->low.x + 2* p->x),
>               (box->high.y +2* p->y),
>               (box->low.y + 2* p->y)));
>     }
>     /there is another similar one(this is the original one):
>     /Datum
>     box_add(PG_FUNCTION_ARGS)
>     {
>      BOX     *box = PG_GETARG_BOX_P(0);
>      Point    *p = PG_GETARG_POINT_P(1);/
> 
>     / PG_RETURN_BOX_P(box_construct((box->high.x + p->x),
>               (box->low.x + p->x),
>               (box->high.y + p->y),
>               (box->low.y + p->y)));
>     }/
>     And i also add the declaration to the src\include\utils\geo_decls.h
>     like this:
> 
>     extern Datum box_add2(PG_FUNCTION_ARGS);
> 
>     and then I did the following like step by step:
> 
> 
>     $ cd /c/mingw/postgresql
>     $ ./configure
>     ....
>     ///as i download the alib, but don't kown where it should be put. so
>     i ignore this, does it
> 
>     matter????
>     configure: error: zlib library not found
>     If you have zlib already installed, see config.log for details on the
>     failure.  It is possible the compiler isn't looking in the proper
>     directory.
>     Use --without-zlib to disable zlib support.
>     $ make
>     ...
>     All of PostgreSQL successfully made. Ready to install.
>     $ make install
>     ....
>     PostgreSQL installation complete.
>     $ initdb -D /usr/local/pgsql/data           //before this i add the
>     environments
> 
>     variableslike this:
>     PGDATA=C:/msys/1.0/local/pgsql/data
>     PGHOME=C:/msys/1.0/local/pgsql
>     PGHOST=localhost
>     PGPORT=5434
>     PATH= C:/msys/1.0/local/pgsql/bin
>     .....
>     Success. You can now start the database server using:
> 
>         "C:\msys\1.0\local\pgsql\bin\postgres" -D
>     "C:/msys/1.0/local/pgsql/data"
>     or
>         "C:\msys\1.0\local\pgsql\bin\pg_ctl" -D
>     "C:/msys/1.0/local/pgsql/data" -l logfile start
> 
>     $ pg_ctl start -l logfile
>     server starting
> 
>     $ createdb testdb
>     CREATE DATABASE
> 
>     then I use pgadminIII to open the database:
>     just run the scripts:
>     /select box_add(box '((0,0),(1,1))',point'(2,2)')/
>     got:
>     (3,3),(2,2)
> 
>     /select box_add2(box '((0,0),(1,1))',point'(2,2)')/
>     got:
>     *ERROR: function box_add2(box, point) does not exist
>     SQL state: 42883
>     advice:No function matches the given name and argument types. You
>     may need to add explicit **type casts.
>     chars:8*
> 
>     anyone know this??? why this happened? what should I do?
>     thankyou very much!!!
> 
>      
> 
> 


In response to

pgsql-hackers by date

Next:From: Stefan KaltenbrunnerDate: 2007-04-30 06:01:04
Subject: Re: Feature freeze progress report
Previous:From: Tom LaneDate: 2007-04-30 04:31:06
Subject: Re: Feature freeze progress report

pgsql-general by date

Next:From: psql psqlDate: 2007-04-30 08:50:56
Subject: Stemming not working with tsearch2() function
Previous:From: Brent WoodDate: 2007-04-30 00:57:14
Subject: Re: Temporal Units

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group