PgSQL 8.0.0 - contributed: problem compiling

From: Nikola Milutinovic <Nikola(dot)Milutinovic(at)ev(dot)co(dot)yu>
To: pgsql-general(at)postgresql(dot)org
Subject: PgSQL 8.0.0 - contributed: problem compiling
Date: 2004-08-15 09:03:55
Message-ID: 411F26FB.2050604@ev.co.yu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all.

I've managed to get 8.0.0 up and running. Now I'm compiling some
contributed software and I hit a show stopper. Contrib - DBSize

Papa-Legba:/home/r/root/5.1/postgresql-8.0.0beta1/contrib/dbsize# gmake
; gmake install
sed 's,MODULE_PATHNAME,$libdir/dbsize,g' dbsize.sql.in >dbsize.sql
cc -std -ieee -pthread -O3 -c99 -I. -I../../src/include -pthread -c
-o dbsize.o dbsize.c
cc: Error: dbsize.c, line 58: In this statement, "GetDatabasePath"
expects 2 arguments, but 1 are supplied. (toofewargs)
dbpath = GetDatabasePath(dbid);
-----------------^
gmake: *** [dbsize.o] Error 1
cc -std -ieee -pthread -O3 -c99 -I. -I../../src/include -pthread -c
-o dbsize.o dbsize.c
cc: Error: dbsize.c, line 58: In this statement, "GetDatabasePath"
expects 2 arguments, but 1 are supplied. (toofewargs)
dbpath = GetDatabasePath(dbid);
-----------------^
gmake: *** [dbsize.o] Error 1

Inspecting the "./src/include/catalog/catalog.h" I can see that it takes
two arguments:

extern char *GetDatabasePath(Oid dbNode, Oid spcNode);

The problematic code segment is:

Datum database_size(PG_FUNCTION_ARGS)
{
Name dbname = PG_GETARG_NAME(0);

Oid dbid;
char *dbpath;
DIR *dirdesc;
struct dirent *direntry;
int64 totalsize;

dbid = get_database_oid(NameStr(*dbname));
if (!OidIsValid(dbid))
ereport(ERROR, (errcode(ERRCODE_UNDEFINED_DATABASE),
errmsg("database \"%s\" does not exist",
NameStr(*dbname))));

dbpath = GetDatabasePath(dbid);

What should be the change in this code segment? "libPQ" docs are not
informative...

Nix.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2004-08-15 10:08:45 Re: PgSQL 8.0.0 - contributed: problem compiling
Previous Message Joe Conway 2004-08-15 05:58:52 Re: [ADMIN] SRPM for 8.0.0 beta?