Opened 19 years ago

Closed 14 years ago

#1386 closed defect (wontfix)

msPOSTGISLayerParseData locates primary key col

Reported by: phill.watson@… Owned by: pramsey
Priority: high Milestone:
Component: PostGIS Interface Version: 4.6
Severity: major Keywords:
Cc:

Description

The function msPOSTGISLayerParseData() locates the primary key column if none 
specified with a "USING UNIQUE" expression in the DATA element. However, later 
functions (namely msPOSTGISLayerGetShape()) expect an OID column.

Also, bear in mind that the primary key may consist of multiple columns. 
Workaround - Comment out the following lines from the function 
msPOSTGISLayerParseData()

    if(!urid_found) {
      msPOSTGISLayerRetrievePK(layer, urid_name, *table_name, debug);
    }

Change History (4)

comment:1 by phill.watson@…, 19 years ago

Forgot to mention. Bug is caused, not because the other functions expect an OID 
specifically, but because they expect a numeric value. Fails only if the 
primary key is varchar column (or non-numeric).

comment:2 by pramsey, 15 years ago

Owner: changed from refractions to pramsey
Status: newassigned

This is tricky indeed, because the internals of mapserver use a 'long' as a record identifier. So non-integral keys would have to be mapped into 'long' to fit into the mapserver internals. Multi-key primary keys have similar issues. We run into impedance at the level of the core mapserver structure.

BTW, 'oid' is now very deprecated, so 'working around' by going back to oid isn't an option anymore.

comment:3 by pramsey, 15 years ago

The general improvement would be to reform the draw/query lifecycle in mapserver generally to reduce the dependence on unique keys for query resolution.

comment:4 by pramsey, 14 years ago

Resolution: wontfix
Status: assignedclosed

I'm closing this because it is unlikely to be fixed unless there is more interest in the issue of non-numeric primary keys, or key-less operation of the driver. If there is enough interest to re-open the ticket, I will re-evaluate, but the reality is most people simple work around this issue by having a numeric key.

Note: See TracTickets for help on using tickets.