PgSQL 8.0.0 - contributed: problem compiling - Mailing list pgsql-general

From Nikola Milutinovic
Subject PgSQL 8.0.0 - contributed: problem compiling
Date
Msg-id 411F26FB.2050604@ev.co.yu
Whole thread Raw
Responses Re: PgSQL 8.0.0 - contributed: problem compiling
Re: PgSQL 8.0.0 - contributed: problem compiling
List 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.

pgsql-general by date:

Previous
From: Paramveer.Singh@trilogy.com
Date:
Subject: exception handling support in pgSQL
Next
From: Joe Conway
Date:
Subject: Re: PgSQL 8.0.0 - contributed: problem compiling