libpq - Mailing list pgsql-general

From Jim Michaels
Subject libpq
Date
Msg-id 600580.58191.qm@web34304.mail.mud.yahoo.com
Whole thread Raw
Responses Re: libpq
List pgsql-general
I am trying to compile a program with libpq using boirland c++ 5.5.1 free edition and with mingw(gcc), and SELECT queries are returning PQntuples with results of 0, but I can do the same query in pgadmin and get 1 result.



there is no way to link on the .lib files because they are in COFF format.  what compiler did they use to make these libs?  could somebody please make libs and separate DLLs (that is important - they are different inside) available for the mingw compiler?  It is a free compiler available at mingw.org.

the borland c++ 5.5.1 (free)-compiled program does absolutely nothing, I think because the DLL's are not compatible.

                    sprintf(querystr,
                    "SELECT * FROM s_phonelist.phonelist\n"
                    "WHERE %s\n"
                    "ORDER BY lastname,firstname,middlename,country,stateprovince,city,mailstop,company"
                    , s
                    );
#if defined(_DEBUG)
                    printf("QUERY:\"%s\"\n", querystr);
#endif
                    pgr = (PQexec)(pgc,querystr);


                    if (0 == ntuples) {
                        printf("--no records.--\n");
                        (PQfinish)(pgc);
                        return 0;
                    } else {

                        for (index=0; index < ntuples; index++) {
                            //copy values from row to Crecord row
                            val = (PQgetvalue)(pgr,index, 0);strcpy(row.firstname    , val);
                            val = (PQgetvalue)(pgr,index, 1);strcpy(row.middlename   , val);
                            val = (PQgetvalue)(pgr,index, 2);strcpy(row.lastname     , val);
                            val = (PQgetvalue)(pgr,index, 3);strcpy(row.homephone    , val);
                            val = (PQgetvalue)(pgr,index, 4);strcpy(row.workphone    , val);
                            val = (PQgetvalue)(pgr,index, 5);strcpy(row.cellphone    , val);
                            val = (PQgetvalue)(pgr,index, 6);strcpy(row.pager        , val);
                            val = (PQgetvalue)(pgr,index, 7);strcpy(row.company      , val);
                            val = (PQgetvalue)(pgr,index, 8);strcpy(row.address1     , val);
                            val = (PQgetvalue)(pgr,index, 9);strcpy(row.address2     , val);
                            val = (PQgetvalue)(pgr,index,10);strcpy(row.city         , val);
                            val = (PQgetvalue)(pgr,index,11);strcpy(row.mailstop     , val);
                            val = (PQgetvalue)(pgr,index,12);strcpy(row.stateprovince, val);
                            val = (PQgetvalue)(pgr,index,13);strcpy(row.postalcode   , val);
                            val = (PQgetvalue)(pgr,index,14);strcpy(row.country      , val);
                            val = (PQgetvalue)(pgr,index,15);strcpy(row.comment      , val);
                            val = (PQgetvalue)(pgr,index,16);strcpy(row.website      , val);
                            val = (PQgetvalue)(pgr,index,17);strcpy(row.emailhome    , val);
                            val = (PQgetvalue)(pgr,index,18);strcpy(row.emailwork    , val);
                            //now display in an orderly fashion.
                            showrecord(row);
                        }
                    }






while (stone != rolling) moss++;
---
Computer memory/disk size measurements:
[KB KiB] [MB MiB] [GB GiB] [TB TiB]
[10^3B=1000B=1KB][10^6B=1000000B=1MB][10^9B=1000000000B=1GB][10^12B=1000000000000B=1TB]
[2^10B=1024B=1KiB][2^20B=1048576B=1MiB][2^30B=1073741824B=1GiB][2^40B=1099511627776B=1TiB]
Note that with disks, a disk size is measured in GB or TB, not in GiB or TiB.  computer memory (RAM) is measured in MiB and GiB.
---
new cyber dog food: Cables n' Bits
---




pgsql-general by date:

Previous
From: Wenjian Yang
Date:
Subject: Re: psql and Emacs on Windows
Next
From: David
Date:
Subject: Re: Arrays and LIKE