Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#5627 closed enhancement (fixed)

PGDump: promote DROP_TABLE=IF_EXISTS as default

Reported by: Mike Taves Owned by: warmerdam
Priority: normal Milestone: 2.0.0
Component: OGR_SF Version:
Severity: normal Keywords: OGR, PGDump
Cc:

Description

This behaviour change suggested is for the PGDump OGR driver. Currently (version 1.11.0), without any layer creation options, the resulting file can only be loaded into a PostgreSQL database if the table already exists. If it is a new table, the message from psql is:

psql:pgdump.sql:2: ERROR: table "pgdump" does not exist

Which was caused by the command on line 2:

DROP TABLE "public"."pgdump" CASCADE;

However, with layer creation DROP_TABLE=IF_EXISTS, it works. This should be the default option.

This option exists because the DROP TABLE [ IF EXISTS ] syntax was introduced with PostgreSQL 8.2, which was released in 2006-12-05 and supported until 2011-09-26. PostgreSQL versions that don't support the IF EXISTS syntax are no longer community supported.

Change History (2)

comment:1 Changed 7 years ago by Even Rouault

Component: defaultOGR_SF
Milestone: 2.0
Resolution: fixed
Status: newclosed

trunk r27685 "PGDUMP: switch to DROP_TABLE=IF_EXISTS by default (#5627)"

comment:2 Changed 6 years ago by Even Rouault

Milestone: 2.02.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.