[postgis-users] Missing primary key column.

Byron Como bcomo at cox.net
Sat Jan 8 15:28:15 PST 2011


On 1/8/2011 5:11 PM, Ben Madin wrote:
> Byron,
>
> A little bit more information may help here - what do you mean by 'importing' the table into QGIS?
Ach, "Add PostGIS Layer" was use.

>   Have you checked that the primary key is unique
Yes, it is. They are very simple tables.
>   - and such a constraint exists on the table definition?
It does, in each table.
> and that the column is in the geometry_columns table
The gid column is missing from the geometry_columns table. AH HA! ah ha? 
Problem?
>   - you may want to try populate_geometry_columns() function.
As John Cleese said in "Silverado", "Today, my jurisdiction ends here." 
I'm clueless as how to proceed.
Just add it, as the primary key?
> maybe post the output of \d tablename.
>
> cheers
>
> Ben
>
> On 09/01/2011, at 9:46 AM, Byron Como wrote:
>
>> The problem:
>> Missing primary key column in postgresql table imported into Quantum GIS.
>>
>> Details:
>> 43,000 object database created using Windows XP 32 bit, postgresql 8.4, postgis 1.4, Quantum GIS 1.5.
>> Daily backups using pgadmin.
>> Several db restores were performed on the XP system for various reasons (one time was to recover from a lightning strike). Restored data was good and project continued with no problems.
>> Recently upgraded to Windows 7 64 bit to be current and take advantage of the increased memory available.
>> Installed the same software as above.
>> The data in postgresql seems ok and can be manipulated normally - copied, pasted, deleted.
>> Importing a table into Qgis 1.5 or 1.6 results in layer with the primary key column missing. The data can't be manipulated completely. The table can be added to but deletions can't be performed. The primary key is gid, integer.
>>
>> Corrective actions thus far:
>> Reloaded software many times giving great attention to the details of installation. Examined the data in pgadmin for anomalies. Nothing apparent. All seems correct. Posted to Quantum GIS mailing list. Nothing there.
>>
>> Expected resolution:
>> Barring solution from mailing list suggestions, reinstall on Windows XP 32 bit and continue with memory limitations as before. (Extra memory desired to make very large format high-resolution prints).
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110108/02ee956c/attachment.html>


More information about the postgis-users mailing list