Hello, I have this query in my .c program: if (PQsendQuery(srcmain, "select userid,uid,clear_passwd,www_home,date_part('epoch',dt_block),date_part('epoch',dt_cancel) from www where uid=parent_uid and dt_modify > dt_export")) { while ((srcmres = PQgetResult(srcmain)) != NULL) { well as doc says, "Each non-null result from PQgetResult should be processed using the same PGresult accessor functions previously described." do i understand it correctly? /* process each returned line */ if ((srcmstat = PQresultStatus(srcmres)) != PGRES_TUPLES_OK) fprintf(stderr, "error getting result: %s\n", PQresultErrorMessage(srcmres)); else { if ((srcmtup = PQntuples(srcmres)) == 6) { I just would like to know, if, in case of problem couldn't just return NULL and fill out error message; could I just process the result and if there's no data (or an error), NULL would be returned and PQresStatus could be called to see if any problem occured. Anyway, even if I get resule with 0 tuples, I need to check PQntuples and it returns 0. i think checking PQntuples in big loop is quite unefficient. could anybody comment this? Thanks. -- Matus "fantomas" Uhlar, sysadmin at NEXTRA, Slovakia; IRCNET admin of *.sk [EMAIL PROTECTED] ; http://www.fantomas.sk/ ; http://www.nextra.sk/ WinError #99999: Out of error messages. ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly