Thread: Re: Compiling with libpq

Re: Compiling with libpq

From
"Dave Page"
Date:

> -----Original Message-----
> From: Johann Zuschlag [mailto:zuschlag2@online.de]
> Sent: 28 September 2005 11:25
> To: Dave Page
> Subject: Compiling with libpq
>
> Hi Dave,
>
> I'm just trying to compile the driver with VC6 since the
> latest version
> isn't available. Somehow I don't know what to do with
> libpq-fe.h. I just
> included it in the project. But the compiler can't find it.
> Unfortunatly
> I have only a very limited knowledge compiling C projects.

Hi Johann,

Please use the list - that way others can benefit as well.

If you install PostgreSQL 8.0.3 into the default location with all the
developer options selected you should get all headers and libraries
installed into the right place for the VC++ makefile to find them.

Alternatively, you can specify PG_INC and PG_LIB on the command line:

NMAKE /f win32.mak [CFG=[Release | Debug]]
                   [ENCODING=[ANSI | UNICODE]]
                   [PG_INC=<PG include folder> PG_LIB=<PG lib folder>]
                   [ALL | CLEAN]

Regards, Dave.

cursor control

From
Johann Zuschlag
Date:
Hi Dave,

I don't understand the following in qresult.c:

503:        /* Speed up access */
504:        int                     fetch_count = self->fetch_count;

And then:

515:        if (fetch_count < fetch_count)
516:        {
517:                /* return a row from cache */
518:                mylog("next_tuple: fetch_count < fcount:
          returning tuple %d, fcount = %d\n", fetch_count, num_backend_rows);
519:                self->tupleField = the_tuples + (fetch_count * self->num_fields);               /* next row */
520:                self->fetch_count++;
521:                return TRUE;
522:        }
523:        else if (self->num_backend_rows < self->cache_size)

Maybe I'm misled. But  I assume (fetch_count < fetch_count) will never
become true.

Regards
Johann