[GRASSLIST:9705] Re: switching to postgres

Kirk R. Wythers kwythers at umn.edu
Tue Jan 3 13:11:35 EST 2006


Leonardo,

This issue disappeared for me when I updated GRASS from CVS (as  
recommended by Radim).

Kirk

On Jan 3, 2006, at 9:21 AM, Leonardo Lami wrote:

> Hi all,
> I see that this problem is common to many commands.
> We see this problem when we change Postgres 8.0 in Postgre 8.1
> In the new version the table are created without oid like you can  
> read above:
>
> (default_with_oids (boolean)
>  This controls whether CREATE TABLE and CREATE TABLE AS include an  
> OID column
> in newly-created tables, if neither WITH OIDS nor WITHOUT OIDS is  
> specified.
> It also determines whether OIDs will be included in tables created  
> by SELECT
> INTO. In PostgreSQL 8.1 default_with_oids is disabled by default;  
> in prior
> versions of PostgreSQL, it was on by default.
>  The use of OIDs in user tables is considered deprecated, so most
> installations should leave this variable disabled. Applications  
> that require
> OIDs for a particular table should specify WITH OIDS when creating  
> the table.
> This variable can be enabled for compatibility with old  
> applications that do
> not follow this behavior.)
>
> If you want create a table with oid cloumn you must use the follow  
> sql:
> 'create table tablename with oids';
>
> or you can change the file:
> /etc/postgresql/8.1/main/postgresql.conf
> setting:
> default_with_oids = true
>
> but, probably, the rigth way is debug GRASS modules
>
> Best regards
>
> Leonardo
>
> Alle 18:54, giovedì 15 dicembre 2005, hai scritto:
>>> 6. use db.describe to check out the vector in GRASS
>>>
>>> GRASS 6.1.cvs (spearfish60):~ > db.describe table=spearfish_soils
>>> driver=pg database=spearfish_soils
>>> DBMI-Postgres driver error:
>>> select * from spearfish_soils where oid < 0
>>> ERROR:  column "oid" does not exist
>>>
>>> What is oid? I can see from the columns that postgres printed out  
>>> that I
>>> have only columns cat and label, no oid. Is this something that  
>>> should
>>> have copied and did not?
>>
>> This is bug.  By default postgres is using OID (hidden) column
>> for each table. But it is possible to configure postgres to create  
>> tables
>> without that column. My fault, it was stupid to use oid.
>> Fixed in CVS.
>>
>> Radim
>
> -------------------------------------------------------
>




More information about the grass-user mailing list