Thread: Postgres problem

Postgres problem

From
"Prof. L M Patnaik"
Date:
Hello:

I am having problem interfacing the postgres database with the 
frontend(libpq),i.e using C.Database runs fine.
PROBLEMS ARE:           1)When compiling the C-program given in the             example for connecting the database to
the           frontend using      $gcc -I /home/guest/pgsql/include test.c       output:           /tmp/ccwWFbHo.o:In
function'exit_nicely':           /tmp/ccwWFbHo.o(.text+0x8):undefined referance to 'PQfinish'
/tmp/ccwWFbHo.o:Infunction 'main':           /tmp/ccwWFbHo.o(.text+0x66):undefined referance to
 
'PQsetdblogin'
/tmp/ccwWFbHo.o(.text+0x66):undefinedreferance to 'PQstatus'          
 

...............................................................                      2)When I want to use the command
         $createlang c (dbname)           OUTPUT:                  createlang:missing required argument PGLIB
directory.                                                     
 

...............................................................
                        I shall be grateful if you reply giving me suggestion to solve           the problems.
  Thanking you 
  With regards     Simanchal           
  c/o Prof L M Patnaik 




Re: Postgres problem

From
Ludek Finstrle
Date:
Prof. L M Patnaik napsal(a):
> 
> Hello:
> 
> I am having problem interfacing the postgres database with the 
> frontend(libpq),i.e using C.Database runs fine.
> 
>  PROBLEMS ARE:
>             1)When compiling the C-program given in the 
>              example for connecting the database to the
>              frontend using
>        $gcc -I /home/guest/pgsql/include test.c

Try something like this       $gcc -I /home/guest/pgsql/include -L /home/guest/pgsql/lib -lpq test.c

I think that postgres libraries are stored in /home/guest/pgsql/lib.

> ...............................................................
>             
>             2)When I want to use the command
>               $createlang c (dbname)
>             OUTPUT:
>                    createlang:missing required argument PGLIB directory.            

You don't have specified the path to PGLIB. createlang can't find them.
Try set environment variable PGLIB (e.g. in bash:
export PGLIB=/home/guest/pgsql/lib). Or append this path to environment
variable LD_LIBRARY_PATH.

Regards

Luf


Searchin libpq.dll & libpq++.dll

From
ROMAN Andres Carlos
Date:
   Hello,  List!
   Im looking for libpq.dll and libpq++.dll
   Can anyone help me where I found them?
   Very Thanks!



/* ----------------------------------------------------------------------- */                           Andres Carlos
Roman                          Centro de Telematica                     Universidad Nacional del Litoral
        Telefono: 0342-455.4245                           Fax: 0342-457.1240                            Cel:
155-009.757
/* ----------------------------------------------------------------------- */       Hay quienes intervienen para que
algopase;          Hay quienes observan lo que pasa;              y hay quienes ni se imaginan lo que esta pasando.
 
/* ----------------------------------------------------------------------- */





RE: Postgres problem

From
"Erny"
Date:
> Hello:
Hi,

>
> I am having problem interfacing the postgres database with the
> frontend(libpq),i.e using C.Database runs fine.
>
>  PROBLEMS ARE:
>             1)When compiling the C-program given in the
>              example for connecting the database to the
>              frontend using
>        $gcc -I /home/guest/pgsql/include test.c
>
>        output:
>             /tmp/ccwWFbHo.o:In function 'exit_nicely':
>             /tmp/ccwWFbHo.o(.text+0x8):undefined referance to 'PQfinish'
>
>             /tmp/ccwWFbHo.o:In function 'main':
>             /tmp/ccwWFbHo.o(.text+0x66):undefined referance to
> 'PQsetdblogin'
>
>             /tmp/ccwWFbHo.o(.text+0x66):undefined referance to 'PQstatus'

I had the same problem. You have to include -lq on the command line.
Futhermore, I had to put it on the end of the line, because the compiler
collects unknown symbols first and then resolves it with the -l library
switch. So I made a little Makefile like this one:

#Little Makefile for making whatever source file directly to an executable.
override CFLAGS += -I/usr/include/postgresql

% : %.c       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpq

% : %.c++       g++ $(CFLAGS) $(LDFLAGS) -o $@ $< -lpq++

#end

Erny





Re: Postgres problem

From
Ian Barwick
Date:
On Monday 19 May 2003 17:15, sanjivan wrote:
> Hi
>  I am trying to take a backup through phppgadmin. I have installed a
> postgres server 7.3. It gives me a pg_relcheck error. Can you suggest
> me..how to remove that error. is there any patch to install..or from where
> i get that. Please suggest me..
> Thanks in advance
> San

Err,
1: please post this kind of question to the appropriate list
(dbi-dev has _nothing_ to do with this);
2: please post to the list first, not to a semi-random group
of individuals as well; because
3: speaking for myself I have no working knowledge of phppgadmin.

Having said that it looks like some kind of version mismatch is taking place.
IIRC pg_relcheck does not exist in PostreSQL 7.3. google or a search
of the Postgres mailing list archives might help you further.

Please follow up to pgsql-interfaces only (try subscribing if you're not
already).

Ian Barwick
barwick@gmx.net