| 573 | } |
| 574 | |
| 575 | bool db_pgsql::tbl_exists(const char* tbl_name) |
| 576 | { |
| 577 | free_result(); |
| 578 | |
| 579 | db_rows rows; |
| 580 | string sql; |
| 581 | sql.format("select * from %s limit 1", tbl_name); |
| 582 | |
| 583 | PGresult* res = (PGresult *) sane_pgsql_query(sql); |
| 584 | if (res == NULL) { |
| 585 | return false; |
| 586 | } |
| 587 | |
| 588 | if (__dbresult_status(res) != PGRES_TUPLES_OK) { |
| 589 | __dbclear(res); |
| 590 | return false; |
| 591 | } |
| 592 | |
| 593 | __dbclear(res); |
| 594 | return true; |
| 595 | } |
| 596 | |
| 597 | bool db_pgsql::sql_select(const char* sql, db_rows* result /* = NULL */) |
| 598 | { |
no test coverage detected