comparison src/postgresql.c @ 408:501cfd01ee6d r21-2-34

Import from CVS: tag r21-2-34
author cvs
date Mon, 13 Aug 2007 11:18:11 +0200
parents b8cc9ab3f761
children de805c49cfc1
comparison
equal deleted inserted replaced
407:ed6218a7d4d3 408:501cfd01ee6d
538 Poll an asynchronous connection for completion 538 Poll an asynchronous connection for completion
539 */ 539 */
540 (conn)) 540 (conn))
541 { 541 {
542 PGconn *P; 542 PGconn *P;
543 PostgresPollingStatusType PS; 543 PostgresPollingStatusType polling_status;
544 544
545 CHECK_PGCONN (conn); 545 CHECK_PGCONN (conn);
546 546
547 P = (XPGCONN (conn))->pgconn; 547 P = (XPGCONN (conn))->pgconn;
548 CHECK_LIVE_CONNECTION (P); 548 CHECK_LIVE_CONNECTION (P);
549 549
550 PS = PQconnectPoll (P); 550 polling_status = PQconnectPoll (P);
551 switch (PS) 551 switch (polling_status)
552 { 552 {
553 case PGRES_POLLING_FAILED: 553 case PGRES_POLLING_FAILED:
554 /* Something Bad has happened */ 554 /* Something Bad has happened */
555 { 555 {
556 char *e = PQerrorMessage (P); 556 char *e = PQerrorMessage (P);
564 return Qpgres_polling_writing; 564 return Qpgres_polling_writing;
565 case PGRES_POLLING_ACTIVE: 565 case PGRES_POLLING_ACTIVE:
566 return Qpgres_polling_active; 566 return Qpgres_polling_active;
567 default: 567 default:
568 /* they've added a new field we don't know about */ 568 /* they've added a new field we don't know about */
569 error ("Help! Unknown status code %08x from backend!", PS); 569 error ("Help! Unknown status code %08x from backend!", polling_status);
570 } 570 }
571 } 571 }
572 572
573 #ifdef MULE 573 #ifdef MULE
574 DEFUN ("pq-client-encoding", Fpq_client_encoding, 1, 1, 0, /* 574 DEFUN ("pq-client-encoding", Fpq_client_encoding, 1, 1, 0, /*
728 Poll an asynchronous reset for completion 728 Poll an asynchronous reset for completion
729 */ 729 */
730 (conn)) 730 (conn))
731 { 731 {
732 PGconn *P; 732 PGconn *P;
733 PostgresPollingStatusType PS; 733 PostgresPollingStatusType polling_status;
734 734
735 CHECK_PGCONN (conn); 735 CHECK_PGCONN (conn);
736 736
737 P = (XPGCONN (conn))->pgconn; 737 P = (XPGCONN (conn))->pgconn;
738 CHECK_LIVE_CONNECTION (P); 738 CHECK_LIVE_CONNECTION (P);
739 739
740 PS = PQresetPoll (P); 740 polling_status = PQresetPoll (P);
741 switch (PS) 741 switch (polling_status)
742 { 742 {
743 case PGRES_POLLING_FAILED: 743 case PGRES_POLLING_FAILED:
744 /* Something Bad has happened */ 744 /* Something Bad has happened */
745 { 745 {
746 char *e = PQerrorMessage (P); 746 char *e = PQerrorMessage (P);
754 return Qpgres_polling_writing; 754 return Qpgres_polling_writing;
755 case PGRES_POLLING_ACTIVE: 755 case PGRES_POLLING_ACTIVE:
756 return Qpgres_polling_active; 756 return Qpgres_polling_active;
757 default: 757 default:
758 /* they've added a new field we don't know about */ 758 /* they've added a new field we don't know about */
759 error ("Help! Unknown status code %08x from backend!", PS); 759 error ("Help! Unknown status code %08x from backend!", polling_status);
760 } 760 }
761 } 761 }
762 #endif 762 #endif
763 763
764 DEFUN ("pq-request-cancel", Fpq_request_cancel, 1, 1, 0, /* 764 DEFUN ("pq-request-cancel", Fpq_request_cancel, 1, 1, 0, /*