[Gambas-user] Gambas & PostgreSQL cannot create index. relation XXX does not exist.

Ron_1st ronstk at ...239...
Sun Jan 25 00:19:16 CET 2009


On Saturday 24 January 2009, Randy wrote:
>     .Fields.Add("status", gb.String, 1)
>     .PrimaryKey = ["account"]
>     .Indexes.Add("glcoa_sort", "glsort", TRUE)
>     .Update
>    END WITH
> 
> Here's the debug output with index. Their is NO CREATE TABLE SQL when you try make table with indexes. It's missing! It looks like this is a bug in Gambas when creating table with indexes.
> 
> postgresql: 0x8159aa8: select substring(version(),12,5)
> postgresql: 0x8159aa8: show client_encoding
> postgresql: 0x8159aa8: select relname from pg_class where (relkind = 'r' 
> or relkind = 'v') and (relname = 'glcoa') and (relnamespace not in 
> (select oid from pg_namespace where nspname = 'information_schema'))
> postgresql: 0x8159aa8: select pg_class.relname from pg_class, pg_index, 
> pg_class pg_class2 where pg_class2.relname = 'glcoa' and 
> (pg_class2.relnamespace not in (select oid from pg_namespace where 
> nspname = 'information_schema')) and pg_index.indrelid = pg_
> class2.oid and pg_index.indexrelid = pg_class.oid and pg_class.relname = 
> 'glcoa_sort'
> postgresql: 0x8159aa8: CREATE UNIQUE INDEX "glcoa_sort" ON glcoa ( glsort )
------------------------------------------------------------^^^^^^^
	here it tries the table glcoa but that does not exist yet !!!
> 


OK
Just the last line tells me it wants a table to add the index.



More information about the User mailing list