Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: OpenGIS Simple Features Reference Implementation 4 : * Purpose: Private utilities for OGR/PostgreSQL driver. 5 : * Author: Mateusz Loskot, mateusz@loskot.net 6 : * 7 : ****************************************************************************** 8 : * Copyright (c) 2007, Mateusz Loskot 9 : * 10 : * SPDX-License-Identifier: MIT 11 : ****************************************************************************/ 12 : 13 : #ifndef OGRPGUTILITY_H_INCLUDED 14 : #define OGRPGUTILITY_H_INCLUDED 15 : 16 : #include "libpq-fe.h" 17 : 18 : PGresult *OGRPG_PQexec(PGconn *conn, const char *query, 19 : int bMultipleCommandAllowed = FALSE, 20 : int bErrorAsDebug = FALSE); 21 : 22 : /************************************************************************/ 23 : /* OGRPGClearResult */ 24 : /* */ 25 : /* Safe wrapper for PQclear() function. */ 26 : /* Releases given result and resets handle to NULL. */ 27 : /* Parameter hResult is input/output - a reference to pointer */ 28 : /************************************************************************/ 29 : 30 15793 : inline void OGRPGClearResult(PGresult *&hResult) 31 : { 32 15793 : if (nullptr != hResult) 33 : { 34 15786 : PQclear(hResult); 35 15786 : hResult = nullptr; 36 : } 37 15793 : } 38 : 39 : bool OGRPG_Check_Table_Exists(PGconn *hPGConn, const char *pszTableName); 40 : 41 : #endif /* ndef OGRPGUTILITY_H_INCLUDED */