PgSQL 8.0.0 - contributed: problem compiling

Started by Nikola Milutinovicover 21 years ago3 messagesgeneral
Jump to latest
#1Nikola Milutinovic
Nikola.Milutinovic@ev.co.yu

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.

#2Joe Conway
mail@joeconway.com
In reply to: Nikola Milutinovic (#1)
Re: PgSQL 8.0.0 - contributed: problem compiling

Nikola Milutinovic wrote:

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

I believe this has been fixed in current cvs (works for me now). You can
try checking out cvs HEAD, wait for beta2, or apply the diff to your
local copy of beta1:
http://developer.postgresql.org/cvsweb.cgi/pgsql-server/contrib/dbsize/dbsize.c.diff?r1=1.10;r2=1.11

HTH,

Joe

#3Richard Poole
rp@guests.deus.net
In reply to: Nikola Milutinovic (#1)
Re: PgSQL 8.0.0 - contributed: problem compiling

On Sun, Aug 15, 2004 at 11:03:55AM +0200, Nikola Milutinovic wrote:

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

This has been fixed in an update committed since the beta was wrapped:
http://archives.postgresql.org/pgsql-committers/2004-08/msg00203.php

Richard