PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ pgui_copy_start()

static int pgui_copy_start ( const char *  sql)
static

Definition at line 342 of file shp2pgsql-gui.c.

343{
344 PGresult *res = NULL;
345 ExecStatusType status;
346 char sql_trunc[256];
347
348 /* We need a connection to do anything. */
349 if ( ! pg_connection ) return 0;
350 if ( ! sql ) return 0;
351
352 res = PQexec(pg_connection, sql);
353 status = PQresultStatus(res);
354 PQclear(res);
355
356 /* Did something unexpected happen? */
357 if ( status != PGRES_COPY_IN )
358 {
359 /* Log errors and return failure. */
360 snprintf(sql_trunc, 255, "%s", sql);
361 pgui_logf("Failed SQL begins: \"%s\"", sql_trunc);
362 pgui_logf("Failed in pgui_copy_start(): %s", PQerrorMessage(pg_connection));
363 return 0;
364 }
365
366 return 1;
367}
tuple res
Definition window.py:79
static void static void static void pgui_logf(const char *fmt,...) __attribute__((format(printf
static PGconn * pg_connection

References pg_connection, and pgui_logf().

Referenced by pgui_action_import().

Here is the call graph for this function:
Here is the caller graph for this function: