[GB.DB.POSTGRESQL]

* NEW: Support for materialized views.


git-svn-id: svn://localhost/gambas/trunk@7024 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2015-04-08 10:33:10 +00:00
parent 0f0f6ece42
commit c1b219286d

View file

@ -1520,12 +1520,12 @@ static void table_release(DB_DATABASE *db, DB_INFO *info)
static int table_exist(DB_DATABASE *db, const char *table) static int table_exist(DB_DATABASE *db, const char *table)
{ {
const char *query = const char *query =
"select relname from pg_class where (relkind = 'r' or relkind = 'v') " "select relname from pg_class where (relkind = 'r' or relkind = 'v'or relkind = 'm') "
"and (relname = '&1') " "and (relname = '&1') "
"and (relnamespace not in (select oid from pg_namespace where nspname = 'information_schema'))"; "and (relnamespace not in (select oid from pg_namespace where nspname = 'information_schema'))";
const char *query_schema = const char *query_schema =
"select relname from pg_class where (relkind = 'r' or relkind = 'v') " "select relname from pg_class where (relkind = 'r' or relkind = 'v' or relkind = 'm') "
"and (relname = '&1') " "and (relname = '&1') "
"and (relnamespace in (select oid from pg_namespace where nspname = '&2'))"; "and (relnamespace in (select oid from pg_namespace where nspname = '&2'))";
@ -1578,7 +1578,7 @@ static int table_exist(DB_DATABASE *db, const char *table)
static int table_list_73(DB_DATABASE *db, char ***tables) static int table_list_73(DB_DATABASE *db, char ***tables)
{ {
const char *query = const char *query =
"select pg_class.relname,pg_namespace.nspname from pg_class,pg_namespace where (pg_class.relkind = 'r' or pg_class.relkind = 'v') " "select pg_class.relname,pg_namespace.nspname from pg_class,pg_namespace where (pg_class.relkind = 'r' or pg_class.relkind = 'v' or pg_class.relkind = 'm') "
"and (pg_namespace.oid = pg_class.relnamespace) " "and (pg_namespace.oid = pg_class.relnamespace) "
"and (pg_namespace.oid not in (select oid from pg_namespace where nspname = 'information_schema'))"; "and (pg_namespace.oid not in (select oid from pg_namespace where nspname = 'information_schema'))";
@ -1770,7 +1770,7 @@ static int table_primary_key(DB_DATABASE *db, const char *table, char ***primary
static int table_is_system(DB_DATABASE *db, const char *table) static int table_is_system(DB_DATABASE *db, const char *table)
{ {
const char *query = const char *query =
"select 1 from pg_class where (relkind = 'r' or relkind = 'v') " "select 1 from pg_class where (relkind = 'r' or relkind = 'v'or relkind = 'm') "
"and (relname = '&1') " "and (relname = '&1') "
"and (relnamespace in (select oid from pg_namespace where nspname = 'pg_catalog'))"; "and (relnamespace in (select oid from pg_namespace where nspname = 'pg_catalog'))";