[gdal-dev] Inserting into PostGIS table with primary key using ogr2ogr

Luca Sigfrido Percich sigfrido at tiscali.it
Tue Dec 13 06:43:30 EST 2011


Hi Chaitanya,

I understand, thank you. Those options are not relevant because I'm
appending to an existing PostGIS table.

Summing up: currently it is not possible to append rows to a PostGIS
table if this table has a primary key which is not incremented
server-side, because the values of the primary key column are not copied
from the source dataset into the postGIS PK column.
I tried also with the -sql option including the pk column, with no luck.

Is this the expected behaviour? IMHO all the (selected) columns from the
source dataset should be copied in to the destination, leaving to the
server the task of eventually complaining about duplicate or malformed
keys.

Moreover, this does not happen with SQLite, where all the columns get
copied regardless they are part of a PK constraint, so at least it's an
inconsistency. 

I will file a bug for this.

Thank you again

Sig

Il giorno mar, 13/12/2011 alle 10.06 +0530, Chaitanya kumar CH ha
scritto:
> Sig,
> 
> The configuration option PGSQL_OGR_FID is only used for reading a
> postgis table. Use the creation option FID to specify the FID column
> to create.
> Also check that the primary key column in the postgis table is of type
> serial and not just integer.


_____________
PRIVACY
Le informazioni contenute in questo messaggio sono riservate e confidenziali. Il loro utilizzo e' consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invitiamo ad eliminarlo dal Suo Sistema e a distruggere le varie copie o stampe, dandone gentilmente comunicazione all’indirizzo mail del mittente. Ogni utilizzo improprio e' contrario ai principi del D.lgs 196/03 e alla legislazione europea (Direttiva 2002/58/CE).

PRIVACY
Le informazioni contenute in questo messaggio sono riservate e confidenziali. Il loro utilizzo e' consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invitiamo ad eliminarlo dal Suo Sistema e a distruggere le varie copie o stampe, dandone gentilmente comunicazione all’indirizzo mail del mittente. Ogni utilizzo improprio e' contrario ai principi del D.lgs 196/03 e alla legislazione europea (Direttiva 2002/58/CE).


More information about the gdal-dev mailing list