appendStringInfo(&query,"SELECT oid FROM pg_class WHERE relnamespace = %u AND relkind IN ('r', 'v') AND has_table_privilege (oid, 'SELECT') ORDER BY relname;",nspid);
returnquery_to_oid_list(query.data);
}
/*
* Including the system schemas is probably not useful for a database
* mapping.
*/
#define XML_VISIBLE_SCHEMAS_EXCLUDE "nspname LIKE 'pg_%' ESCAPE '' OR nspname = 'information_schema'"
#define XML_VISIBLE_SCHEMAS "SELECT oid FROM pg_namespace WHERE has_schema_privilege (oid, 'USAGE') AND NOT (" XML_VISIBLE_SCHEMAS_EXCLUDE ")"
staticList*
database_get_xml_visible_schemas(void)
{
returnquery_to_oid_list(XML_VISIBLE_SCHEMAS" ORDER BY nspname;");
}
staticList*
database_get_xml_visible_tables(void)
{
/* At the moment there is no order required here. */
returnquery_to_oid_list("SELECT oid FROM pg_class WHERE relkind IN ('r', 'v') AND has_table_privilege (pg_class.oid, 'SELECT') AND relnamespace IN ("XML_VISIBLE_SCHEMAS");");
}
/*
/*
* Map SQL table to XML and/or XML Schema document; see SQL/XML:2003
* Map SQL table to XML and/or XML Schema document; see SQL/XML:2003