PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ pgui_copy_start()

static int pgui_copy_start ( const char *  sql)
static

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

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

References pg_connection, pgui_logf(), window::res, and rtgdalraster::sql.

Referenced by pgui_action_import().

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