Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f1NIRVx76389 for ; Fri, 23 Feb 2001 13:27:31 -0500 (EST) (envelope-from pgsql-interfaces-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1N21Wx47899 for ; Thu, 22 Feb 2001 21:01:32 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f1N1vlX28978 for pgsql-interfaces@postgresql.org; Thu, 22 Feb 2001 20:57:47 -0500 (EST) (envelope-from news) From: "Jeff" X-Newsgroups: comp.databases.postgresql.novice, comp.databases.postgresql.interfaces Subject: CGI Error Date: Thu, 22 Feb 2001 20:48:35 -0500 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 41 Message-ID: <974g2q$s9f$1@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 To: pgsql-interfaces@postgresql.org X-Archive-Number: 200102/171 X-Sequence-Number: 1129 I'm getting this when access the cgi: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: Here's the cgi code: int main() { printf("Content-Type: %s\n\n", contentType); conn = PQconnectdb("dbname=template1"); if (PQstatus(conn) == CONNECTION_BAD) { printf("Connection to database failed.\n"); printf("%s", PQerrorMessage(conn)); return(1); } strcpy(query_string, "SELECT * FROM cities"); res = PQexec(conn, query_string); if (PQresultStatus(res) != PGRES_TUPLES_OK) { printf("SELECT query failed.\n"); PQclear(res); PQfinish(conn); return(1); } for (i = 0; i < PQntuples(res); i++) printf("%s\n", PQgetvalue(res, i, 0)); PQclear(res); PQfinish(conn); return(0); }