PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ pgui_copy_write()

static int pgui_copy_write ( const char *  line)
static

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

374 {
375  char line_trunc[256];
376 
377  /* We need a connection to do anything. */
378  if ( ! pg_connection ) return 0;
379  if ( ! line ) return 0;
380 
381  /* Did something unexpected happen? */
382  if ( PQputCopyData(pg_connection, line, strlen(line)) < 0 )
383  {
384  /* Log errors and return failure. */
385  snprintf(line_trunc, 255, "%s", line);
386  pgui_logf("Failed row begins: \"%s\"", line_trunc);
387  pgui_logf("Failed in pgui_copy_write(): %s", PQerrorMessage(pg_connection));
388  return 0;
389  }
390 
391  /* Send linefeed to signify end of line */
392  PQputCopyData(pg_connection, "\n", 1);
393 
394  return 1;
395 }
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: