pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedcompiling C Funktion for PostgreSQL
3+ messages / 3 participants
[nested] [flat]
* compiling C Funktion for PostgreSQL
@ 2007-07-17 07:12 Jürgen Ulrich <juergen.ulrich@etourism-austria.at>
2007-07-17 12:20 ` Re: compiling C Funktion for PostgreSQL Marcin Giedz <giedz@arise.pl>
2007-07-17 14:43 ` Re: compiling C Funktion for PostgreSQL Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 3+ messages in thread
From: Jürgen Ulrich @ 2007-07-17 07:12 UTC (permalink / raw)
To: pgsql-admin
Hello,
I have a problem with the postgreSQL Source Code when I compile the
fuzzystrmatch.c. I want to try to replace all german umlauts for the soundex
algorithm. But when I want to compile the C Code, I get an error on the
following line in the fuzzystrmatch.c:
PG_MODULE_MAGIC;
And here is the error I get:
In function 'Pg_magic_func': 'PG_VERSION_NUM' undeclared (first use in
function)
The PG_VERSION_NUM is defined in the fmgr.h of the PostgreSQL Source Code:
/* Definition of the magic block structure */
typedef struct
{
int len; /* sizeof(this struct) */
int version; /* PostgreSQL major version */
int funcmaxargs; /* FUNC_MAX_ARGS */
int indexmaxkeys; /* INDEX_MAX_KEYS */
int namedatalen; /* NAMEDATALEN */
} Pg_magic_struct;
/* The actual data block contents */
#define PG_MODULE_MAGIC_DATA \
{
sizeof(Pg_magic_struct),
PG_VERSION_NUM / 100,
FUNC_MAX_ARGS,
INDEX_MAX_KEYS,
NAMEDATALEN
}
Can anyone help me to figure out this problem?
Thanks in advance
Jürgen Ulrich
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: compiling C Funktion for PostgreSQL
2007-07-17 07:12 compiling C Funktion for PostgreSQL Jürgen Ulrich <juergen.ulrich@etourism-austria.at>
@ 2007-07-17 12:20 ` Marcin Giedz <giedz@arise.pl>
1 sibling, 0 replies; 3+ messages in thread
From: Marcin Giedz @ 2007-07-17 12:20 UTC (permalink / raw)
To: Jürgen Ulrich <juergen.ulrich@etourism-austria.at>; +Cc: pgsql-admin
Jürgen Ulrich wrote:
>
> Hello,
>
Hi,
I hope this is what you're looking for:
add to your C code:
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif
Regards,
Marcin
>
> I have a problem with the postgreSQL Source Code when I compile the
> fuzzystrmatch.c. I want to try to replace all german umlauts for the
> soundex algorithm. But when I want to compile the C Code, I get an
> error on the following line in the fuzzystrmatch.c:
>
> PG_MODULE_MAGIC;
>
> And here is the error I get:
>
> |In function 'Pg_magic_func': 'PG_VERSION_NUM' undeclared (first use
> in function)|
>
> | |
>
> |The PG_VERSION_NUM is defined in the fmgr.h of the PostgreSQL Source
> Code:|
>
> | |
>
> |/* Definition of the magic block structure */ |
> |typedef struct |
> |{ |
> | int len; /* sizeof(this struct) */ |
> | int version; /* PostgreSQL major version */ |
> | int funcmaxargs; /* FUNC_MAX_ARGS */ |
> | int indexmaxkeys; /* INDEX_MAX_KEYS */ |
> | int namedatalen; /* NAMEDATALEN */ |
> |} Pg_magic_struct; |
>
>
> |/* The actual data block contents */ |
> |#define PG_MODULE_MAGIC_DATA \ |
> |{ |
> | sizeof(Pg_magic_struct), |
> | PG_VERSION_NUM / 100, |
> | FUNC_MAX_ARGS, |
> | INDEX_MAX_KEYS, |
> | NAMEDATALEN |
> |}|
>
> | |
>
> |Can anyone help me to figure out this problem?|
>
> | |
>
> |Thanks in advance|
>
> |Jürgen Ulrich|
>
--
ARISE M.Giedz, T.Żebruń sp.j.
http: www.arise.pl
mail: giedz@arise.pl
tel: +48 502 537 157
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: compiling C Funktion for PostgreSQL
2007-07-17 07:12 compiling C Funktion for PostgreSQL Jürgen Ulrich <juergen.ulrich@etourism-austria.at>
@ 2007-07-17 14:43 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2007-07-17 14:43 UTC (permalink / raw)
To: Jürgen Ulrich <juergen.ulrich@etourism-austria.at>; +Cc: pgsql-admin
=?iso-8859-1?Q?J=FCrgen_Ulrich?= <juergen.ulrich@etourism-austria.at> writes:
> In function 'Pg_magic_func': 'PG_VERSION_NUM' undeclared (first use in
> function)
Perhaps you forgot to include postgres.h? That should always be the
very first #include in any backend module.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2007-07-17 14:43 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-07-17 07:12 compiling C Funktion for PostgreSQL Jürgen Ulrich <juergen.ulrich@etourism-austria.at>
2007-07-17 12:20 ` Marcin Giedz <giedz@arise.pl>
2007-07-17 14:43 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox