[gnome-db] create_index method for PostgreSQL implemented.



Hello,

New functions gda_postgres_provider_create_index() and gda_postgres_provider_drop_index() are implemented and ready for testing. Some notes; In PostgreSQL, PRIMARY KEY can only be added as a CONSTRAINT and not by using the CREATE INDEX command. Therefore I have split the 3 Index options in the following:

-1 PRIMARY KEY -> ALTER TABLE table_name ADD CONSTRAINT index_name PRIMARY KEY (cols ....)
-2 UNIQUE INDEX -> ALTER TABLE table_name ADD CONSTRAINT index_name UNIQUE (cols ....)
-3 INDEX -> CREATE INDEX idx_name ON table_name

The UNIQUE can also be created by using CREATE INDEX, so if you believe it is better to change that, let me know.

Because of this, I use both methods as well when calling drop_index method:

ALTER TABLE table_name DROP CONSTRAINT index_name
DROP INDEX index_name

Let me know any issues.

Thanks,
Bas.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]