[libgda/LIBGDA_4.0] Added indexes in meta data information



commit 417576a04d865a3c074df40d4231e86bd4b709c1
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sat Jan 30 14:16:12 2010 +0100

    Added indexes in meta data information
    
    
    * for the PostgreSQL provider only at the moment
    * also added schema migration for the GdaMetaStore's database

 doc/C/i_s_doc.xml                                |   28 +-
 doc/C/information_schema.png                     |  Bin 295049 -> 141870 bytes
 doc/C/information_schema.svg                     | 3211 +++-------------------
 doc/C/libgda-4.0-docs.sgml                       |    2 +-
 doc/C/tmpl/gda-server-provider.sgml              |    8 +-
 libgda/gda-connection.c                          |   84 +-
 libgda/gda-meta-store.c                          |  413 +++-
 libgda/gda-server-provider.h                     |   14 +-
 libgda/information_schema.xml                    |   52 +
 libgda/providers-support/gda-meta-column-types.h |  544 ++++
 providers/postgres/gda-postgres-meta.c           |  723 ++++-
 providers/postgres/gda-postgres-meta.h           |   15 +
 providers/postgres/gda-postgres-provider.c       |    4 +
 providers/postgres/gda-postgres-recordset.c      |    2 +
 14 files changed, 1995 insertions(+), 3105 deletions(-)
---
diff --git a/doc/C/i_s_doc.xml b/doc/C/i_s_doc.xml
index 472fc28..1b6b611 100644
--- a/doc/C/i_s_doc.xml
+++ b/doc/C/i_s_doc.xml
@@ -1,5 +1,5 @@
 <sect2>
-<!--File generated by the tools/information-schema-doc program from the
+  <!--File generated by the tools/information-schema-doc program from the
 libgda/information-schema.xml file,
 do not modify-->
   <title>Individual table description</title>
@@ -171,7 +171,7 @@ do not modify-->
   <sect3 id="is:_columns">
     <title>_columns table</title>
     <para>List of columns composing tables</para>
-    <para>The following table describes the columns:<informaltable frame="all"><tgroup cols="5" colsep="1" rowsep="1" align="justify"><thead><row><entry>Column name</entry><entry>Type</entry><entry>Key</entry><entry>Can be NULL</entry><entry>description</entry></row></thead><tbody><row><entry>table_catalog</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>table_schema</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>table_name</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>column_name</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>ordinal_position</entry><entry>gint</entry><entry></entry><entry>No</entry><entry>Column position, starts at 1</entry></row><row><entry>column_default</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>is_nullable</ent
 ry><entry>boolean</entry><entry></entry><entry>No</entry><entry></entry></row><row><entry>data_type</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry>Data type of the column (if the column is an array, then 'array_spec' is set, and this may be NULL)</entry></row><row><entry>array_spec</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry>Array description if the column is an array</entry></row><row><entry>gtype</entry><entry>string</entry><entry></entry><entry>No</entry><entry></entry></row><row><entry>character_maximum_length</entry><entry>gint</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>character_octet_length</entry><entry>gint</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>numeric_precision</entry><entry>gint</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>numeric_scale</entry><entry>gint</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>d
 atetime_precision</entry><entry>gint</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>character_set_catalog</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>character_set_schema</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>character_set_name</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>collation_catalog</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>collation_schema</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>collation_name</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>extra</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry>CSV string with: AUTO_INCREMENT</entry></row><row><entry>is_updatable</entry><entry>boolean</entry><entry></entry><entry>Yes</ent
 ry><entry></entry></row><row><entry>column_comments</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row></tbody></tgroup></informaltable></para>
+    <para>The following table describes the columns:<informaltable frame="all"><tgroup cols="5" colsep="1" rowsep="1" align="justify"><thead><row><entry>Column name</entry><entry>Type</entry><entry>Key</entry><entry>Can be NULL</entry><entry>description</entry></row></thead><tbody><row><entry>table_catalog</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>table_schema</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>table_name</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>column_name</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>ordinal_position</entry><entry>gint</entry><entry></entry><entry>No</entry><entry>Column position, starts at 1</entry></row><row><entry>column_default</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>is_nullable</ent
 ry><entry>boolean</entry><entry></entry><entry>No</entry><entry></entry></row><row><entry>data_type</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry>Data type of the column (if the column is an array, then 'array_spec' is set, and this may be NULL)</entry></row><row><entry>array_spec</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry>Array description if the column is an array</entry></row><row><entry>gtype</entry><entry>string</entry><entry></entry><entry>No</entry><entry></entry></row><row><entry>character_maximum_length</entry><entry>gint</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>character_octet_length</entry><entry>gint</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>numeric_precision</entry><entry>gint</entry><entry></entry><entry>Yes</entry><entry>If data_type identifies a numeric type, this column contains the precision of the type for this column (the number of significant dig
 its)</entry></row><row><entry>numeric_scale</entry><entry>gint</entry><entry></entry><entry>Yes</entry><entry>If data_type identifies an exact numeric type, this column contains the scale of the type for this column (the number of significant digits to the right of the decimal point)</entry></row><row><entry>datetime_precision</entry><entry>gint</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>character_set_catalog</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>character_set_schema</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>character_set_name</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>collation_catalog</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>collation_schema</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>c
 ollation_name</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>extra</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry>CSV string with: AUTO_INCREMENT</entry></row><row><entry>is_updatable</entry><entry>boolean</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>column_comments</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row></tbody></tgroup></informaltable></para>
     <para>
       <itemizedlist>
         <listitem>
@@ -306,6 +306,30 @@ do not modify-->
       </itemizedlist>
     </para>
   </sect3>
+  <sect3 id="is:_table_indexes">
+    <title>_table_indexes table</title>
+    <para>List of tables' indexes which do not relate to primary keys</para>
+    <para>The following table describes the columns:<informaltable frame="all"><tgroup cols="5" colsep="1" rowsep="1" align="justify"><thead><row><entry>Column name</entry><entry>Type</entry><entry>Key</entry><entry>Can be NULL</entry><entry>description</entry></row></thead><tbody><row><entry>index_catalog</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry>Name of the catalog that contains the index</entry></row><row><entry>index_schema</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry>Name of the schema that contains the index</entry></row><row><entry>index_name</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>table_catalog</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>table_schema</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>table_name</entry><entry>string</entry><entry>Yes</entry><entry>No</e
 ntry><entry></entry></row><row><entry>is_unique</entry><entry>boolean</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>index_def</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry>Index definition</entry></row><row><entry>index_type</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry>Database specific type of index such as BTREE, ...</entry></row><row><entry>extra</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry>CSV string with: ASCENDING, ...</entry></row><row><entry>index_owner</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>index_comments</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row></tbody></tgroup></informaltable></para>
+    <para>
+      <itemizedlist>
+        <listitem>
+          <para>(table_catalog, table_schema, table_name) references <link linkend="is:_tables">_tables</link>(table_catalog, table_schema, table_name) </para>
+        </listitem>
+      </itemizedlist>
+    </para>
+  </sect3>
+  <sect3 id="is:_index_column_usage">
+    <title>_index_column_usage table</title>
+    <para>List of the tables' columns involved in an index listed in the _table_indexes table</para>
+    <para>The following table describes the columns:<informaltable frame="all"><tgroup cols="5" colsep="1" rowsep="1" align="justify"><thead><row><entry>Column name</entry><entry>Type</entry><entry>Key</entry><entry>Can be NULL</entry><entry>description</entry></row></thead><tbody><row><entry>index_catalog</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>index_schema</entry><entry>string</entry><entry></entry><entry>Yes</entry><entry></entry></row><row><entry>index_name</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>table_catalog</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>table_schema</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>table_name</entry><entry>string</entry><entry>Yes</entry><entry>No</entry><entry></entry></row><row><entry>column_name</entry><entry>string</entry><entry>
 Yes</entry><entry>Yes</entry><entry></entry></row><row><entry>column_expr</entry><entry>string</entry><entry>Yes</entry><entry>Yes</entry><entry></entry></row><row><entry>ordinal_position</entry><entry>gint</entry><entry></entry><entry>No</entry><entry>Column position in the index, starts at 1</entry></row></tbody></tgroup></informaltable></para>
+    <para>
+      <itemizedlist>
+        <listitem>
+          <para>(index_name, table_catalog, table_schema, table_name) references <link linkend="is:_table_indexes">_table_indexes</link>(index_name, table_catalog, table_schema, table_name) </para>
+        </listitem>
+      </itemizedlist>
+    </para>
+  </sect3>
   <sect3 id="is:_all_types">
     <title>_all_types view</title>
     <para>List of all the data types</para>
diff --git a/doc/C/information_schema.png b/doc/C/information_schema.png
index 463c9d1..ea77090 100644
Binary files a/doc/C/information_schema.png and b/doc/C/information_schema.png differ
diff --git a/doc/C/information_schema.svg b/doc/C/information_schema.svg
index 1a99ff3..ecb9a45 100644
--- a/doc/C/information_schema.svg
+++ b/doc/C/information_schema.svg
@@ -1,2852 +1,365 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Generated by Graphviz version 2.12 (Mon Apr 23 09:57:53 UTC 2007)
-     For user: -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"; [
+ <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink";>
+]>
+<!-- Generated by Graphviz version 2.20.2 (Wed Sep 16 11:12:21 UTC 2009)
+     For user: (vivien) Vivien,,, -->
 <!-- Title: G Pages: 1 -->
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/";
-   xmlns:cc="http://web.resource.org/cc/";
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
-   xmlns:svg="http://www.w3.org/2000/svg";
-   xmlns="http://www.w3.org/2000/svg";
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
-   width="33.15in"
-   height="26.10in"
-   id="svg2"
-   sodipodi:version="0.32"
-   inkscape:version="0.45"
-   sodipodi:docname="information_schema.svg"
-   inkscape:output_extension="org.inkscape.output.svg.inkscape"
-   sodipodi:docbase="/local/TESTS/V4/libgda-trunk/doc/C"
-   sodipodi:modified="TRUE">
-  <metadata
-     id="metadata1197">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <defs
-     id="defs1195">
-    <title
-       id="title5">G</title>
-  </defs>
-  <sodipodi:namedview
-     inkscape:window-height="902"
-     inkscape:window-width="1114"
-     inkscape:pageshadow="2"
-     inkscape:pageopacity="0.0"
-     guidetolerance="10.0"
-     gridtolerance="10.0"
-     objecttolerance="10.0"
-     borderopacity="1.0"
-     bordercolor="#666666"
-     pagecolor="#ffffff"
-     id="base"
-     inkscape:zoom="0.29416773"
-     inkscape:cx="1491.7501"
-     inkscape:cy="766.56946"
-     inkscape:window-x="5"
-     inkscape:window-y="50"
-     inkscape:current-layer="svg2" />
-  <polygon
-     id="polygon7"
-     points="-4,4 -4,-1876 2383,-1876 2383,4 -4,4 "
-     style="fill:#ffffff;stroke:#ffffff"
-     transform="matrix(1.048566,0,0,1.3297947,48.310492,2491.2193)"
-     inkscape:export-xdpi="36.799999"
-     inkscape:export-ydpi="36.799999" />
-  <g
-     class="node"
-     id="node1"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title10">main.main._attributes</title>
-    <polygon
-       id="polygon12"
-       points="1002,-131 1002,-151 1090,-151 1090,-131 1002,-131 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text14"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-136.33299"
-       x="1046">_attributes</text>
-    <polygon
-       id="polygon16"
-       points="1002,-131 1002,-151 1090,-151 1090,-131 1002,-131 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text18"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-117.333"
-       x="1029.5">att_name</text>
-    <text
-       id="text20"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-117.333"
-       x="1078">key</text>
-    <text
-       id="text22"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-99.333298"
-       x="1029.5">att_value</text>
-    <polygon
-       id="polygon24"
-       points="1001,-94 1001,-152 1091,-152 1091,-94 1001,-94 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node2"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title27">main.main._information_schema_catalog_name</title>
-    <polygon
-       id="polygon29"
-       points="1016,-1847 1016,-1867 1228,-1867 1228,-1847 1016,-1847 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text31"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1852.33"
-       x="1122">_information_schema_catalog_name</text>
-    <polygon
-       id="polygon33"
-       points="1016,-1847 1016,-1867 1228,-1867 1228,-1847 1016,-1847 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text35"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1833.33"
-       x="1056.5">catalog_name</text>
-    <text
-       id="text37"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1833.33"
-       x="1216">key</text>
-    <polygon
-       id="polygon39"
-       points="1015,-1828 1015,-1868 1229,-1868 1229,-1828 1015,-1828 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node3"
-     transform="matrix(1.33333,0,0,1.33333,-1490.412,1971.0174)">
-    <title
-       id="title42">main.main._builtin_data_types</title>
-    <polygon
-       id="polygon44"
-       points="1924,-167 1924,-187 2082,-187 2082,-167 1924,-167 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text46"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-172.33299"
-       x="2003">_builtin_data_types</text>
-    <polygon
-       id="polygon48"
-       points="1924,-167 1924,-187 2082,-187 2082,-167 1924,-167 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text50"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-153.33299"
-       x="1974">short_type_name</text>
-    <text
-       id="text52"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-135.33299"
-       x="1970">full_type_name</text>
-    <text
-       id="text54"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-135.33299"
-       x="2070">key</text>
-    <text
-       id="text56"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-117.333"
-       x="1941.5">gtype</text>
-    <text
-       id="text58"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-99.333298"
-       x="1954.5">comments</text>
-    <text
-       id="text60"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-81.333298"
-       x="1954">synonyms</text>
-    <text
-       id="text62"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-63.333302"
-       x="1947.5">internal</text>
-    <polygon
-       id="polygon64"
-       points="1923,-58 1923,-188 2083,-188 2083,-58 1923,-58 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node4"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title67">main.main._element_types</title>
-    <polygon
-       id="polygon69"
-       points="718,-1517 718,-1537 860,-1537 860,-1517 718,-1517 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text71"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1522.33"
-       x="789">_element_types</text>
-    <polygon
-       id="polygon73"
-       points="718,-1517 718,-1537 860,-1537 860,-1517 718,-1517 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text75"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1503.33"
-       x="760">specific_name</text>
-    <text
-       id="text77"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1503.33"
-       x="848">key</text>
-    <text
-       id="text79"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1485.33"
-       x="760.5">object_catalog</text>
-    <text
-       id="text81"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1467.33"
-       x="761">object_schema</text>
-    <text
-       id="text83"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1449.33"
-       x="755.5">object_name</text>
-    <text
-       id="text85"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1431.33"
-       x="752.5">object_type</text>
-    <text
-       id="text87"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1413.33"
-       x="747">data_type</text>
-    <text
-       id="text89"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1395.33"
-       x="750">array_spec</text>
-    <text
-       id="text91"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1377.33"
-       x="764.5">min_cardinality</text>
-    <text
-       id="text93"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1359.33"
-       x="765.5">max_cardinality</text>
-    <polygon
-       id="polygon95"
-       points="717,-1354 717,-1538 861,-1538 861,-1354 717,-1354 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node5"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title98">main.main._schemata</title>
-    <polygon
-       id="polygon100"
-       points="1058,-1763 1058,-1783 1186,-1783 1186,-1763 1058,-1763 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text102"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1768.33"
-       x="1122">_schemata</text>
-    <polygon
-       id="polygon104"
-       points="1058,-1763 1058,-1783 1186,-1783 1186,-1763 1058,-1763 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text106"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1749.33"
-       x="1098.5">catalog_name</text>
-    <text
-       id="text108"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1749.33"
-       x="1174">key</text>
-    <text
-       id="text110"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1731.33"
-       x="1099">schema_name</text>
-    <text
-       id="text112"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1731.33"
-       x="1174">key</text>
-    <text
-       id="text114"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1713.33"
-       x="1101.5">schema_owner</text>
-    <text
-       id="text116"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1695.33"
-       x="1105.5">schema_internal</text>
-    <polygon
-       id="polygon118"
-       points="1057,-1690 1057,-1784 1187,-1784 1187,-1690 1057,-1690 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge2"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title121">main.main._schemata-&gt;main.main._information_schema_catalog_name</title>
-    <path
-       id="path123"
-       d="M 1122,-1788 C 1122,-1796 1122,-1805 1122,-1814"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon125"
-       points="1118.5,-1814 1122,-1824 1125.5,-1814 1118.5,-1814 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node7"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title128">main.main._udt</title>
-    <polygon
-       id="polygon130"
-       points="363,-1517 363,-1537 481,-1537 481,-1517 363,-1517 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text132"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1522.33"
-       x="422">_udt</text>
-    <polygon
-       id="polygon134"
-       points="363,-1517 363,-1537 481,-1537 481,-1517 363,-1517 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text136"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1503.33"
-       x="397.5">udt_catalog</text>
-    <text
-       id="text138"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1503.33"
-       x="469">key</text>
-    <text
-       id="text140"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1485.33"
-       x="398">udt_schema</text>
-    <text
-       id="text142"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1485.33"
-       x="469">key</text>
-    <text
-       id="text144"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1467.33"
-       x="392.5">udt_name</text>
-    <text
-       id="text146"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1467.33"
-       x="469">key</text>
-    <text
-       id="text148"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1449.33"
-       x="393">udt_gtype</text>
-    <text
-       id="text150"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1431.33"
-       x="406">udt_comments</text>
-    <text
-       id="text152"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1413.33"
-       x="410">udt_short_name</text>
-    <text
-       id="text154"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1395.33"
-       x="406">udt_full_name</text>
-    <text
-       id="text156"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1377.33"
-       x="399">udt_internal</text>
-    <text
-       id="text158"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1359.33"
-       x="395">udt_owner</text>
-    <polygon
-       id="polygon160"
-       points="362,-1354 362,-1538 482,-1538 482,-1354 362,-1354 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge4"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title163">main.main._udt-&gt;main.main._schemata</title>
-    <path
-       id="path165"
-       d="M 490,-1523 C 533,-1567 592,-1620 655,-1650 C 721,-1683 923,-1712 1039,-1727"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon167"
-       points="1038.7,-1730.49 1049,-1728 1039.4,-1723.52 1038.7,-1730.49 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node9"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title170">main.main._domains</title>
-    <polygon
-       id="polygon172"
-       points="560,-1181 560,-1201 752,-1201 752,-1181 560,-1181 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text174"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1186.33"
-       x="656">_domains</text>
-    <polygon
-       id="polygon176"
-       points="560,-1181 560,-1201 752,-1201 752,-1181 560,-1181 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text178"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1167.33"
-       x="606.5">domain_catalog</text>
-    <text
-       id="text180"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1167.33"
-       x="740">key</text>
-    <text
-       id="text182"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1149.33"
-       x="607">domain_schema</text>
-    <text
-       id="text184"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1149.33"
-       x="740">key</text>
-    <text
-       id="text186"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1131.33"
-       x="601.5">domain_name</text>
-    <text
-       id="text188"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1131.33"
-       x="740">key</text>
-    <text
-       id="text190"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1113.33"
-       x="589">data_type</text>
-    <text
-       id="text192"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1095.33"
-       x="592">array_spec</text>
-    <text
-       id="text194"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1077.33"
-       x="602">domain_gtype</text>
-    <text
-       id="text196"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1059.33"
-       x="640.5">character_maximum_length</text>
-    <text
-       id="text198"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1041.33"
-       x="625.5">character_octet_length</text>
-    <text
-       id="text200"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1023.33"
-       x="610">collation_catalog</text>
-    <text
-       id="text202"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1005.33"
-       x="610.5">collation_schema</text>
-    <text
-       id="text204"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-987.33301"
-       x="605">collation_name</text>
-    <text
-       id="text206"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-969.33301"
-       x="622">character_set_catalog</text>
-    <text
-       id="text208"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-951.33301"
-       x="622.5">character_set_schema</text>
-    <text
-       id="text210"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-933.33301"
-       x="617">character_set_name</text>
-    <text
-       id="text212"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-915.33301"
-       x="614">numeric_precision</text>
-    <text
-       id="text214"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-897.33301"
-       x="602">numeric_scale</text>
-    <text
-       id="text216"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-879.33301"
-       x="606">domain_default</text>
-    <text
-       id="text218"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-861.33301"
-       x="615">domain_comments</text>
-    <text
-       id="text220"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-843.33301"
-       x="619">domain_short_name</text>
-    <text
-       id="text222"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-825.33301"
-       x="615">domain_full_name</text>
-    <text
-       id="text224"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-807.33301"
-       x="608">domain_internal</text>
-    <text
-       id="text226"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-789.33301"
-       x="604">domain_owner</text>
-    <polygon
-       id="polygon228"
-       points="559,-784 559,-1202 753,-1202 753,-784 559,-784 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge8"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title231">main.main._domains-&gt;main.main._element_types</title>
-    <path
-       id="path233"
-       d="M 719,-1206 C 733,-1252 746,-1300 758,-1340"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon235"
-       points="754.774,-1341.43 761,-1350 761.479,-1339.42 754.774,-1341.43 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge6"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title238">main.main._domains-&gt;main.main._schemata</title>
-    <path
-       id="path240"
-       d="M 609,-1206 C 591,-1349 596,-1531 700,-1650 C 743,-1700 928,-1723 1039,-1732"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon242"
-       points="1038.7,-1735.49 1049,-1733 1039.4,-1728.52 1038.7,-1735.49 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node12"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title245">main.main._tables</title>
-    <polygon
-       id="polygon247"
-       points="1454,-1064 1454,-1084 1582,-1084 1582,-1064 1454,-1064 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text249"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1069.33"
-       x="1518">_tables</text>
-    <polygon
-       id="polygon251"
-       points="1454,-1064 1454,-1084 1582,-1084 1582,-1064 1454,-1064 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text253"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1050.33"
-       x="1493">table_catalog</text>
-    <text
-       id="text255"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1050.33"
-       x="1570">key</text>
-    <text
-       id="text257"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1032.33"
-       x="1493.5">table_schema</text>
-    <text
-       id="text259"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1032.33"
-       x="1570">key</text>
-    <text
-       id="text261"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1014.33"
-       x="1488">table_name</text>
-    <text
-       id="text263"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1014.33"
-       x="1570">key</text>
-    <text
-       id="text265"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-996.33301"
-       x="1485">table_type</text>
-    <text
-       id="text267"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-978.33301"
-       x="1505.5">is_insertable_into</text>
-    <text
-       id="text269"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-960.33301"
-       x="1501.5">table_comments</text>
-    <text
-       id="text271"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-942.33301"
-       x="1505.5">table_short_name</text>
-    <text
-       id="text273"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-924.33301"
-       x="1501.5">table_full_name</text>
-    <text
-       id="text275"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-906.33301"
-       x="1490.5">table_owner</text>
-    <polygon
-       id="polygon277"
-       points="1453,-901 1453,-1085 1583,-1085 1583,-901 1453,-901 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge10"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title280">main.main._tables-&gt;main.main._schemata</title>
-    <path
-       id="path282"
-       d="M 1528,-1089 C 1537,-1230 1531,-1493 1392,-1650 C 1367,-1679 1275,-1704 1205,-1720"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon284"
-       points="1204.12,-1716.61 1195,-1722 1205.49,-1723.47 1204.12,-1716.61 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node14"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title287">main.main._collations</title>
-    <polygon
-       id="polygon289"
-       points="1214,-1490 1214,-1510 1374,-1510 1374,-1490 1214,-1490 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text291"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1495.33"
-       x="1294">_collations</text>
-    <polygon
-       id="polygon293"
-       points="1214,-1490 1214,-1510 1374,-1510 1374,-1490 1214,-1490 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text295"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1476.33"
-       x="1264">collation_catalog</text>
-    <text
-       id="text297"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1476.33"
-       x="1362">key</text>
-    <text
-       id="text299"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1458.33"
-       x="1264.5">collation_schema</text>
-    <text
-       id="text301"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1458.33"
-       x="1362">key</text>
-    <text
-       id="text303"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1440.33"
-       x="1259">collation_name</text>
-    <text
-       id="text305"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1440.33"
-       x="1362">key</text>
-    <text
-       id="text307"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1422.33"
-       x="1272.5">collation_comments</text>
-    <text
-       id="text309"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1404.33"
-       x="1276.5">collation_short_name</text>
-    <text
-       id="text311"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1386.33"
-       x="1272.5">collation_full_name</text>
-    <polygon
-       id="polygon313"
-       points="1213,-1381 1213,-1511 1375,-1511 1375,-1381 1213,-1381 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge12"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title316">main.main._collations-&gt;main.main._schemata</title>
-    <path
-       id="path318"
-       d="M 1263,-1515 C 1244,-1556 1218,-1607 1191,-1650 C 1185,-1659 1178,-1668 1172,-1678"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon320"
-       points="1169.2,-1675.9 1166,-1686 1174.8,-1680.1 1169.2,-1675.9 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node16"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title323">main.main._routines</title>
-    <polygon
-       id="polygon325"
-       points="994,-1625 994,-1645 1140,-1645 1140,-1625 994,-1625 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text327"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1630.33"
-       x="1067">_routines</text>
-    <polygon
-       id="polygon329"
-       points="994,-1625 994,-1645 1140,-1645 1140,-1625 994,-1625 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text331"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1611.33"
-       x="1041">specific_catalog</text>
-    <text
-       id="text333"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1611.33"
-       x="1128">key</text>
-    <text
-       id="text335"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1593.33"
-       x="1041.5">specific_schema</text>
-    <text
-       id="text337"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1593.33"
-       x="1128">key</text>
-    <text
-       id="text339"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1575.33"
-       x="1036">specific_name</text>
-    <text
-       id="text341"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1575.33"
-       x="1128">key</text>
-    <text
-       id="text343"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1557.33"
-       x="1039.5">routine_catalog</text>
-    <text
-       id="text345"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1539.33"
-       x="1040">routine_schema</text>
-    <text
-       id="text347"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1521.33"
-       x="1034.5">routine_name</text>
-    <text
-       id="text349"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1503.33"
-       x="1031.5">routine_type</text>
-    <text
-       id="text351"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1485.33"
-       x="1028.5">return_type</text>
-    <text
-       id="text353"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1467.33"
-       x="1026.5">returns_set</text>
-    <text
-       id="text355"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1449.33"
-       x="1033.5">routine_body</text>
-    <text
-       id="text357"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1431.33"
-       x="1047">routine_definition</text>
-    <text
-       id="text359"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1413.33"
-       x="1037">external_name</text>
-    <text
-       id="text361"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1395.33"
-       x="1047">external_language</text>
-    <text
-       id="text363"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1377.33"
-       x="1040.5">parameter_style</text>
-    <text
-       id="text365"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1359.33"
-       x="1040.5">is_deterministic</text>
-    <text
-       id="text367"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1341.33"
-       x="1039.5">sql_data_access</text>
-    <text
-       id="text369"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1323.33"
-       x="1028.5">is_null_call</text>
-    <text
-       id="text371"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1305.33"
-       x="1048">routine_comments</text>
-    <text
-       id="text373"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1287.33"
-       x="1052">routine_short_name</text>
-    <text
-       id="text375"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1269.33"
-       x="1048">routine_full_name</text>
-    <text
-       id="text377"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1251.33"
-       x="1037">routine_owner</text>
-    <polygon
-       id="polygon379"
-       points="993,-1246 993,-1646 1141,-1646 1141,-1246 993,-1246 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge14"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title382">main.main._routines-&gt;main.main._schemata</title>
-    <path
-       id="path384"
-       d="M 1106,-1650 C 1107,-1659 1109,-1668 1111,-1676"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon386"
-       points="1107.61,-1676.88 1113,-1686 1114.47,-1675.51 1107.61,-1676.88 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node18"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title389">main.main._udt_columns</title>
-    <polygon
-       id="polygon391"
-       points="320,-1145 320,-1165 524,-1165 524,-1145 320,-1145 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text393"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1150.33"
-       x="422">_udt_columns</text>
-    <polygon
-       id="polygon395"
-       points="320,-1145 320,-1165 524,-1165 524,-1145 320,-1145 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text397"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1131.33"
-       x="354.5">udt_catalog</text>
-    <text
-       id="text399"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1131.33"
-       x="512">key</text>
-    <text
-       id="text401"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1113.33"
-       x="355">udt_schema</text>
-    <text
-       id="text403"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1113.33"
-       x="512">key</text>
-    <text
-       id="text405"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1095.33"
-       x="349.5">udt_name</text>
-    <text
-       id="text407"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1095.33"
-       x="512">key</text>
-    <text
-       id="text409"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1077.33"
-       x="355.5">udt_column</text>
-    <text
-       id="text411"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1077.33"
-       x="512">key</text>
-    <text
-       id="text413"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1059.33"
-       x="368">ordinal_position</text>
-    <text
-       id="text415"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1041.33"
-       x="349">data_type</text>
-    <text
-       id="text417"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1023.33"
-       x="352">array_spec</text>
-    <text
-       id="text419"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1005.33"
-       x="400.5">character_maximum_length</text>
-    <text
-       id="text421"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-987.33301"
-       x="385.5">character_octet_length</text>
-    <text
-       id="text423"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-969.33301"
-       x="374">numeric_precision</text>
-    <text
-       id="text425"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-951.33301"
-       x="362">numeric_scale</text>
-    <text
-       id="text427"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-933.33301"
-       x="375">datetime_precision</text>
-    <text
-       id="text429"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-915.33301"
-       x="382">character_set_catalog</text>
-    <text
-       id="text431"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-897.33301"
-       x="382.5">character_set_schema</text>
-    <text
-       id="text433"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-879.33301"
-       x="377">character_set_name</text>
-    <text
-       id="text435"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-861.33301"
-       x="370">collation_catalog</text>
-    <text
-       id="text437"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-843.33301"
-       x="370.5">collation_schema</text>
-    <text
-       id="text439"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-825.33301"
-       x="365">collation_name</text>
-    <polygon
-       id="polygon441"
-       points="319,-820 319,-1166 525,-1166 525,-820 319,-820 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge18"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title444">main.main._udt_columns-&gt;main.main._element_types</title>
-    <path
-       id="path446"
-       d="M 516,-1170 C 525,-1183 533,-1195 542,-1206 C 589,-1267 651,-1328 701,-1372"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon448"
-       points="699.169,-1375.05 709,-1379 703.779,-1369.78 699.169,-1375.05 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge16"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title451">main.main._udt_columns-&gt;main.main._udt</title>
-    <path
-       id="path453"
-       d="M 422,-1170 C 422,-1227 422,-1289 422,-1340"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon455"
-       points="418.5,-1340 422,-1350 425.5,-1340 418.5,-1340 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node21"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title458">main.main._enums</title>
-    <polygon
-       id="polygon460"
-       points="162,-1028 162,-1048 284,-1048 284,-1028 162,-1028 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text462"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1033.33"
-       x="223">_enums</text>
-    <polygon
-       id="polygon464"
-       points="162,-1028 162,-1048 284,-1048 284,-1028 162,-1028 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text466"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1014.33"
-       x="196.5">udt_catalog</text>
-    <text
-       id="text468"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1014.33"
-       x="272">key</text>
-    <text
-       id="text470"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-996.33301"
-       x="197">udt_schema</text>
-    <text
-       id="text472"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-996.33301"
-       x="272">key</text>
-    <text
-       id="text474"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-978.33301"
-       x="191.5">udt_name</text>
-    <text
-       id="text476"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-978.33301"
-       x="272">key</text>
-    <text
-       id="text478"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-960.33301"
-       x="177.5">label</text>
-    <text
-       id="text480"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-960.33301"
-       x="272">key</text>
-    <text
-       id="text482"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-942.33301"
-       x="210">ordinal_position</text>
-    <polygon
-       id="polygon484"
-       points="161,-937 161,-1049 285,-1049 285,-937 161,-937 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge20"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title487">main.main._enums-&gt;main.main._udt</title>
-    <path
-       id="path489"
-       d="M 243,-1053 C 258,-1096 279,-1156 302,-1206 C 322,-1251 345,-1300 366,-1341"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon491"
-       points="363.084,-1342.96 371,-1350 369.203,-1339.56 363.084,-1342.96 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node23"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title494">main.main._views</title>
-    <polygon
-       id="polygon496"
-       points="1348,-557 1348,-577 1466,-577 1466,-557 1348,-557 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text498"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-562.33301"
-       x="1407">_views</text>
-    <polygon
-       id="polygon500"
-       points="1348,-557 1348,-577 1466,-577 1466,-557 1348,-557 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text502"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-543.33301"
-       x="1387">table_catalog</text>
-    <text
-       id="text504"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-543.33301"
-       x="1454">key</text>
-    <text
-       id="text506"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-525.33301"
-       x="1387.5">table_schema</text>
-    <text
-       id="text508"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-525.33301"
-       x="1454">key</text>
-    <text
-       id="text510"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-507.33301"
-       x="1382">table_name</text>
-    <text
-       id="text512"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-507.33301"
-       x="1454">key</text>
-    <text
-       id="text514"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-489.33301"
-       x="1394.5">view_definition</text>
-    <text
-       id="text516"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-471.33301"
-       x="1387.5">check_option</text>
-    <text
-       id="text518"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-453.33301"
-       x="1385">is_updatable</text>
-    <polygon
-       id="polygon520"
-       points="1347,-448 1347,-578 1467,-578 1467,-448 1347,-448 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge22"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title523">main.main._views-&gt;main.main._tables</title>
-    <path
-       id="path525"
-       d="M 1423,-582 C 1441,-662 1472,-794 1494,-887"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon527"
-       points="1490.61,-887.881 1496,-897 1497.47,-886.508 1490.61,-887.881 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node25"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title530">main.main._character_sets</title>
-    <polygon
-       id="polygon532"
-       points="1184,-1064 1184,-1084 1380,-1084 1380,-1064 1184,-1064 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text534"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1069.33"
-       x="1282">_character_sets</text>
-    <polygon
-       id="polygon536"
-       points="1184,-1064 1184,-1084 1380,-1084 1380,-1064 1184,-1064 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text538"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1050.33"
-       x="1246">character_set_catalog</text>
-    <text
-       id="text540"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1050.33"
-       x="1368">key</text>
-    <text
-       id="text542"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1032.33"
-       x="1246.5">character_set_schema</text>
-    <text
-       id="text544"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1032.33"
-       x="1368">key</text>
-    <text
-       id="text546"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1014.33"
-       x="1241">character_set_name</text>
-    <text
-       id="text548"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1014.33"
-       x="1368">key</text>
-    <text
-       id="text550"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-996.33301"
-       x="1251">default_collate_catalog</text>
-    <text
-       id="text552"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-978.33301"
-       x="1251.5">default_collate_schema</text>
-    <text
-       id="text554"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-960.33301"
-       x="1246">default_collate_name</text>
-    <text
-       id="text556"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-942.33301"
-       x="1254.5">character_set_comments</text>
-    <text
-       id="text558"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-924.33301"
-       x="1258.5">character_set_short_name</text>
-    <text
-       id="text560"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-906.33301"
-       x="1254.5">character_set_full_name</text>
-    <polygon
-       id="polygon562"
-       points="1183,-901 1183,-1085 1381,-1085 1381,-901 1183,-901 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge24"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title565">main.main._character_sets-&gt;main.main._schemata</title>
-    <path
-       id="path567"
-       d="M 1243,-1089 C 1225,-1135 1207,-1191 1196,-1242 C 1157,-1421 1201,-1474 1158,-1650 C 1156,-1659 1153,-1668 1149,-1676"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon569"
-       points="1145.52,-1675.42 1146,-1686 1152.23,-1677.43 1145.52,-1675.42 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge26"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title572">main.main._character_sets-&gt;main.main._collations</title>
-    <path
-       id="path574"
-       d="M 1285,-1089 C 1287,-1171 1290,-1289 1292,-1367"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon576"
-       points="1288.5,-1367 1292,-1377 1295.5,-1367 1288.5,-1367 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node28"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title579">main.main._triggers</title>
-    <polygon
-       id="polygon581"
-       points="1700,-620 1700,-640 1852,-640 1852,-620 1700,-620 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text583"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-625.33301"
-       x="1776">_triggers</text>
-    <polygon
-       id="polygon585"
-       points="1700,-620 1700,-640 1852,-640 1852,-620 1700,-620 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text587"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-606.33301"
-       x="1744.5">trigger_catalog</text>
-    <text
-       id="text589"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-606.33301"
-       x="1840">key</text>
-    <text
-       id="text591"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-588.33301"
-       x="1745">trigger_schema</text>
-    <text
-       id="text593"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-588.33301"
-       x="1840">key</text>
-    <text
-       id="text595"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-570.33301"
-       x="1739.5">trigger_name</text>
-    <text
-       id="text597"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-570.33301"
-       x="1840">key</text>
-    <text
-       id="text599"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-552.33301"
-       x="1757.5">event_manipulation</text>
-    <text
-       id="text601"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-552.33301"
-       x="1840">key</text>
-    <text
-       id="text603"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-534.33301"
-       x="1761">event_object_catalog</text>
-    <text
-       id="text605"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-534.33301"
-       x="1840">key</text>
-    <text
-       id="text607"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-516.33301"
-       x="1761.5">event_object_schema</text>
-    <text
-       id="text609"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-516.33301"
-       x="1840">key</text>
-    <text
-       id="text611"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-498.33301"
-       x="1754.5">event_object_table</text>
-    <text
-       id="text613"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-498.33301"
-       x="1840">key</text>
-    <text
-       id="text615"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-480.33301"
-       x="1749">action_statement</text>
-    <text
-       id="text617"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-462.33301"
-       x="1753">action_orientation</text>
-    <text
-       id="text619"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-444.33301"
-       x="1750.5">condition_timing</text>
-    <text
-       id="text621"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-426.33301"
-       x="1753">trigger_comments</text>
-    <text
-       id="text623"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-408.33301"
-       x="1757">trigger_short_name</text>
-    <text
-       id="text625"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-390.33301"
-       x="1753">trigger_full_name</text>
-    <polygon
-       id="polygon627"
-       points="1699,-385 1699,-641 1853,-641 1853,-385 1699,-385 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge28"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title630">main.main._triggers-&gt;main.main._schemata</title>
-    <path
-       id="path632"
-       d="M 1782,-645 C 1784,-882 1753,-1380 1473,-1650 C 1435,-1687 1297,-1712 1205,-1726"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon634"
-       points="1204.12,-1722.61 1195,-1728 1205.49,-1729.47 1204.12,-1722.61 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge30"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title637">main.main._triggers-&gt;main.main._tables</title>
-    <path
-       id="path639"
-       d="M 1727,-645 C 1714,-678 1698,-713 1682,-744 C 1656,-794 1623,-845 1594,-889"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon641"
-       points="1591.2,-886.9 1588,-897 1596.8,-891.1 1591.2,-886.9 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node31"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title644">main.main._table_constraints</title>
-    <polygon
-       id="polygon646"
-       points="1502,-593 1502,-613 1664,-613 1664,-593 1502,-593 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text648"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-598.33301"
-       x="1583">_table_constraints</text>
-    <polygon
-       id="polygon650"
-       points="1502,-593 1502,-613 1664,-613 1664,-593 1502,-593 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text652"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-579.33301"
-       x="1555">constraint_catalog</text>
-    <text
-       id="text654"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-561.33301"
-       x="1555.5">constraint_schema</text>
-    <text
-       id="text656"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-543.33301"
-       x="1550">constraint_name</text>
-    <text
-       id="text658"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-543.33301"
-       x="1652">key</text>
-    <text
-       id="text660"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-525.33301"
-       x="1541">table_catalog</text>
-    <text
-       id="text662"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-525.33301"
-       x="1652">key</text>
-    <text
-       id="text664"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-507.33301"
-       x="1541.5">table_schema</text>
-    <text
-       id="text666"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-507.33301"
-       x="1652">key</text>
-    <text
-       id="text668"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-489.33301"
-       x="1536">table_name</text>
-    <text
-       id="text670"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-489.33301"
-       x="1652">key</text>
-    <text
-       id="text672"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-471.33301"
-       x="1547">constraint_type</text>
-    <text
-       id="text674"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-453.33301"
-       x="1540.5">check_clause</text>
-    <text
-       id="text676"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-435.33301"
-       x="1540.5">is_deferrable</text>
-    <text
-       id="text678"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-417.33301"
-       x="1553">initially_deferred</text>
-    <polygon
-       id="polygon680"
-       points="1501,-412 1501,-614 1665,-614 1665,-412 1501,-412 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge32"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title683">main.main._table_constraints-&gt;main.main._tables</title>
-    <path
-       id="path685"
-       d="M 1569,-618 C 1558,-698 1543,-807 1532,-887"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon687"
-       points="1528.51,-886.701 1531,-897 1535.48,-887.398 1528.51,-886.701 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node33"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title690">main.main._domain_constraints</title>
-    <polygon
-       id="polygon692"
-       points="307,-584 307,-604 475,-604 475,-584 307,-584 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text694"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-589.33301"
-       x="391">_domain_constraints</text>
-    <polygon
-       id="polygon696"
-       points="307,-584 307,-604 475,-604 475,-584 307,-584 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text698"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-570.33301"
-       x="360">constraint_catalog</text>
-    <text
-       id="text700"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-552.33301"
-       x="360.5">constraint_schema</text>
-    <text
-       id="text702"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-534.33301"
-       x="355">constraint_name</text>
-    <text
-       id="text704"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-534.33301"
-       x="463">key</text>
-    <text
-       id="text706"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-516.33301"
-       x="353.5">domain_catalog</text>
-    <text
-       id="text708"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-516.33301"
-       x="463">key</text>
-    <text
-       id="text710"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-498.33301"
-       x="354">domain_schema</text>
-    <text
-       id="text712"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-498.33301"
-       x="463">key</text>
-    <text
-       id="text714"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-480.33301"
-       x="348.5">domain_name</text>
-    <text
-       id="text716"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-480.33301"
-       x="463">key</text>
-    <text
-       id="text718"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-462.33301"
-       x="345.5">check_clause</text>
-    <text
-       id="text720"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-444.33301"
-       x="345.5">is_deferrable</text>
-    <text
-       id="text722"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-426.33301"
-       x="358">initially_deferred</text>
-    <polygon
-       id="polygon724"
-       points="306,-421 306,-605 476,-605 476,-421 306,-421 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge36"
-     transform="matrix(1.3264629,0,0,1.33333,12.540347,2501.3271)">
-    <title
-       id="title727">main.main._domain_constraints-&gt;main.main._schemata</title>
-    <path
-       id="path729"
-       d="M 298,-583 C 241,-631 175,-701 144,-780 C 0,-1150 25,-1417 345,-1650 C 400,-1691 849,-1721 1039,-1732"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon731"
-       points="1038.7,-1735.49 1049,-1733 1039.4,-1728.52 1038.7,-1735.49 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge34"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title734">main.main._domain_constraints-&gt;main.main._domains</title>
-    <path
-       id="path736"
-       d="M 446,-609 C 475,-660 511,-723 542,-780 C 543,-782 545,-785 546,-788"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon738"
-       points="543.084,-789.958 551,-797 549.203,-786.559 543.084,-789.958 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node36"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title741">main.main._parameters</title>
-    <polygon
-       id="polygon743"
-       points="1012,-1055 1012,-1075 1148,-1075 1148,-1055 1012,-1055 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text745"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1060.33"
-       x="1080">_parameters</text>
-    <polygon
-       id="polygon747"
-       points="1012,-1055 1012,-1075 1148,-1075 1148,-1055 1012,-1055 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text749"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1041.33"
-       x="1059">specific_catalog</text>
-    <text
-       id="text751"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1041.33"
-       x="1136">key</text>
-    <text
-       id="text753"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1023.33"
-       x="1059.5">specific_schema</text>
-    <text
-       id="text755"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1023.33"
-       x="1136">key</text>
-    <text
-       id="text757"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1005.33"
-       x="1054">specific_name</text>
-    <text
-       id="text759"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1005.33"
-       x="1136">key</text>
-    <text
-       id="text761"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-987.33301"
-       x="1060">ordinal_position</text>
-    <text
-       id="text763"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-987.33301"
-       x="1136">key</text>
-    <text
-       id="text765"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-969.33301"
-       x="1061">parameter_mode</text>
-    <text
-       id="text767"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-951.33301"
-       x="1060.5">parameter_name</text>
-    <text
-       id="text769"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-933.33301"
-       x="1041">data_type</text>
-    <text
-       id="text771"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-915.33301"
-       x="1044">array_spec</text>
-    <polygon
-       id="polygon773"
-       points="1011,-910 1011,-1076 1149,-1076 1149,-910 1011,-910 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge40"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title776">main.main._parameters-&gt;main.main._element_types</title>
-    <path
-       id="path778"
-       d="M 1052,-1080 C 1037,-1120 1017,-1167 994,-1206 C 961,-1261 915,-1315 876,-1359"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon780"
-       points="873.596,-1356.45 869,-1366 878.546,-1361.4 873.596,-1356.45 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge38"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title783">main.main._parameters-&gt;main.main._routines</title>
-    <path
-       id="path785"
-       d="M 1078,-1080 C 1077,-1123 1075,-1178 1073,-1232"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon787"
-       points="1069.5,-1232 1073,-1242 1076.5,-1232 1069.5,-1232 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node39"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title790">main.main._routine_columns</title>
-    <polygon
-       id="polygon792"
-       points="826,-1046 826,-1066 976,-1066 976,-1046 826,-1046 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text794"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1051.33"
-       x="901">_routine_columns</text>
-    <polygon
-       id="polygon796"
-       points="826,-1046 826,-1066 976,-1066 976,-1046 826,-1046 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text798"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1032.33"
-       x="873">specific_catalog</text>
-    <text
-       id="text800"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1032.33"
-       x="964">key</text>
-    <text
-       id="text802"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1014.33"
-       x="873.5">specific_schema</text>
-    <text
-       id="text804"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-1014.33"
-       x="964">key</text>
-    <text
-       id="text806"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-996.33301"
-       x="868">specific_name</text>
-    <text
-       id="text808"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-996.33301"
-       x="964">key</text>
-    <text
-       id="text810"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-978.33301"
-       x="867.5">column_name</text>
-    <text
-       id="text812"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-978.33301"
-       x="964">key</text>
-    <text
-       id="text814"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-960.33301"
-       x="874">ordinal_position</text>
-    <text
-       id="text816"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-960.33301"
-       x="964">key</text>
-    <text
-       id="text818"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-942.33301"
-       x="855">data_type</text>
-    <text
-       id="text820"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-924.33301"
-       x="858">array_spec</text>
-    <polygon
-       id="polygon822"
-       points="825,-919 825,-1067 977,-1067 977,-919 825,-919 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge44"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title825">main.main._routine_columns-&gt;main.main._element_types</title>
-    <path
-       id="path827"
-       d="M 882,-1071 C 864,-1145 836,-1258 815,-1340"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon829"
-       points="811.529,-1339.51 813,-1350 818.393,-1340.88 811.529,-1339.51 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge42"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title832">main.main._routine_columns-&gt;main.main._routines</title>
-    <path
-       id="path834"
-       d="M 930,-1071 C 946,-1116 968,-1174 989,-1232"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon836"
-       points="985.774,-1233.43 992,-1242 992.479,-1231.42 985.774,-1233.43 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node42"
-     transform="matrix(1.33333,0,0,1.33333,-2092.1095,1984.6151)">
-    <title
-       id="title839">main.main._all_types</title>
-    <polygon
-       id="polygon841"
-       points="2118,-221 2118,-241 2218,-241 2218,-221 2118,-221 "
-       style="fill:#ffff00;stroke:#ffff00" />
-    <text
-       id="text843"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-226.33299"
-       x="2168">_all_types</text>
-    <polygon
-       id="polygon845"
-       points="2118,-221 2118,-241 2218,-241 2218,-221 2118,-221 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text847"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-207.33299"
-       x="2168">short_type_name</text>
-    <text
-       id="text849"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-189.33299"
-       x="2135.5">gtype</text>
-    <text
-       id="text851"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-171.33299"
-       x="2164">full_type_name</text>
-    <text
-       id="text853"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-153.33299"
-       x="2148.5">comments</text>
-    <text
-       id="text855"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-135.33299"
-       x="2141.5">internal</text>
-    <text
-       id="text857"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-117.333"
-       x="2148">synonyms</text>
-    <text
-       id="text859"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-99.333298"
-       x="2164.5">domain_catalog</text>
-    <text
-       id="text861"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-81.333298"
-       x="2165">domain_schema</text>
-    <text
-       id="text863"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-63.333302"
-       x="2159.5">domain_name</text>
-    <text
-       id="text865"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-45.333302"
-       x="2152.5">udt_catalog</text>
-    <text
-       id="text867"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-27.3333"
-       x="2153">udt_schema</text>
-    <text
-       id="text869"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-9.3333302"
-       x="2147.5">udt_name</text>
-    <polygon
-       id="polygon871"
-       points="2117,-4 2117,-242 2219,-242 2219,-4 2117,-4 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node43"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title874">main.main._columns</title>
-    <polygon
-       id="polygon876"
-       points="1120,-719 1120,-739 1312,-739 1312,-719 1120,-719 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text878"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-724.33301"
-       x="1216">_columns</text>
-    <polygon
-       id="polygon880"
-       points="1120,-719 1120,-739 1312,-739 1312,-719 1120,-719 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text882"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-705.33301"
-       x="1159">table_catalog</text>
-    <text
-       id="text884"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-705.33301"
-       x="1300">key</text>
-    <text
-       id="text886"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-687.33301"
-       x="1159.5">table_schema</text>
-    <text
-       id="text888"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-687.33301"
-       x="1300">key</text>
-    <text
-       id="text890"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-669.33301"
-       x="1154">table_name</text>
-    <text
-       id="text892"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-669.33301"
-       x="1300">key</text>
-    <text
-       id="text894"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-651.33301"
-       x="1161.5">column_name</text>
-    <text
-       id="text896"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-651.33301"
-       x="1300">key</text>
-    <text
-       id="text898"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-633.33301"
-       x="1168">ordinal_position</text>
-    <text
-       id="text900"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-615.33301"
-       x="1166">column_default</text>
-    <text
-       id="text902"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-597.33301"
-       x="1152.5">is_nullable</text>
-    <text
-       id="text904"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-579.33301"
-       x="1149">data_type</text>
-    <text
-       id="text906"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-561.33301"
-       x="1152">array_spec</text>
-    <text
-       id="text908"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-543.33301"
-       x="1137.5">gtype</text>
-    <text
-       id="text910"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-525.33301"
-       x="1200.5">character_maximum_length</text>
-    <text
-       id="text912"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-507.33301"
-       x="1185.5">character_octet_length</text>
-    <text
-       id="text914"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-489.33301"
-       x="1174">numeric_precision</text>
-    <text
-       id="text916"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-471.33301"
-       x="1162">numeric_scale</text>
-    <text
-       id="text918"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-453.33301"
-       x="1175">datetime_precision</text>
-    <text
-       id="text920"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-435.33301"
-       x="1182">character_set_catalog</text>
-    <text
-       id="text922"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-417.33301"
-       x="1182.5">character_set_schema</text>
-    <text
-       id="text924"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-399.33301"
-       x="1177">character_set_name</text>
-    <text
-       id="text926"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-381.33301"
-       x="1170">collation_catalog</text>
-    <text
-       id="text928"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-363.33301"
-       x="1170.5">collation_schema</text>
-    <text
-       id="text930"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-345.33301"
-       x="1165">collation_name</text>
-    <text
-       id="text932"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-327.33301"
-       x="1136">extra</text>
-    <text
-       id="text934"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-309.33301"
-       x="1157">is_updatable</text>
-    <text
-       id="text936"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-291.33301"
-       x="1175">column_comments</text>
-    <polygon
-       id="polygon938"
-       points="1119,-286 1119,-740 1313,-740 1313,-286 1119,-286 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge52"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title941">main.main._columns-&gt;main.main._element_types</title>
-    <path
-       id="path943"
-       d="M 1111,-549 C 1013,-589 873,-663 808,-780 C 755,-873 768,-1176 780,-1340"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon945"
-       points="776.522,-1340.4 781,-1350 783.488,-1339.7 776.522,-1340.4 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge46"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title948">main.main._columns-&gt;main.main._tables</title>
-    <path
-       id="path950"
-       d="M 1321,-736 C 1324,-739 1327,-741 1330,-744 C 1365,-776 1396,-748 1431,-780 C 1461,-809 1481,-849 1494,-887"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon952"
-       points="1490.77,-888.427 1497,-897 1497.48,-886.416 1490.77,-888.427 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge50"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title955">main.main._columns-&gt;main.main._collations</title>
-    <path
-       id="path957"
-       d="M 1321,-734 C 1324,-738 1327,-741 1330,-744 C 1353,-769 1380,-751 1398,-780 C 1446,-862 1417,-1114 1398,-1206 C 1386,-1262 1360,-1322 1338,-1368"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon959"
-       points="1334.8,-1366.56 1333,-1377 1340.92,-1369.96 1334.8,-1366.56 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge48"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title962">main.main._columns-&gt;main.main._character_sets</title>
-    <path
-       id="path964"
-       d="M 1248,-744 C 1254,-794 1262,-845 1268,-887"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon966"
-       points="1264.52,-887.398 1269,-897 1271.49,-886.701 1264.52,-887.398 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node48"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title969">main.main._referential_constraints</title>
-    <polygon
-       id="polygon971"
-       points="1700,-212 1700,-232 1888,-232 1888,-212 1700,-212 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text973"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-217.33299"
-       x="1794">_referential_constraints</text>
-    <polygon
-       id="polygon975"
-       points="1700,-212 1700,-232 1888,-232 1888,-212 1700,-212 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text977"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-198.33299"
-       x="1739">table_catalog</text>
-    <text
-       id="text979"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-198.33299"
-       x="1876">key</text>
-    <text
-       id="text981"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-180.33299"
-       x="1739.5">table_schema</text>
-    <text
-       id="text983"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-180.33299"
-       x="1876">key</text>
-    <text
-       id="text985"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-162.33299"
-       x="1734">table_name</text>
-    <text
-       id="text987"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-162.33299"
-       x="1876">key</text>
-    <text
-       id="text989"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-144.33299"
-       x="1748">constraint_name</text>
-    <text
-       id="text991"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-144.33299"
-       x="1876">key</text>
-    <text
-       id="text993"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-126.333"
-       x="1750.5">ref_table_catalog</text>
-    <text
-       id="text995"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-108.333"
-       x="1751">ref_table_schema</text>
-    <text
-       id="text997"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-90.333298"
-       x="1745.5">ref_table_name</text>
-    <text
-       id="text999"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-72.333298"
-       x="1759.5">ref_constraint_name</text>
-    <text
-       id="text1001"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-54.333302"
-       x="1740.5">match_option</text>
-    <text
-       id="text1003"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-36.333302"
-       x="1735">update_rule</text>
-    <text
-       id="text1005"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-18.3333"
-       x="1733">delete_rule</text>
-    <polygon
-       id="polygon1007"
-       points="1699,-13 1699,-233 1889,-233 1889,-13 1699,-13 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge54"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title1010">main.main._referential_constraints-&gt;main.main._table_constraints</title>
-    <path
-       id="path1012"
-       d="M 1709,-237 C 1700,-252 1690,-267 1682,-282 C 1662,-319 1642,-361 1627,-399"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon1014"
-       points="1623.86,-397.44 1623,-408 1630.26,-400.283 1623.86,-397.44 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node50"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title1017">main.main._key_column_usage</title>
-    <polygon
-       id="polygon1019"
-       points="1310,-167 1310,-187 1466,-187 1466,-167 1310,-167 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text1021"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-172.33299"
-       x="1388">_key_column_usage</text>
-    <polygon
-       id="polygon1023"
-       points="1310,-167 1310,-187 1466,-187 1466,-167 1310,-167 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text1025"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-153.33299"
-       x="1349">table_catalog</text>
-    <text
-       id="text1027"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-153.33299"
-       x="1454">key</text>
-    <text
-       id="text1029"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-135.33299"
-       x="1349.5">table_schema</text>
-    <text
-       id="text1031"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-135.33299"
-       x="1454">key</text>
-    <text
-       id="text1033"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-117.333"
-       x="1344">table_name</text>
-    <text
-       id="text1035"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-117.333"
-       x="1454">key</text>
-    <text
-       id="text1037"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-99.333298"
-       x="1358">constraint_name</text>
-    <text
-       id="text1039"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-99.333298"
-       x="1454">key</text>
-    <text
-       id="text1041"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-81.333298"
-       x="1351.5">column_name</text>
-    <text
-       id="text1043"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-81.333298"
-       x="1454">key</text>
-    <text
-       id="text1045"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-63.333302"
-       x="1358">ordinal_position</text>
-    <text
-       id="text1047"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-63.333302"
-       x="1454">key</text>
-    <polygon
-       id="polygon1049"
-       points="1309,-58 1309,-188 1467,-188 1467,-58 1309,-58 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge56"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title1052">main.main._key_column_usage-&gt;main.main._table_constraints</title>
-    <path
-       id="path1054"
-       d="M 1432,-192 C 1449,-220 1468,-252 1484,-282 C 1502,-319 1521,-361 1537,-399"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon1056"
-       points="1533.74,-400.283 1541,-408 1540.14,-397.44 1533.74,-400.283 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge58"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title1059">main.main._key_column_usage-&gt;main.main._columns</title>
-    <path
-       id="path1061"
-       d="M 1357,-192 C 1347,-216 1335,-243 1322,-273"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon1063"
-       points="1318.86,-271.44 1318,-282 1325.26,-274.283 1318.86,-271.44 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node53"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title1066">main.main._check_column_usage</title>
-    <polygon
-       id="polygon1068"
-       points="1502,-158 1502,-178 1664,-178 1664,-158 1502,-158 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text1070"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-163.33299"
-       x="1583">_check_column_usage</text>
-    <polygon
-       id="polygon1072"
-       points="1502,-158 1502,-178 1664,-178 1664,-158 1502,-158 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text1074"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-144.33299"
-       x="1541">table_catalog</text>
-    <text
-       id="text1076"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-144.33299"
-       x="1652">key</text>
-    <text
-       id="text1078"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-126.333"
-       x="1541.5">table_schema</text>
-    <text
-       id="text1080"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-126.333"
-       x="1652">key</text>
-    <text
-       id="text1082"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-108.333"
-       x="1536">table_name</text>
-    <text
-       id="text1084"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-108.333"
-       x="1652">key</text>
-    <text
-       id="text1086"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-90.333298"
-       x="1550">constraint_name</text>
-    <text
-       id="text1088"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-90.333298"
-       x="1652">key</text>
-    <text
-       id="text1090"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-72.333298"
-       x="1543.5">column_name</text>
-    <text
-       id="text1092"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-72.333298"
-       x="1652">key</text>
-    <polygon
-       id="polygon1094"
-       points="1501,-67 1501,-179 1665,-179 1665,-67 1501,-67 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge60"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title1097">main.main._check_column_usage-&gt;main.main._table_constraints</title>
-    <path
-       id="path1099"
-       d="M 1583,-183 C 1583,-240 1583,-327 1583,-398"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon1101"
-       points="1579.5,-398 1583,-408 1586.5,-398 1579.5,-398 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge62"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title1104">main.main._check_column_usage-&gt;main.main._columns</title>
-    <path
-       id="path1106"
-       d="M 1547,-183 C 1530,-206 1509,-230 1484,-246 C 1424,-284 1385,-239 1330,-282 C 1330,-282 1329,-283 1329,-283"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon1108"
-       points="1326.22,-280.781 1321,-290 1330.83,-286.049 1326.22,-280.781 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node56"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title1111">main.main._view_column_usage</title>
-    <polygon
-       id="polygon1113"
-       points="1126,-176 1126,-196 1274,-196 1274,-176 1126,-176 "
-       style="fill:#808080;stroke:#808080" />
-    <text
-       id="text1115"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-181.33299"
-       x="1200">_view_column_usage</text>
-    <polygon
-       id="polygon1117"
-       points="1126,-176 1126,-196 1274,-196 1274,-176 1126,-176 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text1119"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-162.33299"
-       x="1165">view_catalog</text>
-    <text
-       id="text1121"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-162.33299"
-       x="1262">key</text>
-    <text
-       id="text1123"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-144.33299"
-       x="1165.5">view_schema</text>
-    <text
-       id="text1125"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-144.33299"
-       x="1262">key</text>
-    <text
-       id="text1127"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-126.333"
-       x="1160">view_name</text>
-    <text
-       id="text1129"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-126.333"
-       x="1262">key</text>
-    <text
-       id="text1131"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-108.333"
-       x="1165">table_catalog</text>
-    <text
-       id="text1133"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-108.333"
-       x="1262">key</text>
-    <text
-       id="text1135"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-90.333298"
-       x="1165.5">table_schema</text>
-    <text
-       id="text1137"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-90.333298"
-       x="1262">key</text>
-    <text
-       id="text1139"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-72.333298"
-       x="1160">table_name</text>
-    <text
-       id="text1141"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-72.333298"
-       x="1262">key</text>
-    <text
-       id="text1143"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-54.333302"
-       x="1167.5">column_name</text>
-    <text
-       id="text1145"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-54.333302"
-       x="1262">key</text>
-    <polygon
-       id="polygon1147"
-       points="1125,-49 1125,-197 1275,-197 1275,-49 1125,-49 "
-       style="fill:none;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge64"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title1150">main.main._view_column_usage-&gt;main.main._views</title>
-    <path
-       id="path1152"
-       d="M 1255,-201 C 1266,-216 1279,-232 1292,-246 C 1307,-264 1317,-263 1330,-282 C 1360,-329 1379,-388 1391,-434"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon1154"
-       points="1387.61,-434.881 1393,-444 1394.47,-433.508 1387.61,-434.881 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="edge"
-     id="edge66"
-     transform="matrix(1.33333,0,0,1.33333,5.33332,2501.3271)">
-    <title
-       id="title1157">main.main._view_column_usage-&gt;main.main._columns</title>
-    <path
-       id="path1159"
-       d="M 1203,-201 C 1204,-222 1205,-246 1206,-272"
-       style="fill:none;stroke:#000000" />
-    <polygon
-       id="polygon1161"
-       points="1202.5,-272 1206,-282 1209.5,-272 1202.5,-272 "
-       style="fill:#000000;stroke:#000000" />
-  </g>
-  <g
-     class="node"
-     id="node59"
-     transform="matrix(1.33333,0,0,1.33333,-2115.9054,1960.8192)">
-    <title
-       id="title1164">main.main._detailled_fk</title>
-    <polygon
-       id="polygon1166"
-       points="2254,-203 2254,-223 2370,-223 2370,-203 2254,-203 "
-       style="fill:#ffff00;stroke:#ffff00" />
-    <text
-       id="text1168"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-208.33299"
-       x="2312">_detailled_fk</text>
-    <polygon
-       id="polygon1170"
-       points="2254,-203 2254,-223 2370,-223 2370,-203 2254,-203 "
-       style="fill:none;stroke:#000000" />
-    <text
-       id="text1172"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-189.33299"
-       x="2302.5">fk_table_catalog</text>
-    <text
-       id="text1174"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-171.33299"
-       x="2303">fk_table_schema</text>
-    <text
-       id="text1176"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-153.33299"
-       x="2297.5">fk_table_name</text>
-    <text
-       id="text1178"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-135.33299"
-       x="2286.5">fk_column</text>
-    <text
-       id="text1180"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-117.333"
-       x="2304.5">ref_table_catalog</text>
-    <text
-       id="text1182"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-99.333298"
-       x="2305">ref_table_schema</text>
-    <text
-       id="text1184"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-81.333298"
-       x="2299.5">ref_table_name</text>
-    <text
-       id="text1186"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-63.333302"
-       x="2288.5">ref_column</text>
-    <text
-       id="text1188"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-45.333302"
-       x="2311.5">fk_constraint_name</text>
-    <text
-       id="text1190"
-       style="font-size:14.17500019px;text-anchor:middle;font-family:Nimbus Roman No9 L"
-       y="-27.3333"
-       x="2302">ordinal_position</text>
-    <polygon
-       id="polygon1192"
-       points="2253,-22 2253,-224 2371,-224 2371,-22 2253,-22 "
-       style="fill:none;stroke:#000000" />
-  </g>
+<svg width="1332pt" height="712pt"
+ viewBox="0.00 0.00 1332.00 712.00" xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";>
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 708)">
+<title>G</title>
+<polygon style="fill:white;stroke:white;" points="-4,4 -4,-708 1328,-708 1328,4 -4,4"/>
+<!-- _attributes -->
+<g id="node1" class="node"><title>_attributes</title>
+<polygon style="fill:none;stroke:black;" points="1301,-144 1209,-144 1209,-108 1301,-108 1301,-144"/>
+<text text-anchor="middle" x="1255" y="-121.9" style="font-family:Times New Roman;font-size:14.00;">_attributes</text>
+</g>
+<!-- _information_schema_catalog_name -->
+<g id="node2" class="node"><title>_information_schema_catalog_name</title>
+<polygon style="fill:none;stroke:black;" points="265,-324 1,-324 1,-288 265,-288 265,-324"/>
+<text text-anchor="middle" x="133" y="-301.9" style="font-family:Times New Roman;font-size:14.00;">_information_schema_catalog_name</text>
+</g>
+<!-- _builtin_data_types -->
+<g id="node3" class="node"><title>_builtin_data_types</title>
+<polygon style="fill:none;stroke:black;" points="740,-620 590,-620 590,-584 740,-584 740,-620"/>
+<text text-anchor="middle" x="665" y="-597.9" style="font-family:Times New Roman;font-size:14.00;">_builtin_data_types</text>
+</g>
+<!-- _element_types -->
+<g id="node4" class="node"><title>_element_types</title>
+<polygon style="fill:none;stroke:black;" points="553,-420 429,-420 429,-384 553,-384 553,-420"/>
+<text text-anchor="middle" x="491" y="-397.9" style="font-family:Times New Roman;font-size:14.00;">_element_types</text>
+</g>
+<!-- _schemata -->
+<g id="node5" class="node"><title>_schemata</title>
+<polygon style="fill:none;stroke:black;" points="392,-324 302,-324 302,-288 392,-288 392,-324"/>
+<text text-anchor="middle" x="347" y="-301.9" style="font-family:Times New Roman;font-size:14.00;">_schemata</text>
+</g>
+<!-- _schemata&#45;&gt;_information_schema_catalog_name -->
+<g id="edge2" class="edge"><title>_schemata&#45;&gt;_information_schema_catalog_name</title>
+<path style="fill:none;stroke:black;" d="M302,-306C294,-306 285,-306 276,-306"/>
+<polygon style="fill:black;stroke:black;" points="276,-302.5 266,-306 276,-309.5 276,-302.5"/>
+</g>
+<!-- _udt -->
+<g id="node7" class="node"><title>_udt</title>
+<polygon style="fill:none;stroke:black;" points="518,-620 464,-620 464,-584 518,-584 518,-620"/>
+<text text-anchor="middle" x="491" y="-597.9" style="font-family:Times New Roman;font-size:14.00;">_udt</text>
+</g>
+<!-- _udt&#45;&gt;_schemata -->
+<g id="edge4" class="edge"><title>_udt&#45;&gt;_schemata</title>
+<path style="fill:none;stroke:black;" d="M478,-584C464,-565 443,-533 428,-504 398,-445 370,-373 356,-334"/>
+<polygon style="fill:black;stroke:black;" points="359.226,-332.573 353,-324 352.521,-334.584 359.226,-332.573"/>
+</g>
+<!-- _domains -->
+<g id="node9" class="node"><title>_domains</title>
+<polygon style="fill:none;stroke:black;" points="705,-512 625,-512 625,-476 705,-476 705,-512"/>
+<text text-anchor="middle" x="665" y="-489.9" style="font-family:Times New Roman;font-size:14.00;">_domains</text>
+</g>
+<!-- _domains&#45;&gt;_element_types -->
+<g id="edge8" class="edge"><title>_domains&#45;&gt;_element_types</title>
+<path style="fill:none;stroke:black;" d="M631,-476C603,-462 564,-440 534,-425"/>
+<polygon style="fill:black;stroke:black;" points="535.441,-421.797 525,-420 532.042,-427.916 535.441,-421.797"/>
+</g>
+<!-- _domains&#45;&gt;_schemata -->
+<g id="edge6" class="edge"><title>_domains&#45;&gt;_schemata</title>
+<path style="fill:none;stroke:black;" d="M624,-499C573,-503 486,-503 428,-462 384,-431 362,-369 353,-334"/>
+<polygon style="fill:black;stroke:black;" points="356.393,-333.119 351,-324 349.529,-334.492 356.393,-333.119"/>
+</g>
+<!-- _tables -->
+<g id="node12" class="node"><title>_tables</title>
+<polygon style="fill:none;stroke:black;" points="697,-144 633,-144 633,-108 697,-108 697,-144"/>
+<text text-anchor="middle" x="665" y="-121.9" style="font-family:Times New Roman;font-size:14.00;">_tables</text>
+</g>
+<!-- _tables&#45;&gt;_schemata -->
+<g id="edge10" class="edge"><title>_tables&#45;&gt;_schemata</title>
+<path style="fill:none;stroke:black;" d="M632,-122C583,-117 490,-115 428,-158 386,-187 364,-244 354,-278"/>
+<polygon style="fill:black;stroke:black;" points="350.521,-277.416 351,-288 357.226,-279.427 350.521,-277.416"/>
+</g>
+<!-- _collations -->
+<g id="node14" class="node"><title>_collations</title>
+<polygon style="fill:none;stroke:black;" points="535,-255 447,-255 447,-219 535,-219 535,-255"/>
+<text text-anchor="middle" x="491" y="-232.9" style="font-family:Times New Roman;font-size:14.00;">_collations</text>
+</g>
+<!-- _collations&#45;&gt;_schemata -->
+<g id="edge12" class="edge"><title>_collations&#45;&gt;_schemata</title>
+<path style="fill:none;stroke:black;" d="M453,-255C435,-264 413,-274 394,-284"/>
+<polygon style="fill:black;stroke:black;" points="392.717,-280.74 385,-288 395.56,-287.137 392.717,-280.74"/>
+</g>
+<!-- _routines -->
+<g id="node16" class="node"><title>_routines</title>
+<polygon style="fill:none;stroke:black;" points="531,-347 451,-347 451,-311 531,-311 531,-347"/>
+<text text-anchor="middle" x="491" y="-324.9" style="font-family:Times New Roman;font-size:14.00;">_routines</text>
+</g>
+<!-- _routines&#45;&gt;_schemata -->
+<g id="edge14" class="edge"><title>_routines&#45;&gt;_schemata</title>
+<path style="fill:none;stroke:black;" d="M450,-322C435,-320 418,-317 402,-315"/>
+<polygon style="fill:black;stroke:black;" points="402.492,-311.529 392,-313 401.119,-318.393 402.492,-311.529"/>
+</g>
+<!-- _udt_columns -->
+<g id="node18" class="node"><title>_udt_columns</title>
+<polygon style="fill:none;stroke:black;" points="720,-566 610,-566 610,-530 720,-530 720,-566"/>
+<text text-anchor="middle" x="665" y="-543.9" style="font-family:Times New Roman;font-size:14.00;">_udt_columns</text>
+</g>
+<!-- _udt_columns&#45;&gt;_element_types -->
+<g id="edge18" class="edge"><title>_udt_columns&#45;&gt;_element_types</title>
+<path style="fill:none;stroke:black;" d="M609,-532C602,-529 596,-525 590,-521 554,-496 525,-455 507,-429"/>
+<polygon style="fill:black;stroke:black;" points="509.916,-427.042 502,-420 503.797,-430.441 509.916,-427.042"/>
+</g>
+<!-- _udt_columns&#45;&gt;_udt -->
+<g id="edge16" class="edge"><title>_udt_columns&#45;&gt;_udt</title>
+<path style="fill:none;stroke:black;" d="M609,-565C583,-574 552,-583 528,-590"/>
+<polygon style="fill:black;stroke:black;" points="526.573,-586.774 518,-593 528.584,-593.479 526.573,-586.774"/>
+</g>
+<!-- _enums -->
+<g id="node21" class="node"><title>_enums</title>
+<polygon style="fill:none;stroke:black;" points="699,-674 631,-674 631,-638 699,-638 699,-674"/>
+<text text-anchor="middle" x="665" y="-651.9" style="font-family:Times New Roman;font-size:14.00;">_enums</text>
+</g>
+<!-- _enums&#45;&gt;_udt -->
+<g id="edge20" class="edge"><title>_enums&#45;&gt;_udt</title>
+<path style="fill:none;stroke:black;" d="M630,-645C600,-636 558,-623 528,-613"/>
+<polygon style="fill:black;stroke:black;" points="528.584,-609.521 518,-610 526.573,-616.226 528.584,-609.521"/>
+</g>
+<!-- _views -->
+<g id="node23" class="node"><title>_views</title>
+<polygon style="fill:none;stroke:black;" points="886,-144 824,-144 824,-108 886,-108 886,-144"/>
+<text text-anchor="middle" x="855" y="-121.9" style="font-family:Times New Roman;font-size:14.00;">_views</text>
+</g>
+<!-- _views&#45;&gt;_tables -->
+<g id="edge22" class="edge"><title>_views&#45;&gt;_tables</title>
+<path style="fill:none;stroke:black;" d="M823,-126C791,-126 743,-126 708,-126"/>
+<polygon style="fill:black;stroke:black;" points="708,-122.5 698,-126 708,-129.5 708,-122.5"/>
+</g>
+<!-- _character_sets -->
+<g id="node25" class="node"><title>_character_sets</title>
+<polygon style="fill:none;stroke:black;" points="727,-274 603,-274 603,-238 727,-238 727,-274"/>
+<text text-anchor="middle" x="665" y="-251.9" style="font-family:Times New Roman;font-size:14.00;">_character_sets</text>
+</g>
+<!-- _character_sets&#45;&gt;_schemata -->
+<g id="edge24" class="edge"><title>_character_sets&#45;&gt;_schemata</title>
+<path style="fill:none;stroke:black;" d="M603,-266C545,-274 459,-288 402,-297"/>
+<polygon style="fill:black;stroke:black;" points="401.119,-293.607 392,-299 402.492,-300.471 401.119,-293.607"/>
+</g>
+<!-- _character_sets&#45;&gt;_collations -->
+<g id="edge26" class="edge"><title>_character_sets&#45;&gt;_collations</title>
+<path style="fill:none;stroke:black;" d="M603,-249C584,-247 564,-245 545,-243"/>
+<polygon style="fill:black;stroke:black;" points="545.299,-239.512 535,-242 544.602,-246.478 545.299,-239.512"/>
+</g>
+<!-- _triggers -->
+<g id="node28" class="node"><title>_triggers</title>
+<polygon style="fill:none;stroke:black;" points="893,-198 817,-198 817,-162 893,-162 893,-198"/>
+<text text-anchor="middle" x="855" y="-175.9" style="font-family:Times New Roman;font-size:14.00;">_triggers</text>
+</g>
+<!-- _triggers&#45;&gt;_schemata -->
+<g id="edge28" class="edge"><title>_triggers&#45;&gt;_schemata</title>
+<path style="fill:none;stroke:black;" d="M816,-173C738,-161 557,-144 428,-210 398,-226 375,-256 361,-279"/>
+<polygon style="fill:black;stroke:black;" points="357.797,-277.559 356,-288 363.916,-280.958 357.797,-277.559"/>
+</g>
+<!-- _triggers&#45;&gt;_tables -->
+<g id="edge30" class="edge"><title>_triggers&#45;&gt;_tables</title>
+<path style="fill:none;stroke:black;" d="M816,-169C784,-160 740,-148 708,-138"/>
+<polygon style="fill:black;stroke:black;" points="708.584,-134.521 698,-135 706.573,-141.226 708.584,-134.521"/>
+</g>
+<!-- _table_constraints -->
+<g id="node31" class="node"><title>_table_constraints</title>
+<polygon style="fill:none;stroke:black;" points="926,-90 784,-90 784,-54 926,-54 926,-90"/>
+<text text-anchor="middle" x="855" y="-67.9" style="font-family:Times New Roman;font-size:14.00;">_table_constraints</text>
+</g>
+<!-- _table_constraints&#45;&gt;_tables -->
+<g id="edge32" class="edge"><title>_table_constraints&#45;&gt;_tables</title>
+<path style="fill:none;stroke:black;" d="M791,-90C764,-98 732,-107 708,-114"/>
+<polygon style="fill:black;stroke:black;" points="706.573,-110.774 698,-117 708.584,-117.479 706.573,-110.774"/>
+</g>
+<!-- _domain_constraints -->
+<g id="node33" class="node"><title>_domain_constraints</title>
+<polygon style="fill:none;stroke:black;" points="934,-489 776,-489 776,-453 934,-453 934,-489"/>
+<text text-anchor="middle" x="855" y="-466.9" style="font-family:Times New Roman;font-size:14.00;">_domain_constraints</text>
+</g>
+<!-- _domain_constraints&#45;&gt;_schemata -->
+<g id="edge36" class="edge"><title>_domain_constraints&#45;&gt;_schemata</title>
+<path style="fill:none;stroke:black;" d="M776,-467C660,-460 456,-446 428,-429 391,-408 368,-363 357,-334"/>
+<polygon style="fill:black;stroke:black;" points="359.964,-331.985 353,-324 353.464,-334.585 359.964,-331.985"/>
+</g>
+<!-- _domain_constraints&#45;&gt;_domains -->
+<g id="edge34" class="edge"><title>_domain_constraints&#45;&gt;_domains</title>
+<path style="fill:none;stroke:black;" d="M776,-481C756,-484 734,-486 716,-488"/>
+<polygon style="fill:black;stroke:black;" points="715.602,-484.522 706,-489 716.299,-491.488 715.602,-484.522"/>
+</g>
+<!-- _parameters -->
+<g id="node36" class="node"><title>_parameters</title>
+<polygon style="fill:none;stroke:black;" points="716,-382 614,-382 614,-346 716,-346 716,-382"/>
+<text text-anchor="middle" x="665" y="-359.9" style="font-family:Times New Roman;font-size:14.00;">_parameters</text>
+</g>
+<!-- _parameters&#45;&gt;_element_types -->
+<g id="edge40" class="edge"><title>_parameters&#45;&gt;_element_types</title>
+<path style="fill:none;stroke:black;" d="M614,-375C598,-378 580,-382 564,-386"/>
+<polygon style="fill:black;stroke:black;" points="563.119,-382.607 554,-388 564.492,-389.471 563.119,-382.607"/>
+</g>
+<!-- _parameters&#45;&gt;_routines -->
+<g id="edge38" class="edge"><title>_parameters&#45;&gt;_routines</title>
+<path style="fill:none;stroke:black;" d="M614,-354C591,-349 564,-344 542,-339"/>
+<polygon style="fill:black;stroke:black;" points="542.492,-335.529 532,-337 541.119,-342.393 542.492,-335.529"/>
+</g>
+<!-- _routine_columns -->
+<g id="node39" class="node"><title>_routine_columns</title>
+<polygon style="fill:none;stroke:black;" points="734,-328 596,-328 596,-292 734,-292 734,-328"/>
+<text text-anchor="middle" x="665" y="-305.9" style="font-family:Times New Roman;font-size:14.00;">_routine_columns</text>
+</g>
+<!-- _routine_columns&#45;&gt;_element_types -->
+<g id="edge44" class="edge"><title>_routine_columns&#45;&gt;_element_types</title>
+<path style="fill:none;stroke:black;" d="M610,-328C603,-331 596,-334 590,-337 566,-348 542,-365 524,-378"/>
+<polygon style="fill:black;stroke:black;" points="521.379,-375.541 515,-384 525.262,-381.365 521.379,-375.541"/>
+</g>
+<!-- _routine_columns&#45;&gt;_routines -->
+<g id="edge42" class="edge"><title>_routine_columns&#45;&gt;_routines</title>
+<path style="fill:none;stroke:black;" d="M596,-318C578,-320 559,-322 542,-324"/>
+<polygon style="fill:black;stroke:black;" points="541.602,-320.522 532,-325 542.299,-327.488 541.602,-320.522"/>
+</g>
+<!-- _table_indexes -->
+<g id="node42" class="node"><title>_table_indexes</title>
+<polygon style="fill:none;stroke:black;" points="913,-36 797,-36 797,-1.77636e-14 913,-3.55271e-15 913,-36"/>
+<text text-anchor="middle" x="855" y="-13.9" style="font-family:Times New Roman;font-size:14.00;">_table_indexes</text>
+</g>
+<!-- _table_indexes&#45;&gt;_tables -->
+<g id="edge46" class="edge"><title>_table_indexes&#45;&gt;_tables</title>
+<path style="fill:none;stroke:black;" d="M796,-36C789,-39 782,-42 776,-45 746,-61 715,-84 694,-102"/>
+<polygon style="fill:black;stroke:black;" points="691.9,-99.2 686,-108 696.1,-104.8 691.9,-99.2"/>
+</g>
+<!-- _all_types -->
+<g id="node44" class="node"><title>_all_types</title>
+<ellipse style="fill:none;stroke:black;" cx="855" cy="-602" rx="57.8712" ry="18"/>
+<text text-anchor="middle" x="855" y="-597.9" style="font-family:Times New Roman;font-size:14.00;">_all_types</text>
+</g>
+<!-- _all_types&#45;&gt;_builtin_data_types -->
+<g id="edge48" class="edge"><title>_all_types&#45;&gt;_builtin_data_types</title>
+<path style="fill:none;stroke:black;" d="M796,-602C781,-602 766,-602 750,-602"/>
+<polygon style="fill:black;stroke:black;" points="750,-598.5 740,-602 750,-605.5 750,-598.5"/>
+</g>
+<!-- _all_types&#45;&gt;_udt -->
+<g id="edge50" class="edge"><title>_all_types&#45;&gt;_udt</title>
+<path style="fill:none;stroke:black;" d="M838,-619C817,-639 779,-670 740,-683 676,-703 652,-705 590,-683 559,-672 531,-647 513,-627"/>
+<polygon style="fill:black;stroke:black;" points="515.546,-624.596 506,-620 510.596,-629.546 515.546,-624.596"/>
+</g>
+<!-- _all_types&#45;&gt;_domains -->
+<g id="edge52" class="edge"><title>_all_types&#45;&gt;_domains</title>
+<path style="fill:none;stroke:black;" d="M835,-585C813,-567 775,-539 740,-521 732,-517 724,-513 715,-510"/>
+<polygon style="fill:black;stroke:black;" points="716.56,-506.863 706,-506 713.717,-513.26 716.56,-506.863"/>
+</g>
+<!-- _columns -->
+<g id="node48" class="node"><title>_columns</title>
+<polygon style="fill:none;stroke:black;" points="895,-252 815,-252 815,-216 895,-216 895,-252"/>
+<text text-anchor="middle" x="855" y="-229.9" style="font-family:Times New Roman;font-size:14.00;">_columns</text>
+</g>
+<!-- _columns&#45;&gt;_element_types -->
+<g id="edge60" class="edge"><title>_columns&#45;&gt;_element_types</title>
+<path style="fill:none;stroke:black;" d="M848,-252C834,-287 797,-360 740,-391 686,-420 615,-420 564,-415"/>
+<polygon style="fill:black;stroke:black;" points="564.299,-411.512 554,-414 563.602,-418.478 564.299,-411.512"/>
+</g>
+<!-- _columns&#45;&gt;_tables -->
+<g id="edge54" class="edge"><title>_columns&#45;&gt;_tables</title>
+<path style="fill:none;stroke:black;" d="M815,-223C802,-219 788,-214 776,-207 746,-191 715,-168 694,-150"/>
+<polygon style="fill:black;stroke:black;" points="696.1,-147.2 686,-144 691.9,-152.8 696.1,-147.2"/>
+</g>
+<!-- _columns&#45;&gt;_collations -->
+<g id="edge58" class="edge"><title>_columns&#45;&gt;_collations</title>
+<path style="fill:none;stroke:black;" d="M815,-232C763,-230 669,-226 590,-229 576,-230 560,-231 545,-232"/>
+<polygon style="fill:black;stroke:black;" points="544.602,-228.522 535,-233 545.299,-235.488 544.602,-228.522"/>
+</g>
+<!-- _columns&#45;&gt;_character_sets -->
+<g id="edge56" class="edge"><title>_columns&#45;&gt;_character_sets</title>
+<path style="fill:none;stroke:black;" d="M815,-239C792,-242 763,-245 737,-248"/>
+<polygon style="fill:black;stroke:black;" points="736.602,-244.522 727,-249 737.299,-251.488 736.602,-244.522"/>
+</g>
+<!-- _referential_constraints -->
+<g id="node53" class="node"><title>_referential_constraints</title>
+<polygon style="fill:none;stroke:black;" points="1150,-90 970,-90 970,-54 1150,-54 1150,-90"/>
+<text text-anchor="middle" x="1060" y="-67.9" style="font-family:Times New Roman;font-size:14.00;">_referential_constraints</text>
+</g>
+<!-- _referential_constraints&#45;&gt;_table_constraints -->
+<g id="edge62" class="edge"><title>_referential_constraints&#45;&gt;_table_constraints</title>
+<path style="fill:none;stroke:black;" d="M970,-65C959,-65 947,-65 936,-65"/>
+<polygon style="fill:black;stroke:black;" points="936,-61.5001 926,-65 936,-68.5001 936,-61.5001"/>
+</g>
+<!-- _referential_constraints&#45;&gt;_table_constraints -->
+<g id="edge64" class="edge"><title>_referential_constraints&#45;&gt;_table_constraints</title>
+<path style="fill:none;stroke:black;" d="M970,-79C959,-79 947,-79 936,-79"/>
+<polygon style="fill:black;stroke:black;" points="936,-75.5001 926,-79 936,-82.5001 936,-75.5001"/>
+</g>
+<!-- _index_column_usage -->
+<g id="node56" class="node"><title>_index_column_usage</title>
+<polygon style="fill:none;stroke:black;" points="1143,-36 977,-36 977,-1.77636e-14 1143,-3.55271e-15 1143,-36"/>
+<text text-anchor="middle" x="1060" y="-13.9" style="font-family:Times New Roman;font-size:14.00;">_index_column_usage</text>
+</g>
+<!-- _index_column_usage&#45;&gt;_table_indexes -->
+<g id="edge66" class="edge"><title>_index_column_usage&#45;&gt;_table_indexes</title>
+<path style="fill:none;stroke:black;" d="M977,-18C960,-18 941,-18 924,-18"/>
+<polygon style="fill:black;stroke:black;" points="924,-14.5001 914,-18 924,-21.5001 924,-14.5001"/>
+</g>
+<!-- _key_column_usage -->
+<g id="node58" class="node"><title>_key_column_usage</title>
+<polygon style="fill:none;stroke:black;" points="1136,-198 984,-198 984,-162 1136,-162 1136,-198"/>
+<text text-anchor="middle" x="1060" y="-175.9" style="font-family:Times New Roman;font-size:14.00;">_key_column_usage</text>
+</g>
+<!-- _key_column_usage&#45;&gt;_table_constraints -->
+<g id="edge68" class="edge"><title>_key_column_usage&#45;&gt;_table_constraints</title>
+<path style="fill:none;stroke:black;" d="M984,-162C979,-159 974,-156 970,-153 946,-136 956,-117 934,-99 932,-98 930,-97 928,-95"/>
+<polygon style="fill:black;stroke:black;" points="929.441,-91.7969 919,-90 926.042,-97.916 929.441,-91.7969"/>
+</g>
+<!-- _key_column_usage&#45;&gt;_columns -->
+<g id="edge70" class="edge"><title>_key_column_usage&#45;&gt;_columns</title>
+<path style="fill:none;stroke:black;" d="M991,-198C963,-206 931,-214 905,-221"/>
+<polygon style="fill:black;stroke:black;" points="903.573,-217.774 895,-224 905.584,-224.479 903.573,-217.774"/>
+</g>
+<!-- _check_column_usage -->
+<g id="node61" class="node"><title>_check_column_usage</title>
+<polygon style="fill:none;stroke:black;" points="1144,-144 976,-144 976,-108 1144,-108 1144,-144"/>
+<text text-anchor="middle" x="1060" y="-121.9" style="font-family:Times New Roman;font-size:14.00;">_check_column_usage</text>
+</g>
+<!-- _check_column_usage&#45;&gt;_table_constraints -->
+<g id="edge72" class="edge"><title>_check_column_usage&#45;&gt;_table_constraints</title>
+<path style="fill:none;stroke:black;" d="M991,-108C972,-103 953,-98 934,-93"/>
+<polygon style="fill:black;stroke:black;" points="934.584,-89.5212 924,-90 932.573,-96.2259 934.584,-89.5212"/>
+</g>
+<!-- _check_column_usage&#45;&gt;_columns -->
+<g id="edge74" class="edge"><title>_check_column_usage&#45;&gt;_columns</title>
+<path style="fill:none;stroke:black;" d="M985,-144C980,-147 975,-150 970,-153 946,-171 956,-190 934,-207 926,-214 915,-219 905,-223"/>
+<polygon style="fill:black;stroke:black;" points="903.573,-219.774 895,-226 905.584,-226.479 903.573,-219.774"/>
+</g>
+<!-- _view_column_usage -->
+<g id="node64" class="node"><title>_view_column_usage</title>
+<polygon style="fill:none;stroke:black;" points="1141,-252 979,-252 979,-216 1141,-216 1141,-252"/>
+<text text-anchor="middle" x="1060" y="-229.9" style="font-family:Times New Roman;font-size:14.00;">_view_column_usage</text>
+</g>
+<!-- _view_column_usage&#45;&gt;_views -->
+<g id="edge76" class="edge"><title>_view_column_usage&#45;&gt;_views</title>
+<path style="fill:none;stroke:black;" d="M984,-216C979,-213 974,-210 970,-207 946,-190 956,-171 934,-153 923,-145 909,-139 897,-135"/>
+<polygon style="fill:black;stroke:black;" points="897.584,-131.521 887,-132 895.573,-138.226 897.584,-131.521"/>
+</g>
+<!-- _view_column_usage&#45;&gt;_columns -->
+<g id="edge78" class="edge"><title>_view_column_usage&#45;&gt;_columns</title>
+<path style="fill:none;stroke:black;" d="M979,-234C954,-234 927,-234 905,-234"/>
+<polygon style="fill:black;stroke:black;" points="905,-230.5 895,-234 905,-237.5 905,-230.5"/>
+</g>
+<!-- _detailed_fk -->
+<g id="node67" class="node"><title>_detailed_fk</title>
+<ellipse style="fill:none;stroke:black;" cx="1255" cy="-180" rx="68.7933" ry="18"/>
+<text text-anchor="middle" x="1255" y="-175.9" style="font-family:Times New Roman;font-size:14.00;">_detailed_fk</text>
+</g>
+<!-- _detailed_fk&#45;&gt;_referential_constraints -->
+<g id="edge80" class="edge"><title>_detailed_fk&#45;&gt;_referential_constraints</title>
+<path style="fill:none;stroke:black;" d="M1208,-167C1200,-163 1193,-158 1186,-153 1163,-135 1173,-117 1150,-99 1148,-98 1146,-97 1144,-95"/>
+<polygon style="fill:black;stroke:black;" points="1145.44,-91.7969 1135,-90 1142.04,-97.916 1145.44,-91.7969"/>
+</g>
+<!-- _detailed_fk&#45;&gt;_key_column_usage -->
+<g id="edge82" class="edge"><title>_detailed_fk&#45;&gt;_key_column_usage</title>
+<path style="fill:none;stroke:black;" d="M1190,-174C1176,-173 1161,-173 1147,-173"/>
+<polygon style="fill:black;stroke:black;" points="1147,-169.5 1137,-173 1147,-176.5 1147,-169.5"/>
+</g>
+<!-- _detailed_fk&#45;&gt;_key_column_usage -->
+<g id="edge84" class="edge"><title>_detailed_fk&#45;&gt;_key_column_usage</title>
+<path style="fill:none;stroke:black;" d="M1190,-186C1176,-187 1161,-187 1147,-187"/>
+<polygon style="fill:black;stroke:black;" points="1147,-183.5 1137,-187 1147,-190.5 1147,-183.5"/>
+</g>
+</g>
 </svg>
diff --git a/doc/C/libgda-4.0-docs.sgml b/doc/C/libgda-4.0-docs.sgml
index 23b2e9e..c763fee 100644
--- a/doc/C/libgda-4.0-docs.sgml
+++ b/doc/C/libgda-4.0-docs.sgml
@@ -901,7 +901,7 @@ g_object_unref (store);
 	  defined by &LIBGDA; for its internal needs:
 	  <mediaobject>
 	    <imageobject role="html">
-	      <imagedata fileref="information_schema.png" format="PNG"/>
+	      <imagedata fileref="information_schema.png" format="PNG" contentwidth="210mm"/>
 	    </imageobject>
 	    <textobject>
 	      <phrase>Dictionary's tables and views initially defined by &LIBGDA;</phrase>
diff --git a/doc/C/tmpl/gda-server-provider.sgml b/doc/C/tmpl/gda-server-provider.sgml
index 0694cc0..7422883 100644
--- a/doc/C/tmpl/gda-server-provider.sgml
+++ b/doc/C/tmpl/gda-server-provider.sgml
@@ -145,10 +145,10 @@ for more information.
 @routine_col: 
 @_routine_par: 
 @routine_par: 
- _gda_reserved1: 
- _gda_reserved2: 
- _gda_reserved3: 
- _gda_reserved4: 
+ _indexes_tab: 
+ indexes_tab: 
+ _index_cols: 
+ index_cols: 
 @_gda_reserved5: 
 @_gda_reserved6: 
 @_gda_reserved7: 
diff --git a/libgda/gda-connection.c b/libgda/gda-connection.c
index ec2d580..99db018 100644
--- a/libgda/gda-connection.c
+++ b/libgda/gda-connection.c
@@ -2600,18 +2600,45 @@ local_meta_update (GdaServerProvider *provider, GdaConnection *cnc, GdaMetaConte
 		break;
 
 	case 'i':
-		/* _information_schema_catalog_name, params: 
-		 *  - none
-		 */
-		ASSERT_TABLE_NAME (tname, "information_schema_catalog_name");
-		if (!PROV_CLASS (provider)->meta_funcs._info) {
-			WARN_METHOD_NOT_IMPLEMENTED (provider, "_info");
-			break;
+		if ((tname[1] == 'n') && (tname[2] == 'f')) {
+			/* _information_schema_catalog_name, params: 
+			 *  - none
+			 */
+			ASSERT_TABLE_NAME (tname, "information_schema_catalog_name");
+			if (!PROV_CLASS (provider)->meta_funcs._info) {
+				WARN_METHOD_NOT_IMPLEMENTED (provider, "_info");
+				break;
+			}
+			retval = PROV_CLASS (provider)->meta_funcs._info (provider, cnc, store, context, error);
+			WARN_META_UPDATE_FAILURE (retval, "_info");
+			return retval;
 		}
-		retval = PROV_CLASS (provider)->meta_funcs._info (provider, cnc, store, context, error);
-		WARN_META_UPDATE_FAILURE (retval, "_info");
-		return retval;
+		else {
+			/* _index_column_usage, params: 
+			 *  -0- @table_catalog, @table_schema, @table_name, @index_name
+			 */
+			const GValue *iname = NULL;
+			i = check_parameters (context, error, 1,
+					      &catalog, G_TYPE_STRING,
+					      &schema, G_TYPE_STRING,
+					      &name, G_TYPE_STRING,
+					      &iname, G_TYPE_STRING, NULL,
+					      "table_catalog", &catalog, "table_schema", &schema, "table_name", &name, "index_name", &iname, NULL);
 
+			if (i < 0)
+				return FALSE;
+			
+			ASSERT_TABLE_NAME (tname, "index_column_usage");
+			if (!PROV_CLASS (provider)->meta_funcs.index_cols) {
+				WARN_METHOD_NOT_IMPLEMENTED (provider, "index_cols");
+				break;
+			}
+			retval = PROV_CLASS (provider)->meta_funcs.index_cols (provider, cnc, store, context, error,
+									       catalog, schema, name, iname);
+			WARN_META_UPDATE_FAILURE (retval, "index_cols");
+			return retval;
+		}
+		break;
 	case 'k': {
 		/* _key_column_usage, params: 
 		 *  -0- @table_catalog, @table_schema, @table_name, @constraint_name
@@ -2828,7 +2855,36 @@ local_meta_update (GdaServerProvider *provider, GdaConnection *cnc, GdaMetaConte
 			WARN_META_UPDATE_FAILURE (retval, "constraints_tab");
 			return retval;
 		}
-		if ((tname[1] == 'r') && (tname[2] == 'i')) {
+		else if ((tname[1] == 'a') && (tname[2] == 'b') && (tname[3] == 'l') && (tname[4] == 'e') && 
+			 (tname[5] == '_') && (tname[6] == 'i')) {
+			/* _table_indexes, params: 
+			 *  -0- @table_catalog, @table_schema, @table_name, @index_name
+			 *  -1- @table_catalog, @table_schema, @table_name
+			 */
+			const GValue *iname = NULL;
+			const GValue *tabname = NULL;
+			i = check_parameters (context, error, 2,
+					      &catalog, G_TYPE_STRING,
+					      &schema, G_TYPE_STRING,
+					      &iname, G_TYPE_STRING,
+					      &tabname, G_TYPE_STRING, NULL,
+					      "table_catalog", &catalog, "table_schema", &schema, "table_name", &tabname, "index_name", &iname, NULL,
+					      "table_catalog", &catalog, "table_schema", &schema, "table_name", &tabname, NULL);
+
+			if (i < 0)
+				return FALSE;
+			
+			ASSERT_TABLE_NAME (tname, "table_indexes");
+			if (!PROV_CLASS (provider)->meta_funcs.indexes_tab) {
+				WARN_METHOD_NOT_IMPLEMENTED (provider, "indexes_tab");
+				break;
+			}
+			retval = PROV_CLASS (provider)->meta_funcs.indexes_tab (provider, cnc, store, context, error,
+										catalog, schema, tabname, iname);
+			WARN_META_UPDATE_FAILURE (retval, "indexes_tab");
+			return retval;
+		}
+		else if ((tname[1] == 'r') && (tname[2] == 'i')) {
 			/* _triggers,  params: 
 			 *  -0- @trigger_catalog, @trigger_schema
 			 *  -1- @event_object_catalog, @event_object_schema, @event_object_table
@@ -3236,7 +3292,9 @@ gda_connection_update_meta_store (GdaConnection *cnc, GdaMetaContext *context, G
 			{"_triggers", "_triggers", NULL},
 			{"_routines", "_routines", NULL},
 			{"_routine_columns", "_routine_col", NULL},
-			{"_parameters", "_routine_par", NULL}
+			{"_parameters", "_routine_par", NULL},
+			{"_table_indexes", "_indexes_tab", NULL},
+			{"_index_column_usage", "_index_cols", NULL}
 		};
 		GdaServerProvider *provider = cnc->priv->provider_obj;
 		gboolean retval;
@@ -3262,6 +3320,8 @@ gda_connection_update_meta_store (GdaConnection *cnc, GdaMetaContext *context, G
 		rmeta [nb++].func = PROV_CLASS (provider)->meta_funcs._routines;
 		rmeta [nb++].func = PROV_CLASS (provider)->meta_funcs._routine_col;
 		rmeta [nb++].func = PROV_CLASS (provider)->meta_funcs._routine_par;
+		rmeta [nb++].func = PROV_CLASS (provider)->meta_funcs._indexes_tab;
+		rmeta [nb++].func = PROV_CLASS (provider)->meta_funcs._index_cols;
 		g_assert (nb == sizeof (rmeta) / sizeof (RMeta));
 
 		if (! _gda_meta_store_begin_data_reset (store, error)) {
diff --git a/libgda/gda-meta-store.c b/libgda/gda-meta-store.c
index d947487..947a1e2 100644
--- a/libgda/gda-meta-store.c
+++ b/libgda/gda-meta-store.c
@@ -19,6 +19,18 @@
  */
 
 #undef GDA_DISABLE_DEPRECATED
+
+/*
+ * Note about schema versions:
+ * Each time the schema evolves:
+ *  - the schema is backward compatible so it can be used by older versions of Libgda
+ *  - it does not modify any table or view not starting with a '_'
+ *  - the version number is increased by 1:
+ *      version 1 for libgda between 4.0.0 and 4.1.3
+ *      version 2 for libgda >= 4.1.4: added the "_table_indexes" and "_index_column_usage" tables
+ */
+#define CURRENT_SCHEMA_VERSION "2"
+
 #include <string.h>
 #include <glib/gi18n-lib.h>
 #include <libgda/gda-meta-store.h>
@@ -73,6 +85,7 @@ static GStaticRecMutex init_mutex = G_STATIC_REC_MUTEX_INIT;
 enum {
 	STMT_GET_VERSION,
 	STMT_SET_VERSION,
+	STMT_UPD_VERSION,
 	STMT_DEL_ATT_VALUE,
 	STMT_SET_ATT_VALUE,
 	STMT_LAST
@@ -210,6 +223,7 @@ struct _GdaMetaStorePrivate {
 	GdaSqlIdentifierStyle ident_style;
 	GdaSqlReservedKeywordsFunc reserved_keyword_func;
 
+	GError        *init_error;
 	gint           version;
 	gboolean       schema_ok;
 
@@ -361,12 +375,12 @@ gda_meta_store_class_init (GdaMetaStoreClass *klass)
 	 **/
 	gda_meta_store_signals[SUGGEST_UPDATE] =
 		g_signal_new ("suggest-update",
-		G_TYPE_FROM_CLASS (object_class),
-		G_SIGNAL_RUN_LAST,
-		G_STRUCT_OFFSET (GdaMetaStoreClass, suggest_update),
-		suggest_update_accumulator, NULL,
-		_gda_marshal_ERROR__METACONTEXT, GDA_TYPE_ERROR,
-		1, GDA_TYPE_META_CONTEXT);
+			      G_TYPE_FROM_CLASS (object_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (GdaMetaStoreClass, suggest_update),
+			      suggest_update_accumulator, NULL,
+			      _gda_marshal_ERROR__METACONTEXT, GDA_TYPE_ERROR,
+			      1, GDA_TYPE_META_CONTEXT);
 	/**
 	 * GdaMetaStore::meta-changed
 	 * @store: the #GdaMetaStore instance that emitted the signal
@@ -376,12 +390,12 @@ gda_meta_store_class_init (GdaMetaStoreClass *klass)
 	 */
 	gda_meta_store_signals[META_CHANGED] =
 		g_signal_new ("meta-changed",
-		G_TYPE_FROM_CLASS (object_class),
-		G_SIGNAL_RUN_FIRST,
-		G_STRUCT_OFFSET (GdaMetaStoreClass, meta_changed),
-		NULL, NULL,
-		_gda_marshal_VOID__SLIST, G_TYPE_NONE,
-		1, GDA_TYPE_SLIST);
+			      G_TYPE_FROM_CLASS (object_class),
+			      G_SIGNAL_RUN_FIRST,
+			      G_STRUCT_OFFSET (GdaMetaStoreClass, meta_changed),
+			      NULL, NULL,
+			      _gda_marshal_VOID__SLIST, G_TYPE_NONE,
+			      1, GDA_TYPE_SLIST);
 	/**
 	 * GdaMetaStore::meta-reset
 	 * @store: the #GdaMetaStore instance that emitted the signal
@@ -391,11 +405,11 @@ gda_meta_store_class_init (GdaMetaStoreClass *klass)
 	 */
 	gda_meta_store_signals[META_RESET] =
 		g_signal_new ("meta-reset",
-		G_TYPE_FROM_CLASS (object_class),
-		G_SIGNAL_RUN_FIRST,
-		G_STRUCT_OFFSET (GdaMetaStoreClass, meta_reset),
-		NULL, NULL,
-		_gda_marshal_VOID__VOID, G_TYPE_NONE, 0);
+			      G_TYPE_FROM_CLASS (object_class),
+			      G_SIGNAL_RUN_FIRST,
+			      G_STRUCT_OFFSET (GdaMetaStoreClass, meta_reset),
+			      NULL, NULL,
+			      _gda_marshal_VOID__VOID, G_TYPE_NONE, 0);
 	
 	klass->suggest_update = m_suggest_update;
 	klass->meta_changed = NULL;
@@ -405,17 +419,17 @@ gda_meta_store_class_init (GdaMetaStoreClass *klass)
 	object_class->set_property = gda_meta_store_set_property;
 	object_class->get_property = gda_meta_store_get_property;
 	g_object_class_install_property (object_class, PROP_CNC_STRING,
-		g_param_spec_string ("cnc-string", NULL, _ ("Connection string for the internal connection to use"), NULL,
-		(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)));
+					 g_param_spec_string ("cnc-string", NULL, _ ("Connection string for the internal connection to use"), NULL,
+							      (G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)));
 	g_object_class_install_property (object_class, PROP_CNC_OBJECT,
-		g_param_spec_object ("cnc", NULL, _ ("Connection object internally used"), GDA_TYPE_CONNECTION,
-		(G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)));
+					 g_param_spec_object ("cnc", NULL, _ ("Connection object internally used"), GDA_TYPE_CONNECTION,
+							      (G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)));
 	g_object_class_install_property (object_class, PROP_CATALOG,
-		g_param_spec_string ("catalog", NULL, _ ("Catalog in which the database objects will be created"), NULL,
-		(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)));
+					 g_param_spec_string ("catalog", NULL, _ ("Catalog in which the database objects will be created"), NULL,
+							      (G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)));
 	g_object_class_install_property (object_class, PROP_SCHEMA,
-		g_param_spec_string ("schema", NULL, _ ("Schema in which the database objects will be created"), NULL,
-		(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)));
+					 g_param_spec_string ("schema", NULL, _ ("Schema in which the database objects will be created"), NULL,
+							      (G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)));
 	
 	object_class->constructor = gda_meta_store_constructor;
 	object_class->dispose = gda_meta_store_dispose;
@@ -432,7 +446,10 @@ gda_meta_store_class_init (GdaMetaStoreClass *klass)
 
 	klass->cpriv->prep_stmts[STMT_SET_VERSION] =
 		compute_prepared_stmt (klass->cpriv->parser, 
-				       "INSERT INTO _attributes (att_name, att_value) VALUES ('_schema_version', '1')");
+				       "INSERT INTO _attributes (att_name, att_value) VALUES ('_schema_version', ##version::string)");
+	klass->cpriv->prep_stmts[STMT_UPD_VERSION] =
+		compute_prepared_stmt (klass->cpriv->parser, 
+				       "UPDATE _attributes SET att_value = ##version::string WHERE att_name = '_schema_version'");
 	klass->cpriv->prep_stmts[STMT_GET_VERSION] =
 		compute_prepared_stmt (klass->cpriv->parser, 
 				       "SELECT att_value FROM _attributes WHERE att_name='_schema_version'");
@@ -443,12 +460,12 @@ gda_meta_store_class_init (GdaMetaStoreClass *klass)
 		compute_prepared_stmt (klass->cpriv->parser, 
 				       "INSERT INTO _attributes VALUES (##name::string, ##value::string::null)");
 
-/*#define GDA_DEBUG_GRAPH*/
+#define GDA_DEBUG_GRAPH
 #ifdef GDA_DEBUG_GRAPH
 #define INFORMATION_SCHEMA_GRAPH_FILE "information_schema.dot"
 	GString *string;
 	GSList *list;
-	string = g_string_new ("digraph G {\nrankdir = BT;\nnode [shape = box];\n");
+	string = g_string_new ("digraph G {\nrankdir = RL;\nnode [shape = box];\n");
 	for (list = klass->cpriv->db_objects; list; list = list->next) {
 		DbObject *dbo = (DbObject*) list->data;
 		switch (dbo->obj_type) {
@@ -495,6 +512,8 @@ gda_meta_store_init (GdaMetaStore *store)
 	store->priv->ident_style = GDA_SQL_IDENTIFIERS_LOWER_CASE;
 	store->priv->reserved_keyword_func = NULL;
 	store->priv->schema_ok = FALSE;
+
+	store->priv->init_error = NULL;
 	store->priv->version = 0;
 
 	store->priv->catalog = NULL;
@@ -517,14 +536,13 @@ gda_meta_store_constructor (GType type,
 {
 	GObject *object;
 	gint i;
-	GError *error = NULL;
 	GdaMetaStore *store;
 	gboolean been_specified = FALSE;
 	
 	g_static_rec_mutex_lock (&init_mutex);
 	object = G_OBJECT_CLASS (parent_class)->constructor (type,
-		n_construct_properties,
-		construct_properties);
+							     n_construct_properties,
+							     construct_properties);
 	for (i = 0; i< n_construct_properties; i++) {
 		GObjectConstructParam *prop = &(construct_properties[i]);
 		if (!strcmp (g_param_spec_get_name (prop->pspec), "cnc-string")) {
@@ -542,19 +560,16 @@ gda_meta_store_constructor (GType type,
 		/* in memory DB */
 		g_object_set (object, "cnc-string", "SQLite://DB_DIR=.;DB_NAME=__gda_tmp", NULL);
 	
-	if (store->priv->cnc) {
-		store->priv->schema_ok = initialize_cnc_struct (store, &error);
-		if (! store->priv->schema_ok) {
-			g_warning ("GdaMetaStore not initialized, reported error is: %s\n",
-				   error && error->message ? error->message : _ ("No detail"));
-			if (error)
-				g_error_free (error);
-		}
-	}
+	if (store->priv->cnc)
+		store->priv->schema_ok = initialize_cnc_struct (store, &(store->priv->init_error));
 
 	/* create a local copy of all the DbObject structures defined in klass->cpriv */
 	if (store->priv->catalog && !store->priv->schema) {
-		g_warning (_("Catalog specified but no schema specified, store will not be useable"));
+		if (! store->priv->init_error)
+			g_set_error (&(store->priv->init_error), GDA_META_STORE_ERROR,
+				     GDA_META_STORE_INCORRECT_SCHEMA_ERROR,
+				     "%s",
+				     _("Catalog specified but no schema specified, store will not be usable"));
 		store->priv->schema_ok = FALSE;
 	}
 	else {
@@ -685,6 +700,9 @@ gda_meta_store_finalize (GObject *object)
 	
 	store = GDA_META_STORE (object);
 	if (store->priv) {
+		if (store->priv->init_error)
+			g_error_free (store->priv->init_error);
+
 		g_free (store->priv);
 		store->priv = NULL;
 	}
@@ -837,15 +855,24 @@ initialize_cnc_struct (GdaMetaStore *store, GError **error)
 	if (!allok)
 		return FALSE;
 
-	/* set version info, version 1 for now */
+	/* set version info to CURRENT_SCHEMA_VERSION */
+	GdaSet *params;
+	if (! gda_statement_get_parameters (klass->cpriv->prep_stmts[STMT_SET_VERSION], &params, NULL)) {
+		g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_INCORRECT_SCHEMA_ERROR,
+			     "%s", _ ("Could not set the internal schema's version"));
+		return FALSE;
+	}
+	g_assert (gda_set_set_holder_value (params, NULL, "version", CURRENT_SCHEMA_VERSION));
 	if (gda_connection_statement_execute_non_select (store->priv->cnc,
 							 klass->cpriv->prep_stmts[STMT_SET_VERSION],
-							 NULL, NULL, NULL) == -1) {
+							 params, NULL, NULL) == -1) {
+		g_object_unref (params);
 		g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_INCORRECT_SCHEMA_ERROR,
-			"%s", _ ("Could not set the internal schema's version"));
+			     "%s", _ ("Could not set the internal schema's version"));
 		return FALSE;
 	}
-	
+	g_object_unref (params);
+
 	return handle_schema_version (store, NULL, error);
 }
 
@@ -1235,7 +1262,7 @@ create_view_object (GdaMetaStoreClass *klass, GdaMetaStore *store, xmlNodePtr no
 	}
 	return dbobj;
 	
-onerror:
+ onerror:
 	db_object_free (dbobj);
 	return NULL;	
 }
@@ -1532,7 +1559,7 @@ create_table_object (GdaMetaStoreClass *klass, GdaMetaStore *store, xmlNodePtr n
 				ref_obj->obj_name = g_strdup ((gchar *) ref_table);
 				if (store) {
 					store->priv->p_db_objects = g_slist_prepend (store->priv->p_db_objects, 
-											  ref_obj);
+										     ref_obj);
 					g_hash_table_insert (store->priv->p_db_objects_hash, ref_obj->obj_name, 
 							     ref_obj);
 				}
@@ -1726,7 +1753,7 @@ compute_view_dependencies (GdaMetaStoreClass *klass, GdaMetaStore *store,
 				ref_obj->obj_name = g_strdup (t->table_name);
 				if (store) {
 					store->priv->p_db_objects = g_slist_prepend (store->priv->p_db_objects, 
-											  ref_obj);
+										     ref_obj);
 					g_hash_table_insert (store->priv->p_db_objects_hash, ref_obj->obj_name, 
 							     ref_obj);
 				}
@@ -1946,9 +1973,120 @@ table_fkey_free (TableFKey *tfk)
 	g_free (tfk);
 }
 
+static gboolean
+update_schema_version (GdaMetaStore *store, const gchar *version, GError **error)
+{
+	GdaSet *params;
+	GdaMetaStoreClass *klass;
+	klass = (GdaMetaStoreClass *) G_OBJECT_GET_CLASS (store);
+
+	if (! gda_statement_get_parameters (klass->cpriv->prep_stmts[STMT_UPD_VERSION], &params, NULL)) {
+		g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_INCORRECT_SCHEMA_ERROR,
+			     "%s", _ ("Could not set the internal schema's version"));
+		return FALSE;
+	}
+	g_assert (gda_set_set_holder_value (params, NULL, "version", CURRENT_SCHEMA_VERSION));
+	if (gda_connection_statement_execute_non_select (store->priv->cnc,
+							 klass->cpriv->prep_stmts[STMT_UPD_VERSION],
+							 params, NULL, NULL) == -1) {
+		g_object_unref (params);
+		g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_INCORRECT_SCHEMA_ERROR,
+			     "%s", _ ("Could not set the internal schema's version"));
+		return FALSE;
+	}
+	g_object_unref (params);
+
+
+	/* update version */
+	store->priv->version = atoi (CURRENT_SCHEMA_VERSION);
+	return TRUE;
+}
+
+/*
+ * If no transaction is started, then start one
+ * @out_started: a place to store if a transaction was actually started in the function
+ *
+ * Returns: TRUE if no error occurred
+ */
+static gboolean
+check_transaction_started (GdaConnection *cnc, gboolean *out_started)
+{
+        GdaTransactionStatus *trans;
+
+        trans = gda_connection_get_transaction_status (cnc);
+        if (!trans) {
+                if (!gda_connection_begin_transaction (cnc, NULL,
+                                                       GDA_TRANSACTION_ISOLATION_UNKNOWN, NULL))
+                        return FALSE;
+                else
+                        *out_started = TRUE;
+        }
+        return TRUE;
+}
+
+/*
+ * Create a database object from its name,
+ * to be used by functions implementing versions migrations
+ */
+static gboolean
+create_a_dbobj (GdaMetaStore *store, const gchar *obj_name, GError **error)
+{
+	DbObject *dbobj;
+	GdaMetaStoreClass *klass;
+	GdaServerProvider *prov;
+
+	klass = (GdaMetaStoreClass *) G_OBJECT_GET_CLASS (store);
+	dbobj = g_hash_table_lookup (klass->cpriv->db_objects_hash, obj_name);
+	if (!dbobj) {
+		g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_SCHEMA_OBJECT_NOT_FOUND_ERROR,
+			     _("Schema description does not contain the object '%s', check installation"),
+			     obj_name);
+		return FALSE;
+	}
+	prov = gda_connection_get_provider (store->priv->cnc);
+	if (! prepare_dbo_server_operation (klass, store, prov, dbobj, error))
+		return FALSE;
+	g_assert (dbobj->create_op);
+
+	gboolean retval;
+	retval = gda_server_provider_perform_operation (prov, store->priv->cnc, dbobj->create_op, error);
+	g_object_unref (dbobj->create_op);
+	dbobj->create_op = NULL;
+	return retval;
+}
+
+/* migrate schema from version 1 to 2 */
+static void
+migrate_schema_from_v1_to_v2 (GdaMetaStore *store, GError **error)
+{
+	g_return_if_fail (GDA_IS_CONNECTION (store->priv->cnc));
+	g_return_if_fail (gda_connection_is_opened (store->priv->cnc));
+
+	/* begin a transaction if possible */
+	gboolean transaction_started = FALSE;
+	if (! check_transaction_started (store->priv->cnc, &transaction_started))
+		return;
+
+	/* create tables for this migration */
+	if (! create_a_dbobj (store, "_table_indexes", error))
+		return;
+	if (! create_a_dbobj (store, "_index_column_usage", error))
+		return;
+
+	/* set version info to CURRENT_SCHEMA_VERSION */
+	update_schema_version (store, "2", error);
+	if (transaction_started) {
+		/* handle transaction started if necessary */
+		if (store->priv->version != 2)
+			gda_connection_rollback_transaction (store->priv->cnc, NULL, NULL);
+		else
+			gda_connection_commit_transaction (store->priv->cnc, NULL, NULL);
+	}
+}
 
 static gboolean
-handle_schema_version (GdaMetaStore *store, gboolean *schema_present, GError **error) {
+handle_schema_version (GdaMetaStore *store, gboolean *schema_present, GError **error)
+{
 	GdaDataModel *model;
 	GdaMetaStoreClass *klass = (GdaMetaStoreClass *) G_OBJECT_GET_CLASS (store);
 	
@@ -1962,7 +2100,7 @@ handle_schema_version (GdaMetaStore *store, gboolean *schema_present, GError **e
 		const GValue *version;
 		if (gda_data_model_get_n_rows (model) != 1) {
 			g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_INCORRECT_SCHEMA_ERROR,
-				"%s", _("Could not get the internal schema's version"));
+				     "%s", _("Could not get the internal schema's version"));
 			g_object_unref (model);
 			return FALSE;
 		}
@@ -1973,26 +2111,37 @@ handle_schema_version (GdaMetaStore *store, gboolean *schema_present, GError **e
 
 		if (gda_value_is_null (version) || !gda_value_isa (version, G_TYPE_STRING)) {
 			g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_INCORRECT_SCHEMA_ERROR,
-				"%s", _("Could not get the internal schema's version"));
+				     "%s", _("Could not get the internal schema's version"));
 			g_object_unref (model);
 			return FALSE;
 		}
 		store->priv->version = atoi (g_value_get_string (version));
-		
-		if (store->priv->version < 1) {
-			TO_IMPLEMENT; /* migrate to current version */
-			/* As there is now only version 1 => it's an error */
-			g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_INCORRECT_SCHEMA_ERROR,
-				_ ("Unknown internal schema's version: %d"), store->priv->version);
-			g_object_unref (model);
-			return FALSE;
+		if (store->priv->version != atoi (CURRENT_SCHEMA_VERSION)) {
+			switch (store->priv->version) {
+			case 1:
+				migrate_schema_from_v1_to_v2 (store, error);
+			case 2:
+				/* function call for migration from V2 will be here */
+				break;
+			default:
+				g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_INCORRECT_SCHEMA_ERROR,
+					     _ ("Unknown internal schema's version: '%s'"),
+					     g_value_get_string (version));
+				break;
+			}
+			
+			if (store->priv->version != atoi (CURRENT_SCHEMA_VERSION)) {
+				/* it's an error */
+				g_object_unref (model);
+				return FALSE;
+			}
 		}
 		g_object_unref (model);
 		return TRUE;
 	}
 	else {
 		g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_INCORRECT_SCHEMA_ERROR,
-			"%s", _("Could not get the internal schema's version"));
+			     "%s", _("Could not get the internal schema's version"));
 		return FALSE;
 	}
 }
@@ -2003,7 +2152,7 @@ handle_schema_version (GdaMetaStore *store, gboolean *schema_present, GError **e
  *
  * Get @store's internal schema's version
  *
- * Returns: the version (1 at the moment)
+ * Returns: the version (incremented each time the schema changes, backward compatible)
  */
 gint
 gda_meta_store_get_version (GdaMetaStore *store) {
@@ -2087,7 +2236,11 @@ gda_meta_store_extract (GdaMetaStore *store, const gchar *select_sql, GError **e
 	GdaSet *params = NULL;
 
 	g_return_val_if_fail (GDA_IS_META_STORE (store), NULL);
-	g_return_val_if_fail (store->priv, NULL);
+
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return NULL;
+	}		
 
 	if ((store->priv->max_extract_stmt > 0) && !store->priv->extract_stmt_hash)
 		store->priv->extract_stmt_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
@@ -2213,6 +2366,11 @@ gda_meta_store_modify (GdaMetaStore *store, const gchar *table_name,
 	g_return_val_if_fail (table_name, FALSE);
 	g_return_val_if_fail (!new_data || GDA_IS_DATA_MODEL (new_data), FALSE);
 
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return FALSE;
+	}
+
 	value_names = g_new (const gchar *, size);
 	values = g_new (const GValue *, size);
 
@@ -2267,9 +2425,15 @@ gda_meta_store_modify_with_context (GdaMetaStore *store, GdaMetaContext *context
 					g_type_name (G_VALUE_TYPE (context->column_values [i])));
 	}
 
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return FALSE;
+	}
+
 	retval = gda_meta_store_modify_v (store, context->table_name, new_data, cond ? cond->str : NULL, error,
 					  context->size, 
-					  (const gchar **) context->column_names, (const GValue **)context->column_values);
+					  (const gchar **) context->column_names,
+					  (const GValue **)context->column_values);
 	if (cond)
 		g_string_free (cond, TRUE);
 	return retval;
@@ -2507,7 +2671,7 @@ gda_meta_store_modify_v (GdaMetaStore *store, const gchar *table_name,
 					
 					for (k = 0; k < tfk->cols_nb; k++) {
 						context.column_values [k] = (GValue*) gda_data_model_get_value_at (new_data, 
-									    tfk->ref_pk_cols_array[k], i, error);
+														   tfk->ref_pk_cols_array[k], i, error);
 						if (!context.column_values [k]) {
 							g_free (context.column_values);
 							retval = FALSE;
@@ -2635,7 +2799,7 @@ gda_meta_store_modify_v (GdaMetaStore *store, const gchar *table_name,
 			g_signal_emit (store, gda_meta_store_signals[META_CHANGED], 0, all_changes);
 	}
 	
-out:
+ out:
 	if (all_changes) {
 		g_slist_foreach (all_changes, (GFunc) gda_meta_store_change_free, NULL);
 		g_slist_free (all_changes);
@@ -2684,7 +2848,7 @@ find_row_in_model (GdaDataModel *find_in, GdaDataModel *data, gint row, gint *pk
 		ncols = gda_data_model_get_n_columns (find_in);
 		if (ncols > gda_data_model_get_n_columns (data)) {
 			g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_MODIFY_CONTENTS_ERROR,
-				"%s", _("Data models should have the same number of columns"));
+				     "%s", _("Data models should have the same number of columns"));
 			erow = -2;
 		}
 		else {
@@ -2761,7 +2925,7 @@ prepare_tables_infos (GdaMetaStore *store, TableInfo **out_table_infos, TableCon
 		h = gda_set_get_holder ((*out_cond_infos)->params, value_names [i]);
 		if (!h || !gda_holder_set_value (h, wvalue ? wvalue : values[i], NULL)) {
 			g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_INTERNAL_ERROR,
-				_ ("Could not set value for parameter '%s'"), value_names [i]);
+				     _ ("Could not set value for parameter '%s'"), value_names [i]);
 			if (wvalue)
 				gda_value_free (wvalue);
 			return FALSE;
@@ -2788,9 +2952,9 @@ create_custom_set (GdaMetaStore *store, const gchar *table_name, const gchar *co
 	set->select = compute_prepared_stmt (klass->cpriv->parser, sql);
 	g_free (sql);
 	if (!set->select ||
-		(gda_statement_get_statement_type (set->select) != GDA_SQL_STATEMENT_SELECT)) {
+	    (gda_statement_get_statement_type (set->select) != GDA_SQL_STATEMENT_SELECT)) {
 		g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_MODIFY_CONTENTS_ERROR,
-			"%s", _("Could not create SELECT statement"));
+			     "%s", _("Could not create SELECT statement"));
 		goto out;
 	}
 	
@@ -2803,14 +2967,14 @@ create_custom_set (GdaMetaStore *store, const gchar *table_name, const gchar *co
 	set->delete = compute_prepared_stmt (klass->cpriv->parser, sql);
 	g_free (sql);
 	if (!set->delete||
-		(gda_statement_get_statement_type (set->delete) != GDA_SQL_STATEMENT_DELETE)) {
+	    (gda_statement_get_statement_type (set->delete) != GDA_SQL_STATEMENT_DELETE)) {
 		g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_MODIFY_CONTENTS_ERROR,
-			"%s", _("Could not create DELETE statement"));
+			     "%s", _("Could not create DELETE statement"));
 		goto out;
 	}
 	return set;
 	
-out:
+ out:
 	if (set->select)
 		g_object_unref (set->select);
         if (set->delete)
@@ -2837,6 +3001,11 @@ _gda_meta_store_begin_data_reset (GdaMetaStore *store, GError **error)
 {
 	g_return_val_if_fail (GDA_IS_META_STORE (store), FALSE);
 
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return FALSE;
+	}
+
 	if (store->priv->override_mode)
 		return TRUE;
 
@@ -2869,6 +3038,11 @@ _gda_meta_store_cancel_data_reset (GdaMetaStore *store, GError **error)
 {
 	g_return_val_if_fail (GDA_IS_META_STORE (store), FALSE);
 
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return FALSE;
+	}
+
 	if (!store->priv->override_mode)
 		return TRUE;
 	
@@ -2890,9 +3064,14 @@ _gda_meta_store_finish_data_reset (GdaMetaStore *store, GError **error)
 {
 	g_return_val_if_fail (GDA_IS_META_STORE (store), FALSE);
 
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return FALSE;
+	}
+
 	if (!store->priv->override_mode)
 		return TRUE;
-
+	
 	store->priv->override_mode = FALSE;	
 	if (!gda_connection_commit_transaction (store->priv->cnc, NULL, error))
 		return FALSE;
@@ -3059,6 +3238,10 @@ gda_meta_store_schema_get_structure (GdaMetaStore *store, GError **error)
 	GdaMetaStore *real_store;
 
 	g_return_val_if_fail (GDA_IS_META_STORE (store), NULL);
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return NULL;
+	}
 
 	/* make sure the private connection's meta store is up to date */
 	if (! gda_connection_update_meta_store (store->priv->cnc, NULL, error))
@@ -3160,6 +3343,11 @@ gda_meta_store_get_attribute_value (GdaMetaStore *store, const gchar *att_name,
 	g_return_val_if_fail (att_name && *att_name, FALSE);
 	g_return_val_if_fail (att_value, FALSE);
 
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return FALSE;
+	}
+
 	*att_value = NULL;
 	g_value_set_string ((value = gda_value_new (G_TYPE_STRING)), att_name);
 	model = gda_meta_store_extract (store, "SELECT att_value FROM _attributes WHERE att_name = ##n::string", error,
@@ -3286,43 +3474,43 @@ gda_meta_store_set_attribute_value (GdaMetaStore *store, const gchar *att_name,
  *
  * The @xml_description defines the table of view's definition, for example:
  * <programlisting><![CDATA[<table name="mytable">
-    <column name="id" pkey="TRUE"/>
-    <column name="value"/>
-</table>]]></programlisting>
+ <column name="id" pkey="TRUE"/>
+ <column name="value"/>
+ </table>]]></programlisting>
  *
  * The partial DTD for this XML description of the object to add is the following (the top node must be
  * a &lt;table&gt; or a &lt;view&gt;):
  * <programlisting><![CDATA[<!ELEMENT table (column*,check*,fkey*,unique*)>
-<!ATTLIST table
-          name NMTOKEN #REQUIRED>
+ <!ATTLIST table
+ name NMTOKEN #REQUIRED>
 
-<!ELEMENT column EMPTY>
-<!ATTLIST column
-          name NMTOKEN #REQUIRED
-          type CDATA #IMPLIED
-          pkey (TRUE|FALSE) #IMPLIED
-          autoinc (TRUE|FALSE) #IMPLIED
-          nullok (TRUE|FALSE) #IMPLIED>
+ <!ELEMENT column EMPTY>
+ <!ATTLIST column
+ name NMTOKEN #REQUIRED
+ type CDATA #IMPLIED
+ pkey (TRUE|FALSE) #IMPLIED
+ autoinc (TRUE|FALSE) #IMPLIED
+ nullok (TRUE|FALSE) #IMPLIED>
 
-<!ELEMENT check (#PCDATA)>
+ <!ELEMENT check (#PCDATA)>
 
-<!ELEMENT fkey (part+)>
-<!ATTLIST fkey
-          ref_table NMTOKEN #REQUIRED>
+ <!ELEMENT fkey (part+)>
+ <!ATTLIST fkey
+ ref_table NMTOKEN #REQUIRED>
 
-<!ELEMENT part EMPTY>
-<!ATTLIST part
-          column NMTOKEN #IMPLIED
-          ref_column NMTOKEN #IMPLIED>
+ <!ELEMENT part EMPTY>
+ <!ATTLIST part
+ column NMTOKEN #IMPLIED
+ ref_column NMTOKEN #IMPLIED>
 
-<!ELEMENT unique (column*)>
+ <!ELEMENT unique (column*)>
 
-<!ELEMENT view (definition)>
-<!ATTLIST view
-          name NMTOKEN #REQUIRED
-          descr CDATA #IMPLIED>
+ <!ELEMENT view (definition)>
+ <!ATTLIST view
+ name NMTOKEN #REQUIRED
+ descr CDATA #IMPLIED>
 
-<!ELEMENT definition (#PCDATA)>]]></programlisting>
+ <!ELEMENT definition (#PCDATA)>]]></programlisting>
  *
  * Returns: TRUE if the new object has sucessfully been added
  */
@@ -3343,6 +3531,11 @@ gda_meta_store_schema_add_custom_object (GdaMetaStore *store, const gchar *xml_d
 	g_return_val_if_fail (GDA_IS_META_STORE (store), FALSE);
 	g_return_val_if_fail (xml_description && *xml_description, FALSE);
 
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return FALSE;
+	}
+
 	/* load XML description */
 	doc = xmlParseDoc (BAD_CAST xml_description);
 	if (!doc) {
@@ -3528,6 +3721,11 @@ gda_meta_store_schema_remove_custom_object (GdaMetaStore *store, const gchar *ob
 	g_return_val_if_fail (GDA_IS_META_STORE (store), FALSE);
 	g_return_val_if_fail (obj_name && *obj_name, FALSE);
 	
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return FALSE;
+	}
+
 	TO_IMPLEMENT;
 	return FALSE;
 }
@@ -3544,6 +3742,11 @@ _gda_meta_store_validate_context (GdaMetaStore *store, GdaMetaContext *context,
 	GdaMetaStoreClass *klass;
 	gint i;
 
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return FALSE;
+	}
+
 	if (!context->table_name || !(*context->table_name)) {
 		g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_META_CONTEXT_ERROR,
 			     _("Missing table name in meta data context"));
@@ -3673,6 +3876,11 @@ _gda_meta_store_schema_get_upstream_contexts (GdaMetaStore *store, GdaMetaContex
 	GSList *list, *retlist = NULL;
 	TableInfo *tinfo;
 
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return NULL;
+	}
+
 	/* find the associated DbObject */
 	dbo = g_hash_table_lookup (store->priv->p_db_objects_hash, context->table_name);
 	if (!dbo) {
@@ -3761,6 +3969,11 @@ _gda_meta_store_schema_get_downstream_contexts (GdaMetaStore *store, GdaMetaCont
 	GSList *list, *retlist = NULL;
 	TableInfo *tinfo;
 
+	if (store->priv->init_error) {
+		g_propagate_error (error, g_error_copy (store->priv->init_error));
+		return NULL;
+	}
+
 	/* find the associated DbObject */
 	dbo = g_hash_table_lookup (store->priv->p_db_objects_hash, context->table_name);
 	if (!dbo) {
@@ -3781,7 +3994,7 @@ _gda_meta_store_schema_get_downstream_contexts (GdaMetaStore *store, GdaMetaCont
 		GdaMetaContext *ct;
 
 		/* REM: there may be duplicates, but we don't really care here (it'd take more ressources to get rid of
-		* them than it takes to put duplicates in a hash table */
+		 * them than it takes to put duplicates in a hash table */
 		ct = g_new0 (GdaMetaContext, 1);
 		ct->table_name = tfk->table_info->obj_name;
 		ct->size = 0;
diff --git a/libgda/gda-server-provider.h b/libgda/gda-server-provider.h
index 9b589f7..a680efe 100644
--- a/libgda/gda-server-provider.h
+++ b/libgda/gda-server-provider.h
@@ -177,12 +177,18 @@ typedef struct {
 	gboolean (*_routine_par)     (GdaServerProvider *, GdaConnection *, GdaMetaStore *, GdaMetaContext *, GError **);
 	gboolean (*routine_par)      (GdaServerProvider *, GdaConnection *, GdaMetaStore *, GdaMetaContext *, GError **,
 				      const GValue *rout_catalog, const GValue *rout_schema, const GValue *rout_name);
+	/* _table_indexes */
+	gboolean (*_indexes_tab)     (GdaServerProvider *, GdaConnection *, GdaMetaStore *, GdaMetaContext *, GError **);
+	gboolean (*indexes_tab)      (GdaServerProvider *, GdaConnection *, GdaMetaStore *, GdaMetaContext *, GError **, 
+				      const GValue *table_catalog, const GValue *table_schema, const GValue *table_name,
+				      const GValue *index_name_n);
+
+	/* _index_column_usage */
+	gboolean (*_index_cols)      (GdaServerProvider *, GdaConnection *, GdaMetaStore *, GdaMetaContext *, GError **);
+	gboolean (*index_cols)       (GdaServerProvider *, GdaConnection *, GdaMetaStore *, GdaMetaContext *, GError **,
+				      const GValue *table_catalog, const GValue *table_schema, const GValue *table_name, const GValue *index_name);
 	
 	/* Padding for future expansion */
-	void (*_gda_reserved1) (void);
-	void (*_gda_reserved2) (void);
-	void (*_gda_reserved3) (void);
-	void (*_gda_reserved4) (void);
 	void (*_gda_reserved5) (void);
 	void (*_gda_reserved6) (void);
 	void (*_gda_reserved7) (void);
diff --git a/libgda/information_schema.xml b/libgda/information_schema.xml
index 5683046..af9b80e 100644
--- a/libgda/information_schema.xml
+++ b/libgda/information_schema.xml
@@ -3,6 +3,12 @@
     Information schema for Libgda's dictionary DB.
     This is the base schema and can be extended by applications by adding new
     DBMS objects, but: the '_' prefix is reserved for Libgda's internals...
+
+    NOTE: when modified, please:
+    * run tools/information-schema-doc and move the generated file to doc/C/
+    * run tools/information-schema-types and move the generated file to libgda/providers-support/
+    * increment the CURRENT_SCHEMA_VERSION define in libgda/gda-meta-store.c and implement the corresponding
+      schema migration in that file
 -->
 
 
@@ -539,6 +545,52 @@
     </fkey>
     -->
   </table>
+
+  <table name="_table_indexes" descr="List of tables' indexes which do not relate to primary keys">
+    <column name="index_catalog" nullok="TRUE" descr="Name of the catalog that contains the index"/>
+    <column name="index_schema" nullok="TRUE" descr="Name of the schema that contains the index" ident="TRUE"/>
+    <column name="index_name" pkey="TRUE" ident="TRUE"/>
+    <column name="table_catalog" pkey="TRUE"/>
+    <column name="table_schema" pkey="TRUE" ident="TRUE"/>
+    <column name="table_name" pkey="TRUE" ident="TRUE"/>
+    <column name="is_unique" type="boolean" descr="" nullok="TRUE"/>
+    <column name="index_def" descr="Index definition" nullok="TRUE"/>
+    <column name="index_type" nullok="TRUE" descr="Database specific type of index such as BTREE, ..."/>
+    <column name="extra" nullok="TRUE" descr="CSV string with: ASCENDING, ..."/>
+    <column name="index_owner" nullok="TRUE"/>
+    <column name="index_comments" nullok="TRUE"/>
+    <fkey ref_table="_tables">
+      <part column="table_catalog"/>
+      <part column="table_schema"/>
+      <part column="table_name"/>
+    </fkey>
+  </table>
+
+  <table name="_index_column_usage" descr="List of the tables' columns involved in an index listed in the _table_indexes table">
+    <column name="index_catalog" nullok="TRUE"/>
+    <column name="index_schema" nullok="TRUE" ident="TRUE"/>
+    <column name="index_name" pkey="TRUE" ident="TRUE"/>
+    <column name="table_catalog" pkey="TRUE"/>
+    <column name="table_schema" pkey="TRUE" ident="TRUE"/>
+    <column name="table_name" pkey="TRUE" ident="TRUE"/>
+    <column name="column_name" pkey="TRUE" nullok="TRUE" ident="TRUE"/>
+    <column name="column_expr" pkey="TRUE" nullok="TRUE"/>
+    <column name="ordinal_position" type="gint" descr="Column position in the index, starts at 1"/>
+    <fkey ref_table="_table_indexes">
+      <part column="index_name"/>
+      <part column="table_catalog"/>
+      <part column="table_schema"/>
+      <part column="table_name"/>
+    </fkey>
+    <!--
+    <fkey ref_table="_columns">
+      <part column="table_catalog"/>
+      <part column="table_schema"/>
+      <part column="table_name"/>
+      <part column="column_name"/>
+    </fkey>
+    -->
+  </table>
   
   <view name="_all_types" descr="List of all the data types">
     <definition>SELECT short_type_name AS short_type_name, gtype, full_type_name AS full_type_name, comments, internal AS internal, synonyms,
diff --git a/libgda/providers-support/gda-meta-column-types.h b/libgda/providers-support/gda-meta-column-types.h
new file mode 100644
index 0000000..764f287
--- /dev/null
+++ b/libgda/providers-support/gda-meta-column-types.h
@@ -0,0 +1,544 @@
+/*
+ * File generated by the tools/information-schema-types program from the
+ * libgda/information_schema.xml file,
+ * This file contains declaration of the expected data types when
+ * extracting meta data, it should be updated when the libgda/information_schema.xml file changes
+ * DO NOT MODIFY
+ */
+
+
+
+
+/*
+ * TABLE: _attributes
+ *
+ * Table to store (key,value) pairs (keys starting with '_' are reserved)
+ */
+static GType _col_types_attributes[] = {
+  G_TYPE_STRING  /* column: att_name */
+, G_TYPE_STRING  /* column: att_value */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _information_schema_catalog_name
+ *
+ * Name of the current database (current catalog), has only one row
+ */
+static GType _col_types_information_schema_catalog_name[] = {
+  G_TYPE_STRING  /* column: catalog_name */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _schemata
+ *
+ * List of schemas
+ */
+static GType _col_types_schemata[] = {
+  G_TYPE_STRING  /* column: catalog_name */
+, G_TYPE_STRING  /* column: schema_name */
+, G_TYPE_STRING  /* column: schema_owner */
+, G_TYPE_BOOLEAN  /* column: schema_internal */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _builtin_data_types
+ *
+ * List of built-in data types such as varchar, int, ...
+ */
+static GType _col_types_builtin_data_types[] = {
+  G_TYPE_STRING  /* column: short_type_name */
+, G_TYPE_STRING  /* column: full_type_name */
+, G_TYPE_STRING  /* column: gtype */
+, G_TYPE_STRING  /* column: comments */
+, G_TYPE_STRING  /* column: synonyms */
+, G_TYPE_BOOLEAN  /* column: internal */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _udt
+ *
+ * User defined data types
+ */
+static GType _col_types_udt[] = {
+  G_TYPE_STRING  /* column: udt_catalog */
+, G_TYPE_STRING  /* column: udt_schema */
+, G_TYPE_STRING  /* column: udt_name */
+, G_TYPE_STRING  /* column: udt_gtype */
+, G_TYPE_STRING  /* column: udt_comments */
+, G_TYPE_STRING  /* column: udt_short_name */
+, G_TYPE_STRING  /* column: udt_full_name */
+, G_TYPE_BOOLEAN  /* column: udt_internal */
+, G_TYPE_STRING  /* column: udt_owner */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _udt_columns
+ *
+ * List of components for a user defined data type for composed data types (such as a complex number data type which has real and imaginary parts)
+ */
+static GType _col_types_udt_columns[] = {
+  G_TYPE_STRING  /* column: udt_catalog */
+, G_TYPE_STRING  /* column: udt_schema */
+, G_TYPE_STRING  /* column: udt_name */
+, G_TYPE_STRING  /* column: udt_column */
+, G_TYPE_INT  /* column: ordinal_position */
+, G_TYPE_STRING  /* column: data_type */
+, G_TYPE_STRING  /* column: array_spec */
+, G_TYPE_INT  /* column: character_maximum_length */
+, G_TYPE_INT  /* column: character_octet_length */
+, G_TYPE_INT  /* column: numeric_precision */
+, G_TYPE_INT  /* column: numeric_scale */
+, G_TYPE_INT  /* column: datetime_precision */
+, G_TYPE_STRING  /* column: character_set_catalog */
+, G_TYPE_STRING  /* column: character_set_schema */
+, G_TYPE_STRING  /* column: character_set_name */
+, G_TYPE_STRING  /* column: collation_catalog */
+, G_TYPE_STRING  /* column: collation_schema */
+, G_TYPE_STRING  /* column: collation_name */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _enums
+ *
+ * List of possible enumeration labels for enumerations
+ */
+static GType _col_types_enums[] = {
+  G_TYPE_STRING  /* column: udt_catalog */
+, G_TYPE_STRING  /* column: udt_schema */
+, G_TYPE_STRING  /* column: udt_name */
+, G_TYPE_STRING  /* column: label */
+, G_TYPE_INT  /* column: ordinal_position */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _element_types
+ *
+ * Array specific attributes for array data types
+ */
+static GType _col_types_element_types[] = {
+  G_TYPE_STRING  /* column: specific_name */
+, G_TYPE_STRING  /* column: object_catalog */
+, G_TYPE_STRING  /* column: object_schema */
+, G_TYPE_STRING  /* column: object_name */
+, G_TYPE_STRING  /* column: object_type */
+, G_TYPE_STRING  /* column: data_type */
+, G_TYPE_STRING  /* column: array_spec */
+, G_TYPE_INT  /* column: min_cardinality */
+, G_TYPE_INT  /* column: max_cardinality */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _domains
+ *
+ * List of domains
+ */
+static GType _col_types_domains[] = {
+  G_TYPE_STRING  /* column: domain_catalog */
+, G_TYPE_STRING  /* column: domain_schema */
+, G_TYPE_STRING  /* column: domain_name */
+, G_TYPE_STRING  /* column: data_type */
+, G_TYPE_STRING  /* column: array_spec */
+, G_TYPE_STRING  /* column: domain_gtype */
+, G_TYPE_INT  /* column: character_maximum_length */
+, G_TYPE_INT  /* column: character_octet_length */
+, G_TYPE_STRING  /* column: collation_catalog */
+, G_TYPE_STRING  /* column: collation_schema */
+, G_TYPE_STRING  /* column: collation_name */
+, G_TYPE_STRING  /* column: character_set_catalog */
+, G_TYPE_STRING  /* column: character_set_schema */
+, G_TYPE_STRING  /* column: character_set_name */
+, G_TYPE_INT  /* column: numeric_precision */
+, G_TYPE_INT  /* column: numeric_scale */
+, G_TYPE_STRING  /* column: domain_default */
+, G_TYPE_STRING  /* column: domain_comments */
+, G_TYPE_STRING  /* column: domain_short_name */
+, G_TYPE_STRING  /* column: domain_full_name */
+, G_TYPE_BOOLEAN  /* column: domain_internal */
+, G_TYPE_STRING  /* column: domain_owner */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _tables
+ *
+ * List of tables (tables, views or other objects which can contain data)
+ */
+static GType _col_types_tables[] = {
+  G_TYPE_STRING  /* column: table_catalog */
+, G_TYPE_STRING  /* column: table_schema */
+, G_TYPE_STRING  /* column: table_name */
+, G_TYPE_STRING  /* column: table_type */
+, G_TYPE_BOOLEAN  /* column: is_insertable_into */
+, G_TYPE_STRING  /* column: table_comments */
+, G_TYPE_STRING  /* column: table_short_name */
+, G_TYPE_STRING  /* column: table_full_name */
+, G_TYPE_STRING  /* column: table_owner */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _views
+ *
+ * List of views and their specific information
+ */
+static GType _col_types_views[] = {
+  G_TYPE_STRING  /* column: table_catalog */
+, G_TYPE_STRING  /* column: table_schema */
+, G_TYPE_STRING  /* column: table_name */
+, G_TYPE_STRING  /* column: view_definition */
+, G_TYPE_STRING  /* column: check_option */
+, G_TYPE_BOOLEAN  /* column: is_updatable */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _collations
+ *
+ * List of collations methods
+ */
+static GType _col_types_collations[] = {
+  G_TYPE_STRING  /* column: collation_catalog */
+, G_TYPE_STRING  /* column: collation_schema */
+, G_TYPE_STRING  /* column: collation_name */
+, G_TYPE_STRING  /* column: collation_comments */
+, G_TYPE_STRING  /* column: collation_short_name */
+, G_TYPE_STRING  /* column: collation_full_name */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _character_sets
+ *
+ * List of character sets
+ */
+static GType _col_types_character_sets[] = {
+  G_TYPE_STRING  /* column: character_set_catalog */
+, G_TYPE_STRING  /* column: character_set_schema */
+, G_TYPE_STRING  /* column: character_set_name */
+, G_TYPE_STRING  /* column: default_collate_catalog */
+, G_TYPE_STRING  /* column: default_collate_schema */
+, G_TYPE_STRING  /* column: default_collate_name */
+, G_TYPE_STRING  /* column: character_set_comments */
+, G_TYPE_STRING  /* column: character_set_short_name */
+, G_TYPE_STRING  /* column: character_set_full_name */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _routines
+ *
+ * List of functions and stored procedures (note: the primary jey for that table is composed of (specific_catalog, specific_schema, specific_name))
+ */
+static GType _col_types_routines[] = {
+  G_TYPE_STRING  /* column: specific_catalog */
+, G_TYPE_STRING  /* column: specific_schema */
+, G_TYPE_STRING  /* column: specific_name */
+, G_TYPE_STRING  /* column: routine_catalog */
+, G_TYPE_STRING  /* column: routine_schema */
+, G_TYPE_STRING  /* column: routine_name */
+, G_TYPE_STRING  /* column: routine_type */
+, G_TYPE_STRING  /* column: return_type */
+, G_TYPE_BOOLEAN  /* column: returns_set */
+, G_TYPE_INT  /* column: nb_args */
+, G_TYPE_STRING  /* column: routine_body */
+, G_TYPE_STRING  /* column: routine_definition */
+, G_TYPE_STRING  /* column: external_name */
+, G_TYPE_STRING  /* column: external_language */
+, G_TYPE_STRING  /* column: parameter_style */
+, G_TYPE_BOOLEAN  /* column: is_deterministic */
+, G_TYPE_STRING  /* column: sql_data_access */
+, G_TYPE_BOOLEAN  /* column: is_null_call */
+, G_TYPE_STRING  /* column: routine_comments */
+, G_TYPE_STRING  /* column: routine_short_name */
+, G_TYPE_STRING  /* column: routine_full_name */
+, G_TYPE_STRING  /* column: routine_owner */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _triggers
+ *
+ * List of triggers
+ */
+static GType _col_types_triggers[] = {
+  G_TYPE_STRING  /* column: trigger_catalog */
+, G_TYPE_STRING  /* column: trigger_schema */
+, G_TYPE_STRING  /* column: trigger_name */
+, G_TYPE_STRING  /* column: event_manipulation */
+, G_TYPE_STRING  /* column: event_object_catalog */
+, G_TYPE_STRING  /* column: event_object_schema */
+, G_TYPE_STRING  /* column: event_object_table */
+, G_TYPE_STRING  /* column: action_statement */
+, G_TYPE_STRING  /* column: action_orientation */
+, G_TYPE_STRING  /* column: condition_timing */
+, G_TYPE_STRING  /* column: trigger_comments */
+, G_TYPE_STRING  /* column: trigger_short_name */
+, G_TYPE_STRING  /* column: trigger_full_name */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _columns
+ *
+ * List of columns composing tables
+ */
+static GType _col_types_columns[] = {
+  G_TYPE_STRING  /* column: table_catalog */
+, G_TYPE_STRING  /* column: table_schema */
+, G_TYPE_STRING  /* column: table_name */
+, G_TYPE_STRING  /* column: column_name */
+, G_TYPE_INT  /* column: ordinal_position */
+, G_TYPE_STRING  /* column: column_default */
+, G_TYPE_BOOLEAN  /* column: is_nullable */
+, G_TYPE_STRING  /* column: data_type */
+, G_TYPE_STRING  /* column: array_spec */
+, G_TYPE_STRING  /* column: gtype */
+, G_TYPE_INT  /* column: character_maximum_length */
+, G_TYPE_INT  /* column: character_octet_length */
+, G_TYPE_INT  /* column: numeric_precision */
+, G_TYPE_INT  /* column: numeric_scale */
+, G_TYPE_INT  /* column: datetime_precision */
+, G_TYPE_STRING  /* column: character_set_catalog */
+, G_TYPE_STRING  /* column: character_set_schema */
+, G_TYPE_STRING  /* column: character_set_name */
+, G_TYPE_STRING  /* column: collation_catalog */
+, G_TYPE_STRING  /* column: collation_schema */
+, G_TYPE_STRING  /* column: collation_name */
+, G_TYPE_STRING  /* column: extra */
+, G_TYPE_BOOLEAN  /* column: is_updatable */
+, G_TYPE_STRING  /* column: column_comments */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _table_constraints
+ *
+ * List of constraints applied to tables (Check, primary or foreign key, or unique constraints)
+ */
+static GType _col_types_table_constraints[] = {
+  G_TYPE_STRING  /* column: constraint_catalog */
+, G_TYPE_STRING  /* column: constraint_schema */
+, G_TYPE_STRING  /* column: constraint_name */
+, G_TYPE_STRING  /* column: table_catalog */
+, G_TYPE_STRING  /* column: table_schema */
+, G_TYPE_STRING  /* column: table_name */
+, G_TYPE_STRING  /* column: constraint_type */
+, G_TYPE_STRING  /* column: check_clause */
+, G_TYPE_BOOLEAN  /* column: is_deferrable */
+, G_TYPE_BOOLEAN  /* column: initially_deferred */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _referential_constraints
+ *
+ * List of foreign key constraints, along with some specific attributes
+ */
+static GType _col_types_referential_constraints[] = {
+  G_TYPE_STRING  /* column: table_catalog */
+, G_TYPE_STRING  /* column: table_schema */
+, G_TYPE_STRING  /* column: table_name */
+, G_TYPE_STRING  /* column: constraint_name */
+, G_TYPE_STRING  /* column: ref_table_catalog */
+, G_TYPE_STRING  /* column: ref_table_schema */
+, G_TYPE_STRING  /* column: ref_table_name */
+, G_TYPE_STRING  /* column: ref_constraint_name */
+, G_TYPE_STRING  /* column: match_option */
+, G_TYPE_STRING  /* column: update_rule */
+, G_TYPE_STRING  /* column: delete_rule */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _key_column_usage
+ *
+ * List of primary key constraints and the name of the tables' columns involved
+ */
+static GType _col_types_key_column_usage[] = {
+  G_TYPE_STRING  /* column: table_catalog */
+, G_TYPE_STRING  /* column: table_schema */
+, G_TYPE_STRING  /* column: table_name */
+, G_TYPE_STRING  /* column: constraint_name */
+, G_TYPE_STRING  /* column: column_name */
+, G_TYPE_INT  /* column: ordinal_position */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _check_column_usage
+ *
+ * List of check constraints and the name of the tables' columns involved
+ */
+static GType _col_types_check_column_usage[] = {
+  G_TYPE_STRING  /* column: table_catalog */
+, G_TYPE_STRING  /* column: table_schema */
+, G_TYPE_STRING  /* column: table_name */
+, G_TYPE_STRING  /* column: constraint_name */
+, G_TYPE_STRING  /* column: column_name */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _view_column_usage
+ *
+ * List of the tables' columns involved in a view
+ */
+static GType _col_types_view_column_usage[] = {
+  G_TYPE_STRING  /* column: view_catalog */
+, G_TYPE_STRING  /* column: view_schema */
+, G_TYPE_STRING  /* column: view_name */
+, G_TYPE_STRING  /* column: table_catalog */
+, G_TYPE_STRING  /* column: table_schema */
+, G_TYPE_STRING  /* column: table_name */
+, G_TYPE_STRING  /* column: column_name */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _domain_constraints
+ *
+ * List of constraints applicable to domains
+ */
+static GType _col_types_domain_constraints[] = {
+  G_TYPE_STRING  /* column: constraint_catalog */
+, G_TYPE_STRING  /* column: constraint_schema */
+, G_TYPE_STRING  /* column: constraint_name */
+, G_TYPE_STRING  /* column: domain_catalog */
+, G_TYPE_STRING  /* column: domain_schema */
+, G_TYPE_STRING  /* column: domain_name */
+, G_TYPE_STRING  /* column: check_clause */
+, G_TYPE_BOOLEAN  /* column: is_deferrable */
+, G_TYPE_BOOLEAN  /* column: initially_deferred */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _parameters
+ *
+ * List of routines' (functions and stored procedures) parameters (may not contain data for some routines which accept any type of parameter)
+ */
+static GType _col_types_parameters[] = {
+  G_TYPE_STRING  /* column: specific_catalog */
+, G_TYPE_STRING  /* column: specific_schema */
+, G_TYPE_STRING  /* column: specific_name */
+, G_TYPE_INT  /* column: ordinal_position */
+, G_TYPE_STRING  /* column: parameter_mode */
+, G_TYPE_STRING  /* column: parameter_name */
+, G_TYPE_STRING  /* column: data_type */
+, G_TYPE_STRING  /* column: array_spec */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _routine_columns
+ *
+ * List of routines' (functions and stored procedures) returned values' parts (columns) for routines returning composed values
+ */
+static GType _col_types_routine_columns[] = {
+  G_TYPE_STRING  /* column: specific_catalog */
+, G_TYPE_STRING  /* column: specific_schema */
+, G_TYPE_STRING  /* column: specific_name */
+, G_TYPE_STRING  /* column: column_name */
+, G_TYPE_INT  /* column: ordinal_position */
+, G_TYPE_STRING  /* column: data_type */
+, G_TYPE_STRING  /* column: array_spec */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _table_indexes
+ *
+ * List of tables' indexes which do not relate to primary keys
+ */
+static GType _col_types_table_indexes[] = {
+  G_TYPE_STRING  /* column: index_catalog */
+, G_TYPE_STRING  /* column: index_schema */
+, G_TYPE_STRING  /* column: index_name */
+, G_TYPE_STRING  /* column: table_catalog */
+, G_TYPE_STRING  /* column: table_schema */
+, G_TYPE_STRING  /* column: table_name */
+, G_TYPE_BOOLEAN  /* column: is_unique */
+, G_TYPE_STRING  /* column: index_def */
+, G_TYPE_STRING  /* column: index_type */
+, G_TYPE_STRING  /* column: extra */
+, G_TYPE_STRING  /* column: index_owner */
+, G_TYPE_STRING  /* column: index_comments */
+, G_TYPE_NONE /* end of array marker */
+};
+
+
+
+/*
+ * TABLE: _index_column_usage
+ *
+ * List of the tables' columns involved in an index listed in the _table_indexes table
+ */
+static GType _col_types_index_column_usage[] = {
+  G_TYPE_STRING  /* column: index_catalog */
+, G_TYPE_STRING  /* column: index_schema */
+, G_TYPE_STRING  /* column: index_name */
+, G_TYPE_STRING  /* column: table_catalog */
+, G_TYPE_STRING  /* column: table_schema */
+, G_TYPE_STRING  /* column: table_name */
+, G_TYPE_STRING  /* column: column_name */
+, G_TYPE_STRING  /* column: column_expr */
+, G_TYPE_INT  /* column: ordinal_position */
+, G_TYPE_NONE /* end of array marker */
+};
+
diff --git a/providers/postgres/gda-postgres-meta.c b/providers/postgres/gda-postgres-meta.c
index 2584489..9db3b47 100644
--- a/providers/postgres/gda-postgres-meta.c
+++ b/providers/postgres/gda-postgres-meta.c
@@ -1,5 +1,5 @@
 /* GDA postgres provider
- * Copyright (C) 2008 The GNOME Foundation.
+ * Copyright (C) 2008 - 2009 The GNOME Foundation.
  *
  * AUTHORS:
  *         Vivien Malerba <malerba gnome-db org>
@@ -25,6 +25,7 @@
 #include "gda-postgres-meta.h"
 #include "gda-postgres-provider.h"
 #include "gda-postgres-util.h"
+#include "gda-postgres-parser.h"
 #include <libgda/gda-meta-store.h>
 #include <libgda/sql-parser/gda-sql-parser.h>
 #include <glib/gi18n-lib.h>
@@ -32,6 +33,7 @@
 #include <libgda/gda-connection-private.h>
 #include <libgda/gda-data-model-array.h>
 #include <libgda/gda-set.h>
+#include <libgda/providers-support/gda-meta-column-types.h>
 
 /*
  * predefined statements' IDs
@@ -83,7 +85,13 @@ typedef enum {
 	I_STMT_ROUTINE_PAR_ALL,
 	I_STMT_ROUTINE_PAR,
 	I_STMT_ROUTINE_COL_ALL,
-	I_STMT_ROUTINE_COL
+	I_STMT_ROUTINE_COL,
+	I_STMT_INDEXES,
+	I_STMT_INDEXES_ALL,
+	I_STMT_INDEXES_NAMED,
+	I_STMT_INDEXES_COLUMNS_GET_ALL_INDEXES,
+	I_STMT_INDEXES_COLUMNS_GET_NAMED_INDEXES,
+	I_STMT_INDEXES_COLUMNS_FOR_INDEX
 } InternalStatementItem;
 
 
@@ -95,57 +103,57 @@ static gchar *internal_sql[] = {
 	"SELECT pg_catalog.current_database()",
 
 	/* I_STMT_BTYPES */
-	"SELECT t.typname, 'pg_catalog.' || t.typname, 'gchararray', pg_catalog.obj_description(t.oid), NULL, CASE WHEN t.typname ~ '^_' THEN TRUE WHEN typtype = 'p' THEN TRUE WHEN t.typname in ('any', 'anyarray', 'anyelement', 'cid', 'cstring', 'int2vector', 'internal', 'language_handler', 'oidvector', 'opaque', 'record', 'refcursor', 'regclass', 'regoper', 'regoperator', 'regproc', 'regprocedure', 'regtype', 'SET', 'smgr', 'tid', 'trigger', 'unknown', 'void', 'xid', 'oid', 'aclitem') THEN TRUE ELSE FALSE END, CAST (t.oid AS int8) FROM pg_catalog.pg_type t, pg_catalog.pg_user u, pg_catalog.pg_namespace n WHERE t.typowner=u.usesysid AND n.oid = t.typnamespace AND pg_catalog.pg_type_is_visible(t.oid) AND (typtype='b' OR typtype='p') AND typelem = 0",
+	"SELECT t.typname, 'pg_catalog.' || t.typname, 'gchararray', pg_catalog.obj_description(t.oid), NULL, CASE WHEN t.typname ~ '^_' THEN TRUE WHEN typtype = 'p' THEN TRUE WHEN t.typname in ('any', 'anyarray', 'anyelement', 'cid', 'cstring', 'int2vector', 'internal', 'language_handler', 'oidvector', 'opaque', 'record', 'refcursor', 'regclass', 'regoper', 'regoperator', 'regproc', 'regprocedure', 'regtype', 'SET', 'smgr', 'tid', 'trigger', 'unknown', 'void', 'xid', 'oid', 'aclitem') THEN TRUE ELSE FALSE END, CAST (t.oid AS varchar) FROM pg_catalog.pg_type t, pg_catalog.pg_user u, pg_catalog.pg_namespace n WHERE t.typowner=u.usesysid AND n.oid = t.typnamespace AND pg_catalog.pg_type_is_visible(t.oid) AND (typtype='b' OR typtype='p') AND typelem = 0",
 
 	/* I_STMT_SCHEMAS */
-	"SELECT current_database()::information_schema.sql_identifier AS catalog_name, n.nspname::information_schema.sql_identifier AS schema_name, u.rolname::information_schema.sql_identifier AS schema_owner, CASE WHEN n.nspname::information_schema.sql_identifier ~ '^pg_' THEN TRUE WHEN n.nspname::information_schema.sql_identifier = 'information_schema' THEN TRUE ELSE FALSE END FROM pg_namespace n, pg_roles u WHERE n.nspowner = u.oid AND current_database()::information_schema.sql_identifier = ##cat::string",
+	"SELECT current_database() AS catalog_name, n.nspname AS schema_name, u.rolname AS schema_owner, CASE WHEN n.nspname ~ '^pg_' THEN TRUE WHEN n.nspname = 'information_schema' THEN TRUE ELSE FALSE END FROM pg_namespace n, pg_roles u WHERE n.nspowner = u.oid AND current_database() = ##cat::string",
 
 	/* I_STMT_SCHEMAS_ALL */
-	"SELECT current_database()::information_schema.sql_identifier AS catalog_name, n.nspname::information_schema.sql_identifier AS schema_name, u.rolname::information_schema.sql_identifier AS schema_owner, CASE WHEN n.nspname::information_schema.sql_identifier ~ '^pg_' THEN TRUE WHEN n.nspname::information_schema.sql_identifier = 'information_schema' THEN TRUE ELSE FALSE END FROM pg_namespace n, pg_roles u WHERE n.nspowner = u.oid",
+	"SELECT current_database() AS catalog_name, n.nspname AS schema_name, u.rolname AS schema_owner, CASE WHEN n.nspname ~ '^pg_' THEN TRUE WHEN n.nspname = 'information_schema' THEN TRUE ELSE FALSE END FROM pg_namespace n, pg_roles u WHERE n.nspowner = u.oid",
 
 	/* I_STMT_SCHEMA_NAMED */
-	"SELECT current_database()::information_schema.sql_identifier AS catalog_name, n.nspname::information_schema.sql_identifier AS schema_name, u.rolname::information_schema.sql_identifier AS schema_owner, CASE WHEN n.nspname::information_schema.sql_identifier ~ '^pg_' THEN TRUE WHEN n.nspname::information_schema.sql_identifier = 'information_schema' THEN TRUE ELSE FALSE END FROM pg_namespace n, pg_roles u WHERE n.nspowner = u.oid AND current_database()::information_schema.sql_identifier = ##cat::string AND n.nspname::information_schema.sql_identifier = ##name::string",
+	"SELECT current_database() AS catalog_name, n.nspname AS schema_name, u.rolname AS schema_owner, CASE WHEN n.nspname ~ '^pg_' THEN TRUE WHEN n.nspname = 'information_schema' THEN TRUE ELSE FALSE END FROM pg_namespace n, pg_roles u WHERE n.nspowner = u.oid AND current_database() = ##cat::string AND n.nspname = ##name::string",
 
 	/* I_STMT_TABLES */
-	"SELECT current_database()::information_schema.sql_identifier AS table_catalog, nc.nspname::information_schema.sql_identifier AS table_schema, c.relname::information_schema.sql_identifier AS table_name, CASE WHEN nc.oid = pg_my_temp_schema() THEN 'LOCAL TEMPORARY'::text WHEN c.relkind = 'r' THEN 'BASE TABLE' WHEN c.relkind = 'v' THEN 'VIEW' ELSE NULL::text END::information_schema.character_data AS table_type, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END, pg_catalog.obj_description(c.oid), CASE WHEN pg_catalog.pg_table_is_visible(c.oid) IS TRUE AND nc.nspname!='pg_catalog' THEN c.relname ELSE coalesce (nc.nspname || '.', '') || c.relname END, coalesce (nc.nspname || '.', '') || c.relname, o.rolname FROM pg_namespace nc, pg_class c, pg_roles o WHERE current_database()::information_schema.sql_identifier = ##cat::string AND nc.nspname::information_schema.sql_identifier = ##schema::string AND c.relnamespace = nc.oid AND (c.relkind = ANY (ARRAY['r', 'v'])) AND NOT pg_is_oth
 er_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::text) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'DELETE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text) OR has_table_privilege(c.oid, 'TRIGGER'::text)) AND o.oid=c.relowner",
+	"SELECT current_database() AS table_catalog, nc.nspname AS table_schema, c.relname AS table_name, CASE WHEN nc.oid = pg_my_temp_schema() THEN 'LOCAL TEMPORARY' WHEN c.relkind = 'r' THEN 'BASE TABLE' WHEN c.relkind = 'v' THEN 'VIEW' ELSE NULL END AS table_type, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END, pg_catalog.obj_description(c.oid), CASE WHEN pg_catalog.pg_table_is_visible(c.oid) IS TRUE AND nc.nspname!='pg_catalog' THEN c.relname ELSE coalesce (nc.nspname || '.', '') || c.relname END, coalesce (nc.nspname || '.', '') || c.relname, o.rolname FROM pg_namespace nc, pg_class c, pg_roles o WHERE current_database() = ##cat::string AND nc.nspname = ##schema::string AND c.relnamespace = nc.oid AND (c.relkind = ANY (ARRAY['r', 'v'])) AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'SELECT') OR has_table_privilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'DELETE') O
 R has_table_privilege(c.oid, 'REFERENCES') OR has_table_privilege(c.oid, 'TRIGGER')) AND o.oid=c.relowner",
 
 	/* I_STMT_TABLES_ALL */
-	"SELECT current_database()::information_schema.sql_identifier AS table_catalog, nc.nspname::information_schema.sql_identifier AS table_schema, c.relname::information_schema.sql_identifier AS table_name, CASE WHEN nc.oid = pg_my_temp_schema() THEN 'LOCAL TEMPORARY'::text WHEN c.relkind = 'r' THEN 'BASE TABLE' WHEN c.relkind = 'v' THEN 'VIEW' ELSE NULL::text END::information_schema.character_data AS table_type, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END, pg_catalog.obj_description(c.oid), CASE WHEN pg_catalog.pg_table_is_visible(c.oid) IS TRUE AND nc.nspname!='pg_catalog' THEN c.relname ELSE coalesce (nc.nspname || '.', '') || c.relname END, coalesce (nc.nspname || '.', '') || c.relname, o.rolname FROM pg_namespace nc, pg_class c, pg_roles o WHERE c.relnamespace = nc.oid AND (c.relkind = ANY (ARRAY['r', 'v'])) AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::text) OR has_table_privilege(c.oid, 
 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'DELETE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text) OR has_table_privilege(c.oid, 'TRIGGER'::text)) AND o.oid=c.relowner",
+	"SELECT current_database() AS table_catalog, nc.nspname AS table_schema, c.relname AS table_name, CASE WHEN nc.oid = pg_my_temp_schema() THEN 'LOCAL TEMPORARY' WHEN c.relkind = 'r' THEN 'BASE TABLE' WHEN c.relkind = 'v' THEN 'VIEW' ELSE NULL END AS table_type, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END, pg_catalog.obj_description(c.oid), CASE WHEN pg_catalog.pg_table_is_visible(c.oid) IS TRUE AND nc.nspname!='pg_catalog' THEN c.relname ELSE coalesce (nc.nspname || '.', '') || c.relname END, coalesce (nc.nspname || '.', '') || c.relname, o.rolname FROM pg_namespace nc, pg_class c, pg_roles o WHERE c.relnamespace = nc.oid AND (c.relkind = ANY (ARRAY['r', 'v'])) AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'SELECT') OR has_table_privilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'DELETE') OR has_table_privilege(c.oid, 'REFERENCES') OR has_table_privilege(c.oid, 
 'TRIGGER')) AND o.oid=c.relowner",
 
 	/* I_STMT_TABLE_NAMED */
-	"SELECT current_database()::information_schema.sql_identifier AS table_catalog, nc.nspname::information_schema.sql_identifier AS table_schema, c.relname::information_schema.sql_identifier AS table_name, CASE WHEN nc.oid = pg_my_temp_schema() THEN 'LOCAL TEMPORARY'::text WHEN c.relkind = 'r' THEN 'BASE TABLE' WHEN c.relkind = 'v' THEN 'VIEW' ELSE NULL::text END::information_schema.character_data AS table_type, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END, pg_catalog.obj_description(c.oid), CASE WHEN pg_catalog.pg_table_is_visible(c.oid) IS TRUE AND nc.nspname!='pg_catalog' THEN c.relname ELSE coalesce (nc.nspname || '.', '') || c.relname END, coalesce (nc.nspname || '.', '') || c.relname, o.rolname FROM pg_namespace nc, pg_class c, pg_roles o WHERE current_database()::information_schema.sql_identifier = ##cat::string AND nc.nspname::information_schema.sql_identifier = ##schema::string AND c.relnamespace = nc.oid AND (c.relkind = ANY (ARRAY['r', 'v'])) AND NOT pg_is_oth
 er_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::text) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'DELETE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text) OR has_table_privilege(c.oid, 'TRIGGER'::text)) AND o.oid=c.relowner AND c.relname::information_schema.sql_identifier = ##name::string",
+	"SELECT current_database() AS table_catalog, nc.nspname AS table_schema, c.relname AS table_name, CASE WHEN nc.oid = pg_my_temp_schema() THEN 'LOCAL TEMPORARY' WHEN c.relkind = 'r' THEN 'BASE TABLE' WHEN c.relkind = 'v' THEN 'VIEW' ELSE NULL END AS table_type, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END, pg_catalog.obj_description(c.oid), CASE WHEN pg_catalog.pg_table_is_visible(c.oid) IS TRUE AND nc.nspname!='pg_catalog' THEN c.relname ELSE coalesce (nc.nspname || '.', '') || c.relname END, coalesce (nc.nspname || '.', '') || c.relname, o.rolname FROM pg_namespace nc, pg_class c, pg_roles o WHERE current_database() = ##cat::string AND nc.nspname = ##schema::string AND c.relnamespace = nc.oid AND (c.relkind = ANY (ARRAY['r', 'v'])) AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'SELECT') OR has_table_privilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'DELETE') O
 R has_table_privilege(c.oid, 'REFERENCES') OR has_table_privilege(c.oid, 'TRIGGER')) AND o.oid=c.relowner AND c.relname = ##name::string",
 
 	/* I_STMT_VIEWS */
-	"SELECT current_database()::information_schema.sql_identifier AS table_catalog, nc.nspname::information_schema.sql_identifier AS table_schema, c.relname::information_schema.sql_identifier AS table_name, pg_catalog.pg_get_viewdef(c.oid, TRUE), NULL, CASE WHEN c.relkind = 'r'::\"char\" THEN TRUE ELSE FALSE END FROM pg_namespace nc, pg_class c WHERE current_database()::information_schema.sql_identifier = ##cat::string AND nc.nspname::information_schema.sql_identifier = ##schema::string AND c.relnamespace = nc.oid AND c.relkind = 'v' AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::text) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'DELETE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text) OR has_table_privilege(c.oid, 'TRIGGER'::text))",
+	"SELECT current_database() AS table_catalog, nc.nspname AS table_schema, c.relname AS table_name, pg_catalog.pg_get_viewdef(c.oid, TRUE), NULL, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END FROM pg_namespace nc, pg_class c WHERE current_database() = ##cat::string AND nc.nspname = ##schema::string AND c.relnamespace = nc.oid AND c.relkind = 'v' AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'SELECT') OR has_table_privilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'DELETE') OR has_table_privilege(c.oid, 'REFERENCES') OR has_table_privilege(c.oid, 'TRIGGER'))",
 
 	/* I_STMT_VIEWS_ALL */
-	"SELECT current_database()::information_schema.sql_identifier AS table_catalog, nc.nspname::information_schema.sql_identifier AS table_schema, c.relname::information_schema.sql_identifier AS table_name, pg_catalog.pg_get_viewdef(c.oid, TRUE), NULL, CASE WHEN c.relkind = 'r'::\"char\" THEN TRUE ELSE FALSE END FROM pg_namespace nc, pg_class c WHERE c.relnamespace = nc.oid AND c.relkind = 'v' AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::text) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'DELETE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text) OR has_table_privilege(c.oid, 'TRIGGER'::text))",
+	"SELECT current_database() AS table_catalog, nc.nspname AS table_schema, c.relname AS table_name, pg_catalog.pg_get_viewdef(c.oid, TRUE), NULL, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END FROM pg_namespace nc, pg_class c WHERE c.relnamespace = nc.oid AND c.relkind = 'v' AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'SELECT') OR has_table_privilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'DELETE') OR has_table_privilege(c.oid, 'REFERENCES') OR has_table_privilege(c.oid, 'TRIGGER'))",
 
 	/* I_STMT_VIEW_NAMED */
-	"SELECT current_database()::information_schema.sql_identifier AS table_catalog, nc.nspname::information_schema.sql_identifier AS table_schema, c.relname::information_schema.sql_identifier AS table_name, pg_catalog.pg_get_viewdef(c.oid, TRUE), NULL, CASE WHEN c.relkind = 'r'::\"char\" THEN TRUE ELSE FALSE END FROM pg_namespace nc, pg_class c WHERE current_database()::information_schema.sql_identifier = ##cat::string AND nc.nspname::information_schema.sql_identifier = ##schema::string AND c.relnamespace = nc.oid AND c.relkind = 'v' AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::text) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'DELETE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text) OR has_table_privilege(c.oid, 'TRIGGER'::text)) AND c.relname::information_schema.sql_identifier = ##name::string",
+	"SELECT current_database() AS table_catalog, nc.nspname AS table_schema, c.relname AS table_name, pg_catalog.pg_get_viewdef(c.oid, TRUE), NULL, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END FROM pg_namespace nc, pg_class c WHERE current_database() = ##cat::string AND nc.nspname = ##schema::string AND c.relnamespace = nc.oid AND c.relkind = 'v' AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'SELECT') OR has_table_privilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'DELETE') OR has_table_privilege(c.oid, 'REFERENCES') OR has_table_privilege(c.oid, 'TRIGGER')) AND c.relname = ##name::string",
 
 	/* I_STMT_COLUMNS_OF_TABLE */
-	"SELECT current_database(), nc.nspname, c.relname, a.attname, a.attnum, pg_get_expr(ad.adbin, ad.adrelid), CASE WHEN a.attnotnull OR t.typtype = 'd' AND t.typnotnull THEN FALSE ELSE TRUE END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN NULL ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'COL' || current_database() || '.' || nc.nspname || '.' || c.relname || '.' || a.attnum ELSE NULL END, 'gchararray', information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_char_octet_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t
 .*)), information_schema._pg_datetime_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), NULL, NULL, NULL, NULL, NULL, NULL, CASE WHEN pg_get_expr(ad.adbin, ad.adrelid) LIKE 'nextval(%' THEN '" GDA_EXTRA_AUTO_INCREMENT "' ELSE NULL END, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END, pg_catalog.col_description(c.oid, a.attnum), CAST (t.oid AS int8) FROM pg_attribute a LEFT JOIN pg_attrdef ad ON a.attrelid = ad.adrelid AND a.attnum = ad.adnum, pg_class c, pg_namespace nc, pg_type t JOIN pg_namespace nt ON t.typnamespace = nt.oid LEFT JOIN (pg_type bt JOIN pg_namespace nbt ON bt.typnamespace = nbt.oid) ON t.typtype = 'd' AND t.typbasetype = bt.oid WHERE current_database() = ##cat::string AND nc.nspname = ##schema::string AND c.relname = ##name::string AND a.attrelid = c.oid AND a.atttypid = t.oid AND nc.oid = c.relnamespace AND NOT pg_is_other_temp_schema(nc.oid) AND a.attnum > 0 AND NOT a.attisdropped AND (c.relkind = ANY (
 ARRAY['r', 'v'])) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::text) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text))",
+	"SELECT current_database(), nc.nspname, c.relname, a.attname, a.attnum, pg_get_expr(ad.adbin, ad.adrelid), CASE WHEN a.attnotnull OR t.typtype = 'd' AND t.typnotnull THEN FALSE ELSE TRUE END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN NULL ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'COL' || current_database() || '.' || nc.nspname || '.' || c.relname || '.' || a.attnum ELSE NULL END, 'gchararray', information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_char_octet_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), info
 rmation_schema._pg_datetime_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), NULL, NULL, NULL, NULL, NULL, NULL, CASE WHEN pg_get_expr(ad.adbin, ad.adrelid) LIKE 'nextval(%' THEN '" GDA_EXTRA_AUTO_INCREMENT "' ELSE NULL END, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END, pg_catalog.col_description(c.oid, a.attnum), CAST (t.oid AS varchar) FROM pg_attribute a LEFT JOIN pg_attrdef ad ON a.attrelid = ad.adrelid AND a.attnum = ad.adnum, pg_class c, pg_namespace nc, pg_type t JOIN pg_namespace nt ON t.typnamespace = nt.oid LEFT JOIN (pg_type bt JOIN pg_namespace nbt ON bt.typnamespace = nbt.oid) ON t.typtype = 'd' AND t.typbasetype = bt.oid WHERE current_database() = ##cat::string AND nc.nspname = ##schema::string AND c.relname = ##name::string AND a.attrelid = c.oid AND a.atttypid = t.oid AND nc.oid = c.relnamespace AND NOT pg_is_other_temp_schema(nc.oid) AND a.attnum > 0 AND NOT a.attisdropped AND (c.relkind = ANY (ARRAY['
 r', 'v'])) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'SELECT') OR has_table_privilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'REFERENCES'))",
 
 	/* I_STMT_COLUMNS_ALL */
-	"SELECT current_database(), nc.nspname, c.relname, a.attname, a.attnum, pg_get_expr(ad.adbin, ad.adrelid), CASE WHEN a.attnotnull OR t.typtype = 'd' AND t.typnotnull THEN FALSE ELSE TRUE END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN NULL ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'COL' || current_database() || '.' || nc.nspname || '.' || c.relname || '.' || a.attnum ELSE NULL END, 'gchararray', information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_char_octet_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t
 .*)), information_schema._pg_datetime_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), NULL, NULL, NULL, NULL, NULL, NULL, CASE WHEN pg_get_expr(ad.adbin, ad.adrelid) LIKE 'nextval(%' THEN '" GDA_EXTRA_AUTO_INCREMENT "' ELSE NULL END, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END, pg_catalog.col_description(c.oid, a.attnum), CAST (t.oid AS int8) FROM pg_attribute a LEFT JOIN pg_attrdef ad ON a.attrelid = ad.adrelid AND a.attnum = ad.adnum, pg_class c, pg_namespace nc, pg_type t JOIN pg_namespace nt ON t.typnamespace = nt.oid LEFT JOIN (pg_type bt JOIN pg_namespace nbt ON bt.typnamespace = nbt.oid) ON t.typtype = 'd' AND t.typbasetype = bt.oid WHERE a.attrelid = c.oid AND a.atttypid = t.oid AND nc.oid = c.relnamespace AND NOT pg_is_other_temp_schema(nc.oid) AND a.attnum > 0 AND NOT a.attisdropped AND (c.relkind = ANY (ARRAY['r', 'v'])) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::te
 xt) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text))",
+	"SELECT current_database(), nc.nspname, c.relname, a.attname, a.attnum, pg_get_expr(ad.adbin, ad.adrelid), CASE WHEN a.attnotnull OR t.typtype = 'd' AND t.typnotnull THEN FALSE ELSE TRUE END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN NULL ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'COL' || current_database() || '.' || nc.nspname || '.' || c.relname || '.' || a.attnum ELSE NULL END, 'gchararray', information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_char_octet_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), info
 rmation_schema._pg_datetime_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), NULL, NULL, NULL, NULL, NULL, NULL, CASE WHEN pg_get_expr(ad.adbin, ad.adrelid) LIKE 'nextval(%' THEN '" GDA_EXTRA_AUTO_INCREMENT "' ELSE NULL END, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END, pg_catalog.col_description(c.oid, a.attnum), CAST (t.oid AS varchar) FROM pg_attribute a LEFT JOIN pg_attrdef ad ON a.attrelid = ad.adrelid AND a.attnum = ad.adnum, pg_class c, pg_namespace nc, pg_type t JOIN pg_namespace nt ON t.typnamespace = nt.oid LEFT JOIN (pg_type bt JOIN pg_namespace nbt ON bt.typnamespace = nbt.oid) ON t.typtype = 'd' AND t.typbasetype = bt.oid WHERE a.attrelid = c.oid AND a.atttypid = t.oid AND nc.oid = c.relnamespace AND NOT pg_is_other_temp_schema(nc.oid) AND a.attnum > 0 AND NOT a.attisdropped AND (c.relkind = ANY (ARRAY['r', 'v'])) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'SELECT') OR has_table_pr
 ivilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'REFERENCES'))",
 
 	/* I_STMT_TABLES_CONSTRAINTS */
-	"SELECT current_database()::information_schema.sql_identifier AS constraint_catalog, nc.nspname::information_schema.sql_identifier AS constraint_schema, c.conname::information_schema.sql_identifier AS constraint_name, current_database()::information_schema.sql_identifier AS table_catalog, nr.nspname::information_schema.sql_identifier AS table_schema, r.relname::information_schema.sql_identifier AS table_name, CASE c.contype WHEN 'c'::\"char\" THEN 'CHECK'::text WHEN 'f'::\"char\" THEN 'FOREIGN KEY'::text WHEN 'p'::\"char\" THEN 'PRIMARY KEY'::text WHEN 'u'::\"char\" THEN 'UNIQUE'::text ELSE NULL::text END::information_schema.character_data AS constraint_type, CASE c.contype WHEN 'c'::\"char\" THEN c.consrc ELSE NULL END, CASE WHEN c.condeferrable THEN TRUE ELSE FALSE END AS is_deferrable, CASE WHEN c.condeferred THEN TRUE ELSE FALSE END AS initially_deferred FROM pg_namespace nc, pg_namespace nr, pg_constraint c, pg_class r WHERE nc.oid = c.connamespace AND nr.oid = r.relna
 mespace AND c.conrelid = r.oid AND r.relkind = 'r'::\"char\" AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE'::text) OR has_table_privilege(r.oid, 'INSERT'::text) OR has_table_privilege(r.oid, 'UPDATE'::text) OR has_table_privilege(r.oid, 'DELETE'::text) OR has_table_privilege(r.oid, 'REFERENCES'::text) OR has_table_privilege(r.oid, 'TRIGGER'::text)) AND current_database() = ##cat::string AND nr.nspname = ##schema::string AND r.relname = ##name::string "
-	"UNION SELECT current_database()::information_schema.sql_identifier AS constraint_catalog, nr.nspname::information_schema.sql_identifier AS constraint_schema, (((((nr.oid::text || '_'::text) || r.oid::text) || '_'::text) || a.attnum::text) || '_not_null'::text)::information_schema.sql_identifier AS constraint_name, current_database()::information_schema.sql_identifier AS table_catalog, nr.nspname::information_schema.sql_identifier AS table_schema, r.relname::information_schema.sql_identifier AS table_name, 'CHECK'::character varying::information_schema.character_data AS constraint_type, a.attname || ' IS NOT NULL', FALSE AS is_deferrable, FALSE AS initially_deferred FROM pg_namespace nr, pg_class r, pg_attribute a WHERE nr.oid = r.relnamespace AND r.oid = a.attrelid AND a.attnotnull AND a.attnum > 0 AND NOT a.attisdropped AND r.relkind = 'r'::\"char\" AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE'::text) OR has_table_privilege(r.oid, 'SELECT'::
 text) OR has_table_privilege(r.oid, 'INSERT'::text) OR has_table_privilege(r.oid, 'UPDATE'::text) OR has_table_privilege(r.oid, 'DELETE'::text) OR has_table_privilege(r.oid, 'REFERENCES'::text) OR has_table_privilege(r.oid, 'TRIGGER'::text)) AND current_database() = ##cat::string AND nr.nspname = ##schema::string AND r.relname = ##name::string",
+	"SELECT current_database() AS constraint_catalog, nc.nspname AS constraint_schema, c.conname AS constraint_name, current_database() AS table_catalog, nr.nspname AS table_schema, r.relname AS table_name, CASE c.contype WHEN 'c' THEN 'CHECK' WHEN 'f' THEN 'FOREIGN KEY' WHEN 'p' THEN 'PRIMARY KEY' WHEN 'u' THEN 'UNIQUE' ELSE NULL END AS constraint_type, CASE c.contype WHEN 'c' THEN c.consrc ELSE NULL END, CASE WHEN c.condeferrable THEN TRUE ELSE FALSE END AS is_deferrable, CASE WHEN c.condeferred THEN TRUE ELSE FALSE END AS initially_deferred FROM pg_namespace nc, pg_namespace nr, pg_constraint c, pg_class r WHERE nc.oid = c.connamespace AND nr.oid = r.relnamespace AND c.conrelid = r.oid AND r.relkind = 'r' AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE') OR has_table_privilege(r.oid, 'INSERT') OR has_table_privilege(r.oid, 'UPDATE') OR has_table_privilege(r.oid, 'DELETE') OR has_table_privilege(r.oid, 'REFERENCES') OR has_table_privilege(r.oid, 'T
 RIGGER')) AND current_database() = ##cat::string AND nr.nspname = ##schema::string AND r.relname = ##name::string "
+	"UNION SELECT current_database() AS constraint_catalog, nr.nspname AS constraint_schema, (((((nr.oid || '_') || r.oid) || '_') || a.attnum) || '_not_null') AS constraint_name, current_database() AS table_catalog, nr.nspname AS table_schema, r.relname AS table_name, 'CHECK' AS constraint_type, a.attname || ' IS NOT NULL', FALSE AS is_deferrable, FALSE AS initially_deferred FROM pg_namespace nr, pg_class r, pg_attribute a WHERE nr.oid = r.relnamespace AND r.oid = a.attrelid AND a.attnotnull AND a.attnum > 0 AND NOT a.attisdropped AND r.relkind = 'r' AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE') OR has_table_privilege(r.oid, 'SELECT') OR has_table_privilege(r.oid, 'INSERT') OR has_table_privilege(r.oid, 'UPDATE') OR has_table_privilege(r.oid, 'DELETE') OR has_table_privilege(r.oid, 'REFERENCES') OR has_table_privilege(r.oid, 'TRIGGER')) AND current_database() = ##cat::string AND nr.nspname = ##schema::string AND r.relname = ##name::string",
 
 	/* I_STMT_TABLES_CONSTRAINTS_ALL */
-	"SELECT current_database()::information_schema.sql_identifier AS constraint_catalog, nc.nspname::information_schema.sql_identifier AS constraint_schema, c.conname::information_schema.sql_identifier AS constraint_name, current_database()::information_schema.sql_identifier AS table_catalog, nr.nspname::information_schema.sql_identifier AS table_schema, r.relname::information_schema.sql_identifier AS table_name, CASE c.contype WHEN 'c'::\"char\" THEN 'CHECK'::text WHEN 'f'::\"char\" THEN 'FOREIGN KEY'::text WHEN 'p'::\"char\" THEN 'PRIMARY KEY'::text WHEN 'u'::\"char\" THEN 'UNIQUE'::text ELSE NULL::text END::information_schema.character_data AS constraint_type, CASE c.contype WHEN 'c'::\"char\" THEN c.consrc ELSE NULL END, CASE WHEN c.condeferrable THEN TRUE ELSE FALSE END AS is_deferrable, CASE WHEN c.condeferred THEN TRUE ELSE FALSE END AS initially_deferred FROM pg_namespace nc, pg_namespace nr, pg_constraint c, pg_class r WHERE nc.oid = c.connamespace AND nr.oid = r.relna
 mespace AND c.conrelid = r.oid AND r.relkind = 'r'::\"char\" AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE'::text) OR has_table_privilege(r.oid, 'INSERT'::text) OR has_table_privilege(r.oid, 'UPDATE'::text) OR has_table_privilege(r.oid, 'DELETE'::text) OR has_table_privilege(r.oid, 'REFERENCES'::text) OR has_table_privilege(r.oid, 'TRIGGER'::text)) "
-	"UNION SELECT current_database()::information_schema.sql_identifier AS constraint_catalog, nr.nspname::information_schema.sql_identifier AS constraint_schema, (((((nr.oid::text || '_'::text) || r.oid::text) || '_'::text) || a.attnum::text) || '_not_null'::text)::information_schema.sql_identifier AS constraint_name, current_database()::information_schema.sql_identifier AS table_catalog, nr.nspname::information_schema.sql_identifier AS table_schema, r.relname::information_schema.sql_identifier AS table_name, 'CHECK'::character varying::information_schema.character_data AS constraint_type, a.attname || ' IS NOT NULL', FALSE AS is_deferrable, FALSE AS initially_deferred FROM pg_namespace nr, pg_class r, pg_attribute a WHERE nr.oid = r.relnamespace AND r.oid = a.attrelid AND a.attnotnull AND a.attnum > 0 AND NOT a.attisdropped AND r.relkind = 'r'::\"char\" AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE'::text) OR has_table_privilege(r.oid, 'SELECT'::
 text) OR has_table_privilege(r.oid, 'INSERT'::text) OR has_table_privilege(r.oid, 'UPDATE'::text) OR has_table_privilege(r.oid, 'DELETE'::text) OR has_table_privilege(r.oid, 'REFERENCES'::text) OR has_table_privilege(r.oid, 'TRIGGER'::text))",
+	"SELECT current_database() AS constraint_catalog, nc.nspname AS constraint_schema, c.conname AS constraint_name, current_database() AS table_catalog, nr.nspname AS table_schema, r.relname AS table_name, CASE c.contype WHEN 'c' THEN 'CHECK' WHEN 'f' THEN 'FOREIGN KEY' WHEN 'p' THEN 'PRIMARY KEY' WHEN 'u' THEN 'UNIQUE' ELSE NULL END AS constraint_type, CASE c.contype WHEN 'c' THEN c.consrc ELSE NULL END, CASE WHEN c.condeferrable THEN TRUE ELSE FALSE END AS is_deferrable, CASE WHEN c.condeferred THEN TRUE ELSE FALSE END AS initially_deferred FROM pg_namespace nc, pg_namespace nr, pg_constraint c, pg_class r WHERE nc.oid = c.connamespace AND nr.oid = r.relnamespace AND c.conrelid = r.oid AND r.relkind = 'r' AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE') OR has_table_privilege(r.oid, 'INSERT') OR has_table_privilege(r.oid, 'UPDATE') OR has_table_privilege(r.oid, 'DELETE') OR has_table_privilege(r.oid, 'REFERENCES') OR has_table_privilege(r.oid, 'T
 RIGGER')) "
+	"UNION SELECT current_database() AS constraint_catalog, nr.nspname AS constraint_schema, (((((nr.oid || '_') || r.oid) || '_') || a.attnum) || '_not_null') AS constraint_name, current_database() AS table_catalog, nr.nspname AS table_schema, r.relname AS table_name, 'CHECK' AS constraint_type, a.attname || ' IS NOT NULL', FALSE AS is_deferrable, FALSE AS initially_deferred FROM pg_namespace nr, pg_class r, pg_attribute a WHERE nr.oid = r.relnamespace AND r.oid = a.attrelid AND a.attnotnull AND a.attnum > 0 AND NOT a.attisdropped AND r.relkind = 'r' AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE') OR has_table_privilege(r.oid, 'SELECT') OR has_table_privilege(r.oid, 'INSERT') OR has_table_privilege(r.oid, 'UPDATE') OR has_table_privilege(r.oid, 'DELETE') OR has_table_privilege(r.oid, 'REFERENCES') OR has_table_privilege(r.oid, 'TRIGGER'))",
 
 	/* I_STMT_TABLES_CONSTRAINT_NAMED */
 	"SELECT constraint_catalog, constraint_schema, constraint_name, table_catalog, table_schema, table_name, constraint_type, NULL, CASE WHEN is_deferrable = 'YES' THEN TRUE ELSE FALSE END, CASE WHEN initially_deferred = 'YES' THEN TRUE ELSE FALSE END FROM information_schema.table_constraints WHERE table_catalog = ##cat::string AND table_schema = ##schema::string AND table_name = ##name::string AND constraint_name = ##name2::string",
 
 	/* I_STMT_REF_CONSTRAINTS */
-	"SELECT current_database(), nt.nspname, t.relname, c.conname, current_database(), nref.nspname, ref.relname, pkc.conname, CASE c.confmatchtype WHEN 'f'::\"char\" THEN 'FULL'::text WHEN 'p'::\"char\" THEN 'PARTIAL'::text WHEN 'u'::\"char\" THEN 'NONE'::text ELSE NULL::text END AS match_option, CASE c.confupdtype WHEN 'c'::\"char\" THEN 'CASCADE'::text WHEN 'n'::\"char\" THEN 'SET NULL'::text WHEN 'd'::\"char\" THEN 'SET DEFAULT'::text WHEN 'r'::\"char\" THEN 'RESTRICT'::text WHEN 'a'::\"char\" THEN 'NO ACTION'::text ELSE NULL::text END AS update_rule, CASE c.confdeltype WHEN 'c'::\"char\" THEN 'CASCADE'::text WHEN 'n'::\"char\" THEN 'SET NULL'::text WHEN 'd'::\"char\" THEN 'SET DEFAULT'::text WHEN 'r'::\"char\" THEN 'RESTRICT'::text WHEN 'a'::\"char\" THEN 'NO ACTION'::text ELSE NULL::text END AS delete_rule FROM pg_constraint c INNER JOIN pg_class t ON (c.conrelid=t.oid) INNER JOIN pg_namespace nt ON (nt.oid=t.relnamespace) INNER JOIN pg_class ref ON (c.confrelid=ref.oid) I
 NNER JOIN pg_namespace nref ON (nref.oid=ref.relnamespace) INNER JOIN pg_constraint pkc ON (c.confrelid = pkc.conrelid AND information_schema._pg_keysequal(c.confkey, pkc.conkey) AND pkc.contype='p') WHERE c.contype = 'f' AND current_database() = ##cat::string AND nt.nspname = ##schema::string AND t.relname = ##name::string AND c.conname = ##name2::string",
+	"SELECT current_database(), nt.nspname, t.relname, c.conname, current_database(), nref.nspname, ref.relname, pkc.conname, CASE c.confmatchtype WHEN 'f' THEN 'FULL' WHEN 'p' THEN 'PARTIAL' WHEN 'u' THEN 'NONE' ELSE NULL END AS match_option, CASE c.confupdtype WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' WHEN 'r' THEN 'RESTRICT' WHEN 'a' THEN 'NO ACTION' ELSE NULL END AS update_rule, CASE c.confdeltype WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' WHEN 'r' THEN 'RESTRICT' WHEN 'a' THEN 'NO ACTION' ELSE NULL END AS delete_rule FROM pg_constraint c INNER JOIN pg_class t ON (c.conrelid=t.oid) INNER JOIN pg_namespace nt ON (nt.oid=t.relnamespace) INNER JOIN pg_class ref ON (c.confrelid=ref.oid) INNER JOIN pg_namespace nref ON (nref.oid=ref.relnamespace) INNER JOIN pg_constraint pkc ON (c.confrelid = pkc.conrelid AND information_schema._pg_keysequal(c.confkey, pkc.conkey) AND pkc.contype='p') WHERE c.contype = 'f' AND 
 current_database() = ##cat::string AND nt.nspname = ##schema::string AND t.relname = ##name::string AND c.conname = ##name2::string",
 
 	/* I_STMT_REF_CONSTRAINTS_ALL */
-	"SELECT current_database(), nt.nspname, t.relname, c.conname, current_database(), nref.nspname, ref.relname, pkc.conname, CASE c.confmatchtype WHEN 'f'::\"char\" THEN 'FULL'::text WHEN 'p'::\"char\" THEN 'PARTIAL'::text WHEN 'u'::\"char\" THEN 'NONE'::text ELSE NULL::text END AS match_option, CASE c.confupdtype WHEN 'c'::\"char\" THEN 'CASCADE'::text WHEN 'n'::\"char\" THEN 'SET NULL'::text WHEN 'd'::\"char\" THEN 'SET DEFAULT'::text WHEN 'r'::\"char\" THEN 'RESTRICT'::text WHEN 'a'::\"char\" THEN 'NO ACTION'::text ELSE NULL::text END AS update_rule, CASE c.confdeltype WHEN 'c'::\"char\" THEN 'CASCADE'::text WHEN 'n'::\"char\" THEN 'SET NULL'::text WHEN 'd'::\"char\" THEN 'SET DEFAULT'::text WHEN 'r'::\"char\" THEN 'RESTRICT'::text WHEN 'a'::\"char\" THEN 'NO ACTION'::text ELSE NULL::text END AS delete_rule FROM pg_constraint c INNER JOIN pg_class t ON (c.conrelid=t.oid) INNER JOIN pg_namespace nt ON (nt.oid=t.relnamespace) INNER JOIN pg_class ref ON (c.confrelid=ref.oid) I
 NNER JOIN pg_namespace nref ON (nref.oid=ref.relnamespace) INNER JOIN pg_constraint pkc ON (c.confrelid = pkc.conrelid AND information_schema._pg_keysequal(c.confkey, pkc.conkey) AND pkc.contype='p') WHERE c.contype = 'f'",
+	"SELECT current_database(), nt.nspname, t.relname, c.conname, current_database(), nref.nspname, ref.relname, pkc.conname, CASE c.confmatchtype WHEN 'f' THEN 'FULL' WHEN 'p' THEN 'PARTIAL' WHEN 'u' THEN 'NONE' ELSE NULL END AS match_option, CASE c.confupdtype WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' WHEN 'r' THEN 'RESTRICT' WHEN 'a' THEN 'NO ACTION' ELSE NULL END AS update_rule, CASE c.confdeltype WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' WHEN 'r' THEN 'RESTRICT' WHEN 'a' THEN 'NO ACTION' ELSE NULL END AS delete_rule FROM pg_constraint c INNER JOIN pg_class t ON (c.conrelid=t.oid) INNER JOIN pg_namespace nt ON (nt.oid=t.relnamespace) INNER JOIN pg_class ref ON (c.confrelid=ref.oid) INNER JOIN pg_namespace nref ON (nref.oid=ref.relnamespace) INNER JOIN pg_constraint pkc ON (c.confrelid = pkc.conrelid AND information_schema._pg_keysequal(c.confkey, pkc.conkey) AND pkc.contype='p') WHERE c.contype = 'f'",
 
 	/* I_STMT_KEY_COLUMN_USAGE */
 	"SELECT table_catalog, table_schema, table_name, constraint_name, column_name, ordinal_position FROM information_schema.key_column_usage WHERE table_catalog = ##cat::string AND table_schema = ##schema::string AND table_name = ##name::string AND constraint_name = ##name2::string",
@@ -154,12 +162,12 @@ static gchar *internal_sql[] = {
 	"SELECT table_catalog, table_schema, table_name, constraint_name, column_name, ordinal_position FROM information_schema.key_column_usage",
 
 	/* I_STMT_CHECK_COLUMN_USAGE */
-	"SELECT current_database()::information_schema.sql_identifier AS table_catalog, nr.nspname::information_schema.sql_identifier AS table_schema, r.relname::information_schema.sql_identifier AS table_name, c.conname::information_schema.sql_identifier AS constraint_name,a.attname FROM pg_namespace nc, pg_namespace nr, pg_constraint c, pg_class r, pg_attribute a, (SELECT sc.oid, information_schema._pg_expandarray (sc.conkey) as x FROM pg_constraint sc WHERE sc.contype = 'c') ss WHERE nc.oid = c.connamespace AND nr.oid = r.relnamespace AND c.conrelid = r.oid AND r.relkind = 'r'::\"char\" AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE'::text) OR has_table_privilege(r.oid, 'INSERT'::text) OR has_table_privilege(r.oid, 'UPDATE'::text) OR has_table_privilege(r.oid, 'DELETE'::text) OR has_table_privilege(r.oid, 'REFERENCES'::text) OR has_table_privilege(r.oid, 'TRIGGER'::text)) AND c.contype = 'c' AND ss.oid = c.oid AND a.attrelid = r.oid AND a.attnum = (s
 s.x).x AND current_database() = ##cat::string AND nr.nspname = ##schema::string AND r.relname = ##name::string AND c.conname = ##name2::string "
-	"UNION SELECT current_database()::information_schema.sql_identifier AS table_catalog, nr.nspname::information_schema.sql_identifier AS table_schema, r.relname::information_schema.sql_identifier AS table_name, (((((nr.oid::text || '_'::text) || r.oid::text) || '_'::text) || a.attnum::text) || '_not_null'::text)::information_schema.sql_identifier AS constraint_name, a.attname FROM pg_namespace nr, pg_class r, pg_attribute a WHERE nr.oid = r.relnamespace AND r.oid = a.attrelid AND a.attnotnull AND a.attnum > 0 AND NOT a.attisdropped AND r.relkind = 'r'::\"char\" AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE'::text) OR has_table_privilege(r.oid, 'SELECT'::text) OR has_table_privilege(r.oid, 'INSERT'::text) OR has_table_privilege(r.oid, 'UPDATE'::text) OR has_table_privilege(r.oid, 'DELETE'::text) OR has_table_privilege(r.oid, 'REFERENCES'::text) OR has_table_privilege(r.oid, 'TRIGGER'::text)) AND current_database() = ##cat::string AND nr.nspname = 
 ##schema::string AND r.relname = ##name::string AND (((((nr.oid::text || '_'::text) || r.oid::text) || '_'::text) || a.attnum::text) || '_not_null'::text) = ##name2::string",
+	"SELECT current_database() AS table_catalog, nr.nspname AS table_schema, r.relname AS table_name, c.conname AS constraint_name,a.attname FROM pg_namespace nc, pg_namespace nr, pg_constraint c, pg_class r, pg_attribute a, (SELECT sc.oid, information_schema._pg_expandarray (sc.conkey) as x FROM pg_constraint sc WHERE sc.contype = 'c') ss WHERE nc.oid = c.connamespace AND nr.oid = r.relnamespace AND c.conrelid = r.oid AND r.relkind = 'r' AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE') OR has_table_privilege(r.oid, 'INSERT') OR has_table_privilege(r.oid, 'UPDATE') OR has_table_privilege(r.oid, 'DELETE') OR has_table_privilege(r.oid, 'REFERENCES') OR has_table_privilege(r.oid, 'TRIGGER')) AND c.contype = 'c' AND ss.oid = c.oid AND a.attrelid = r.oid AND a.attnum = (ss.x).x AND current_database() = ##cat::string AND nr.nspname = ##schema::string AND r.relname = ##name::string AND c.conname = ##name2::string "
+	"UNION SELECT current_database() AS table_catalog, nr.nspname AS table_schema, r.relname AS table_name, (((((nr.oid || '_') || r.oid) || '_') || a.attnum) || '_not_null') AS constraint_name, a.attname FROM pg_namespace nr, pg_class r, pg_attribute a WHERE nr.oid = r.relnamespace AND r.oid = a.attrelid AND a.attnotnull AND a.attnum > 0 AND NOT a.attisdropped AND r.relkind = 'r' AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE') OR has_table_privilege(r.oid, 'SELECT') OR has_table_privilege(r.oid, 'INSERT') OR has_table_privilege(r.oid, 'UPDATE') OR has_table_privilege(r.oid, 'DELETE') OR has_table_privilege(r.oid, 'REFERENCES') OR has_table_privilege(r.oid, 'TRIGGER')) AND current_database() = ##cat::string AND nr.nspname = ##schema::string AND r.relname = ##name::string AND (((((nr.oid || '_') || r.oid) || '_') || a.attnum) || '_not_null') = ##name2::string",
 
 	/* I_STMT_CHECK_COLUMN_USAGE_ALL */
-	"SELECT current_database()::information_schema.sql_identifier AS table_catalog, nr.nspname::information_schema.sql_identifier AS table_schema, r.relname::information_schema.sql_identifier AS table_name, c.conname::information_schema.sql_identifier AS constraint_name,a.attname FROM pg_namespace nc, pg_namespace nr, pg_constraint c, pg_class r, pg_attribute a, (SELECT sc.oid, information_schema._pg_expandarray (sc.conkey) as x FROM pg_constraint sc WHERE sc.contype = 'c') ss WHERE nc.oid = c.connamespace AND nr.oid = r.relnamespace AND c.conrelid = r.oid AND r.relkind = 'r'::\"char\" AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE'::text) OR has_table_privilege(r.oid, 'INSERT'::text) OR has_table_privilege(r.oid, 'UPDATE'::text) OR has_table_privilege(r.oid, 'DELETE'::text) OR has_table_privilege(r.oid, 'REFERENCES'::text) OR has_table_privilege(r.oid, 'TRIGGER'::text)) AND c.contype = 'c' AND ss.oid = c.oid AND a.attrelid = r.oid AND a.attnum = (s
 s.x).x "
-	"UNION SELECT current_database()::information_schema.sql_identifier AS table_catalog, nr.nspname::information_schema.sql_identifier AS table_schema, r.relname::information_schema.sql_identifier AS table_name, (((((nr.oid::text || '_'::text) || r.oid::text) || '_'::text) || a.attnum::text) || '_not_null'::text)::information_schema.sql_identifier AS constraint_name, a.attname FROM pg_namespace nr, pg_class r, pg_attribute a WHERE nr.oid = r.relnamespace AND r.oid = a.attrelid AND a.attnotnull AND a.attnum > 0 AND NOT a.attisdropped AND r.relkind = 'r'::\"char\" AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE'::text) OR has_table_privilege(r.oid, 'SELECT'::text) OR has_table_privilege(r.oid, 'INSERT'::text) OR has_table_privilege(r.oid, 'UPDATE'::text) OR has_table_privilege(r.oid, 'DELETE'::text) OR has_table_privilege(r.oid, 'REFERENCES'::text) OR has_table_privilege(r.oid, 'TRIGGER'::text))",
+	"SELECT current_database() AS table_catalog, nr.nspname AS table_schema, r.relname AS table_name, c.conname AS constraint_name,a.attname FROM pg_namespace nc, pg_namespace nr, pg_constraint c, pg_class r, pg_attribute a, (SELECT sc.oid, information_schema._pg_expandarray (sc.conkey) as x FROM pg_constraint sc WHERE sc.contype = 'c') ss WHERE nc.oid = c.connamespace AND nr.oid = r.relnamespace AND c.conrelid = r.oid AND r.relkind = 'r' AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE') OR has_table_privilege(r.oid, 'INSERT') OR has_table_privilege(r.oid, 'UPDATE') OR has_table_privilege(r.oid, 'DELETE') OR has_table_privilege(r.oid, 'REFERENCES') OR has_table_privilege(r.oid, 'TRIGGER')) AND c.contype = 'c' AND ss.oid = c.oid AND a.attrelid = r.oid AND a.attnum = (ss.x).x "
+	"UNION SELECT current_database() AS table_catalog, nr.nspname AS table_schema, r.relname AS table_name, (((((nr.oid || '_') || r.oid) || '_') || a.attnum) || '_not_null') AS constraint_name, a.attname FROM pg_namespace nr, pg_class r, pg_attribute a WHERE nr.oid = r.relnamespace AND r.oid = a.attrelid AND a.attnotnull AND a.attnum > 0 AND NOT a.attisdropped AND r.relkind = 'r' AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE') OR has_table_privilege(r.oid, 'SELECT') OR has_table_privilege(r.oid, 'INSERT') OR has_table_privilege(r.oid, 'UPDATE') OR has_table_privilege(r.oid, 'DELETE') OR has_table_privilege(r.oid, 'REFERENCES') OR has_table_privilege(r.oid, 'TRIGGER'))",
 
 	/* I_STMT_UDT */
 	"SELECT pg_catalog.current_database() as cat, n.nspname, t.typname, 'gchararray', pg_catalog.obj_description(t.oid), CASE WHEN pg_catalog.pg_type_is_visible(t.oid) IS TRUE THEN t.typname ELSE coalesce (n.nspname || '.', '') || t.typname END, coalesce (n.nspname || '.', '') || t.typname, CASE WHEN t.typname ~ '^_' THEN TRUE WHEN t.typname in ('any', 'anyarray', 'anyelement', 'cid', 'cstring', 'int2vector', 'internal', 'language_handler', 'oidvector', 'opaque', 'record', 'refcursor', 'regclass', 'regoper', 'regoperator', 'regproc', 'regprocedure', 'regtype', 'SET', 'smgr', 'tid', 'trigger', 'unknown', 'void', 'xid', 'oid', 'aclitem') THEN TRUE ELSE FALSE END, o.rolname FROM pg_catalog.pg_type t, pg_catalog.pg_user u, pg_catalog.pg_namespace n , pg_roles o WHERE t.typowner=u.usesysid AND n.oid = t.typnamespace AND pg_catalog.pg_type_is_visible(t.oid) AND (t.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid)) AND o.oid=t.typowner AND 
 pg_catalog.current_database() = ##cat::string AND n.nspname = ##schema::string",
@@ -168,16 +176,16 @@ static gchar *internal_sql[] = {
 	"SELECT pg_catalog.current_database(), n.nspname, t.typname, 'gchararray', pg_catalog.obj_description(t.oid), CASE WHEN pg_catalog.pg_type_is_visible(t.oid) IS TRUE THEN t.typname ELSE coalesce (n.nspname || '.', '') || t.typname END, coalesce (n.nspname || '.', '') || t.typname, CASE WHEN t.typname ~ '^_' THEN TRUE WHEN t.typname in ('any', 'anyarray', 'anyelement', 'cid', 'cstring', 'int2vector', 'internal', 'language_handler', 'oidvector', 'opaque', 'record', 'refcursor', 'regclass', 'regoper', 'regoperator', 'regproc', 'regprocedure', 'regtype', 'SET', 'smgr', 'tid', 'trigger', 'unknown', 'void', 'xid', 'oid', 'aclitem') THEN TRUE ELSE FALSE END, o.rolname FROM pg_catalog.pg_type t, pg_catalog.pg_user u, pg_catalog.pg_namespace n , pg_roles o WHERE t.typowner=u.usesysid AND n.oid = t.typnamespace AND pg_catalog.pg_type_is_visible(t.oid) AND (t.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid)) AND o.oid=t.typowner",
 
 	/* I_STMT_UDT_COLUMNS */
-	"select pg_catalog.current_database(), n.nspname, udt.typname, a.attname, a.attnum, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN NULL ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'UDT' || current_database() || '.' || n.nspname || '.' || udt.typname || '.' || a.attnum ELSE NULL END, information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_char_octet_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_datetime_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truety
 pmod(a.*, t.*)), NULL, NULL , NULL, NULL, NULL, NULL FROM pg_type udt INNER JOIN pg_namespace n ON (udt.typnamespace=n.oid) INNER JOIN pg_attribute a ON (a.attrelid=udt.typrelid) INNER JOIN pg_type t ON (a.atttypid=t.oid) INNER JOIN pg_namespace nt ON (t.typnamespace = nt.oid) WHERE udt.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = udt.typrelid) AND pg_catalog.current_database() = ##cat::string AND n.nspname = ##schema::string AND udt.typname = ##name::string",
+	"select pg_catalog.current_database(), n.nspname, udt.typname, a.attname, a.attnum, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN NULL ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'UDT' || current_database() || '.' || n.nspname || '.' || udt.typname || '.' || a.attnum ELSE NULL END, information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_char_octet_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_datetime_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, 
 t.*)), NULL, NULL , NULL, NULL, NULL, NULL FROM pg_type udt INNER JOIN pg_namespace n ON (udt.typnamespace=n.oid) INNER JOIN pg_attribute a ON (a.attrelid=udt.typrelid) INNER JOIN pg_type t ON (a.atttypid=t.oid) INNER JOIN pg_namespace nt ON (t.typnamespace = nt.oid) WHERE udt.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = udt.typrelid) AND pg_catalog.current_database() = ##cat::string AND n.nspname = ##schema::string AND udt.typname = ##name::string",
 
 	/* I_STMT_UDT_COLUMNS_ALL */
-	"select pg_catalog.current_database(), n.nspname, udt.typname, a.attname, a.attnum, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN NULL ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'UDT' || current_database() || '.' || n.nspname || '.' || udt.typname || '.' || a.attnum ELSE NULL END, information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_char_octet_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_datetime_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truety
 pmod(a.*, t.*)), NULL, NULL , NULL, NULL, NULL, NULL FROM pg_type udt INNER JOIN pg_namespace n ON (udt.typnamespace=n.oid) INNER JOIN pg_attribute a ON (a.attrelid=udt.typrelid) INNER JOIN pg_type t ON (a.atttypid=t.oid) INNER JOIN pg_namespace nt ON (t.typnamespace = nt.oid) WHERE udt.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = udt.typrelid)",
+	"select pg_catalog.current_database(), n.nspname, udt.typname, a.attname, a.attnum, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN NULL ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'UDT' || current_database() || '.' || n.nspname || '.' || udt.typname || '.' || a.attnum ELSE NULL END, information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_char_octet_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_datetime_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, 
 t.*)), NULL, NULL , NULL, NULL, NULL, NULL FROM pg_type udt INNER JOIN pg_namespace n ON (udt.typnamespace=n.oid) INNER JOIN pg_attribute a ON (a.attrelid=udt.typrelid) INNER JOIN pg_type t ON (a.atttypid=t.oid) INNER JOIN pg_namespace nt ON (t.typnamespace = nt.oid) WHERE udt.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = udt.typrelid)",
 
 	/* I_STMT_DOMAINS */
-	"SELECT pg_catalog.current_database(), nt.nspname, t.typname, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN NULL ELSE coalesce (nbt.nspname || '.', '') || bt.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'DOM' || current_database() || '.' || nt.nspname || '.' || t.typname ELSE NULL END, 'gchararray', information_schema._pg_char_max_length(t.typbasetype, t.typtypmod), information_schema._pg_char_octet_length(t.typbasetype, t.typtypmod),  NULL, NULL, NULL, NULL, NULL, NULL,  information_schema._pg_numeric_precision(t.typbasetype, t.typtypmod), information_schema._pg_numeric_scale(t.typbasetype, t.typtypmod), t.typdefault, pg_catalog.obj_description(t.oid), CASE WHEN pg_catalog.pg_type_is_visible(t.oid) IS TRUE THEN t.typname ELSE coalesce (nt.nspname || '.', '') || t.typname END, coalesce (nt.nspname || '.', '') || t.typname, FALSE, o.rolname FROM pg_type t, pg_namespace nt, pg_type bt, pg_namespace nbt, pg_roles o WHERE t.typnamespace = nt.oid AND 
 t.typbasetype = bt.oid AND bt.typnamespace = nbt.oid AND t.typtype = 'd' AND o.oid=t.typowner AND pg_catalog.current_database() = ##cat::string AND nt.nspname = ##schema::string", 
+	"SELECT pg_catalog.current_database(), nt.nspname, t.typname, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN NULL ELSE coalesce (nbt.nspname || '.', '') || bt.typname END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'DOM' || current_database() || '.' || nt.nspname || '.' || t.typname ELSE NULL END, 'gchararray', information_schema._pg_char_max_length(t.typbasetype, t.typtypmod), information_schema._pg_char_octet_length(t.typbasetype, t.typtypmod),  NULL, NULL, NULL, NULL, NULL, NULL,  information_schema._pg_numeric_precision(t.typbasetype, t.typtypmod), information_schema._pg_numeric_scale(t.typbasetype, t.typtypmod), t.typdefault, pg_catalog.obj_description(t.oid), CASE WHEN pg_catalog.pg_type_is_visible(t.oid) IS TRUE THEN t.typname ELSE coalesce (nt.nspname || '.', '') || t.typname END, coalesce (nt.nspname || '.', '') || t.typname, FALSE, o.rolname FROM pg_type t, pg_namespace nt, pg_type bt, pg_namespace nbt, pg_roles o WHERE t.typnamespace = nt.oid AND t.typbaset
 ype = bt.oid AND bt.typnamespace = nbt.oid AND t.typtype = 'd' AND o.oid=t.typowner AND pg_catalog.current_database() = ##cat::string AND nt.nspname = ##schema::string", 
 
 	/* I_STMT_DOMAINS_ALL */
-	"SELECT pg_catalog.current_database(), nt.nspname, t.typname, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN NULL ELSE coalesce (nbt.nspname || '.', '') || bt.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'DOM' || current_database() || '.' || nt.nspname || '.' || t.typname ELSE NULL END, 'gchararray', information_schema._pg_char_max_length(t.typbasetype, t.typtypmod), information_schema._pg_char_octet_length(t.typbasetype, t.typtypmod),  NULL, NULL, NULL, NULL, NULL, NULL,  information_schema._pg_numeric_precision(t.typbasetype, t.typtypmod), information_schema._pg_numeric_scale(t.typbasetype, t.typtypmod), t.typdefault, pg_catalog.obj_description(t.oid), CASE WHEN pg_catalog.pg_type_is_visible(t.oid) IS TRUE THEN t.typname ELSE coalesce (nt.nspname || '.', '') || t.typname END, coalesce (nt.nspname || '.', '') || t.typname, FALSE, o.rolname FROM pg_type t, pg_namespace nt, pg_type bt, pg_namespace nbt, pg_roles o WHERE t.typnamespace = nt.oid AND 
 t.typbasetype = bt.oid AND bt.typnamespace = nbt.oid AND t.typtype = 'd' AND o.oid=t.typowner",
+	"SELECT pg_catalog.current_database(), nt.nspname, t.typname, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN NULL ELSE coalesce (nbt.nspname || '.', '') || bt.typname END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'DOM' || current_database() || '.' || nt.nspname || '.' || t.typname ELSE NULL END, 'gchararray', information_schema._pg_char_max_length(t.typbasetype, t.typtypmod), information_schema._pg_char_octet_length(t.typbasetype, t.typtypmod),  NULL, NULL, NULL, NULL, NULL, NULL,  information_schema._pg_numeric_precision(t.typbasetype, t.typtypmod), information_schema._pg_numeric_scale(t.typbasetype, t.typtypmod), t.typdefault, pg_catalog.obj_description(t.oid), CASE WHEN pg_catalog.pg_type_is_visible(t.oid) IS TRUE THEN t.typname ELSE coalesce (nt.nspname || '.', '') || t.typname END, coalesce (nt.nspname || '.', '') || t.typname, FALSE, o.rolname FROM pg_type t, pg_namespace nt, pg_type bt, pg_namespace nbt, pg_roles o WHERE t.typnamespace = nt.oid AND t.typbaset
 ype = bt.oid AND bt.typnamespace = nbt.oid AND t.typtype = 'd' AND o.oid=t.typowner",
 
 	/* I_STMT_DOMAINS_CONSTRAINTS */
 	"SELECT constraint_catalog, constraint_schema, constraint_name, domain_catalog, domain_schema, domain_name, NULL, CASE WHEN is_deferrable = 'YES' THEN TRUE ELSE FALSE END, CASE WHEN initially_deferred = 'YES' THEN TRUE ELSE FALSE END FROM information_schema.domain_constraints WHERE domain_catalog = ##cat::string AND domain_schema = ##schema::string AND domain_name = ##name::string",
@@ -192,13 +200,13 @@ static gchar *internal_sql[] = {
 	"SELECT view_catalog, view_schema, view_name, table_catalog, table_schema, table_name, column_name FROM information_schema.view_column_usage",
 
 	/* I_STMT_TRIGGERS */
-	"SELECT current_database()::information_schema.sql_identifier, n.nspname::information_schema.sql_identifier, t.tgname::information_schema.sql_identifier, em.text::information_schema.character_data, current_database()::information_schema.sql_identifier, n.nspname::information_schema.sql_identifier, c.relname::information_schema.sql_identifier, \"substring\"(pg_get_triggerdef(t.oid), \"position\"(\"substring\"(pg_get_triggerdef(t.oid), 48), 'EXECUTE PROCEDURE'::text) + 47)::information_schema.character_data AS action_statement, CASE WHEN (t.tgtype::integer & 1) = 1 THEN 'ROW'::text ELSE 'STATEMENT'::text END::information_schema.character_data AS action_orientation, CASE WHEN (t.tgtype::integer & 2) = 2 THEN 'BEFORE'::text ELSE 'AFTER'::text END::information_schema.character_data AS condition_timing, pg_catalog.obj_description(t.oid), t.tgname, t.tgname FROM pg_namespace n, pg_class c, pg_trigger t, (( SELECT 4, 'INSERT' UNION ALL SELECT 8, 'DELETE') UNION ALL SELECT 16, 'UPDA
 TE') em(num, text) WHERE n.oid = c.relnamespace AND c.oid = t.tgrelid AND (t.tgtype::integer & em.num) <> 0 AND NOT t.tgisconstraint AND NOT pg_is_other_temp_schema(n.oid) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'DELETE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text) OR has_table_privilege(c.oid, 'TRIGGER'::text)) AND current_database() = ##cat::string AND n.nspname = ##schema::string AND c.relname = ##name::string",
+	"SELECT current_database(), n.nspname, t.tgname, em.text, current_database(), n.nspname, c.relname, \"substring\"(pg_get_triggerdef(t.oid), \"position\"(\"substring\"(pg_get_triggerdef(t.oid), 48), 'EXECUTE PROCEDURE') + 47) AS action_statement, CASE WHEN (t.tgtype & 1) = 1 THEN 'ROW' ELSE 'STATEMENT' END AS action_orientation, CASE WHEN (t.tgtype & 2) = 2 THEN 'BEFORE' ELSE 'AFTER' END AS condition_timing, pg_catalog.obj_description(t.oid), t.tgname, t.tgname FROM pg_namespace n, pg_class c, pg_trigger t, (( SELECT 4, 'INSERT' UNION ALL SELECT 8, 'DELETE') UNION ALL SELECT 16, 'UPDATE') em(num, text) WHERE n.oid = c.relnamespace AND c.oid = t.tgrelid AND (t.tgtype & em.num) <> 0 AND NOT t.tgisconstraint AND NOT pg_is_other_temp_schema(n.oid) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'DELETE') OR has_table_privilege(c.oid, 'REFERENCES') OR has_table_privilege(c.oid, 'TR
 IGGER')) AND current_database() = ##cat::string AND n.nspname = ##schema::string AND c.relname = ##name::string",
 	
 	/* I_STMT_TRIGGERS_ALL */
-	"SELECT current_database()::information_schema.sql_identifier, n.nspname::information_schema.sql_identifier, t.tgname::information_schema.sql_identifier, em.text::information_schema.character_data, current_database()::information_schema.sql_identifier, n.nspname::information_schema.sql_identifier, c.relname::information_schema.sql_identifier, \"substring\"(pg_get_triggerdef(t.oid), \"position\"(\"substring\"(pg_get_triggerdef(t.oid), 48), 'EXECUTE PROCEDURE'::text) + 47)::information_schema.character_data AS action_statement, CASE WHEN (t.tgtype::integer & 1) = 1 THEN 'ROW'::text ELSE 'STATEMENT'::text END::information_schema.character_data AS action_orientation, CASE WHEN (t.tgtype::integer & 2) = 2 THEN 'BEFORE'::text ELSE 'AFTER'::text END::information_schema.character_data AS condition_timing, pg_catalog.obj_description(t.oid), t.tgname, t.tgname FROM pg_namespace n, pg_class c, pg_trigger t, (( SELECT 4, 'INSERT' UNION ALL SELECT 8, 'DELETE') UNION ALL SELECT 16, 'UPDA
 TE') em(num, text) WHERE n.oid = c.relnamespace AND c.oid = t.tgrelid AND (t.tgtype::integer & em.num) <> 0 AND NOT t.tgisconstraint AND NOT pg_is_other_temp_schema(n.oid) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'DELETE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text) OR has_table_privilege(c.oid, 'TRIGGER'::text))",
+	"SELECT current_database(), n.nspname, t.tgname, em.text, current_database(), n.nspname, c.relname, \"substring\"(pg_get_triggerdef(t.oid), \"position\"(\"substring\"(pg_get_triggerdef(t.oid), 48), 'EXECUTE PROCEDURE') + 47) AS action_statement, CASE WHEN (t.tgtype & 1) = 1 THEN 'ROW' ELSE 'STATEMENT' END AS action_orientation, CASE WHEN (t.tgtype & 2) = 2 THEN 'BEFORE' ELSE 'AFTER' END AS condition_timing, pg_catalog.obj_description(t.oid), t.tgname, t.tgname FROM pg_namespace n, pg_class c, pg_trigger t, (( SELECT 4, 'INSERT' UNION ALL SELECT 8, 'DELETE') UNION ALL SELECT 16, 'UPDATE') em(num, text) WHERE n.oid = c.relnamespace AND c.oid = t.tgrelid AND (t.tgtype & em.num) <> 0 AND NOT t.tgisconstraint AND NOT pg_is_other_temp_schema(n.oid) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'DELETE') OR has_table_privilege(c.oid, 'REFERENCES') OR has_table_privilege(c.oid, 'TR
 IGGER'))",
 
 	/* I_STMT_EL_TYPES_COL */
-	"SELECT 'COL' || current_database() || '.' || nc.nspname || '.' || c.relname || '.' || a.attnum, current_database(), nc.nspname, c.relname, 'TABLE_COL', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_attribute a, pg_class c, pg_namespace nc, pg_type t JOIN pg_namespace nt ON t.typnamespace = nt.oid LEFT JOIN (pg_type bt JOIN pg_namespace nbt ON bt.typnamespace = nbt.oid) ON t.typelem = bt.oid WHERE a.attrelid = c.oid AND a.atttypid = t.oid AND nc.oid = c.relnamespace AND NOT pg_is_other_temp_schema(nc.oid) AND a.attnum > 0 AND NOT a.attisdropped AND (c.relkind = ANY (ARRAY['r'::\"char\", 'v'::\"char\"])) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::text) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text)) AND t.typelem <> 0::oid AND t.typlen = -1 AND 'COL' || current_database() || '.' || nc.nspname || '.' || c.relname |
 | '.' || a.attnum = ##name::string",
+	"SELECT 'COL' || current_database() || '.' || nc.nspname || '.' || c.relname || '.' || a.attnum, current_database(), nc.nspname, c.relname, 'TABLE_COL', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_attribute a, pg_class c, pg_namespace nc, pg_type t JOIN pg_namespace nt ON t.typnamespace = nt.oid LEFT JOIN (pg_type bt JOIN pg_namespace nbt ON bt.typnamespace = nbt.oid) ON t.typelem = bt.oid WHERE a.attrelid = c.oid AND a.atttypid = t.oid AND nc.oid = c.relnamespace AND NOT pg_is_other_temp_schema(nc.oid) AND a.attnum > 0 AND NOT a.attisdropped AND (c.relkind = ANY (ARRAY['r', 'v'])) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'SELECT') OR has_table_privilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'REFERENCES')) AND t.typelem <> 0 AND t.typlen = -1 AND 'COL' || current_database() || '.' || nc.nspname || '.' || c.relname || '.' || a.attnum = ##name::string",
 
 	/* I_STMT_EL_TYPES_DOM */
 	"SELECT 'DOM' || current_database() || '.' || nt.nspname || '.' || t.typname, current_database(), nt.nspname, t.typname, 'DOMAIN', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_type t, pg_namespace nt, pg_type bt, pg_namespace nbt WHERE t.typnamespace = nt.oid AND t.typelem = bt.oid AND bt.typnamespace = nbt.oid AND t.typtype = 'd' AND t.typlen = -1 AND 'DOM' || current_database() || '.' || nt.nspname || '.' || t.typname = ##name::string",
@@ -207,39 +215,56 @@ static gchar *internal_sql[] = {
 	"SELECT 'UDT' || current_database() || '.' || n.nspname || '.' || udt.typname || '.' || a.attnum, pg_catalog.current_database(), n.nspname, udt.typname, 'UDT_COL', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_type udt INNER JOIN pg_namespace n ON (udt.typnamespace=n.oid) INNER JOIN pg_attribute a ON (a.attrelid=udt.typrelid) INNER JOIN pg_type t ON (a.atttypid=t.oid) INNER JOIN pg_namespace nt ON (t.typnamespace = nt.oid), pg_type bt, pg_namespace nbt where udt.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = udt.typrelid) AND t.typelem = bt.oid AND bt.typnamespace = nbt.oid AND t.typlen = -1 AND 'UDT' || current_database() || '.' || n.nspname || '.' || udt.typname || '.' || a.attnum = ##name::string",
 
 	/* I_STMT_EL_TYPES_ROUT_PAR */
-	"SELECT 'ROUP' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname::text || '_'::text) || ss.p_oid::text) || '.' || (ss.x).n, current_database(), ss.n_nspname, ((ss.proname::text || '_'::text) || ss.p_oid::text), 'ROUTINE_PAR', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_type t, pg_type bt, pg_namespace nbt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE'::text) OR has_function_privilege(p.oid, 'EXECUTE'::text))) ss WHERE t.oid = (ss.x).x AND bt.oid= t.typelem AND bt.typnamespace = nbt.oid AND t.typelem <> 0::oid AND t.typlen = -1 AND 'ROUP' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname::text || '_'::text) || ss.p_oid::text) || '.' || (ss.x).n = ##name::string", 
+	"SELECT 'ROUP' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname || '_') || ss.p_oid) || '.' || (ss.x).n, current_database(), ss.n_nspname, ((ss.proname || '_') || ss.p_oid), 'ROUTINE_PAR', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_type t, pg_type bt, pg_namespace nbt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE') OR has_function_privilege(p.oid, 'EXECUTE'))) ss WHERE t.oid = (ss.x).x AND bt.oid= t.typelem AND bt.typnamespace = nbt.oid AND t.typelem <> 0 AND t.typlen = -1 AND 'ROUP' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname || '_') || ss.p_oid) || '.' || (ss.x).n = ##name::string", 
 
 	/* I_STMT_EL_TYPES_ROUT_COL */
-	"SELECT 'ROUC' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname::text || '_'::text) || ss.p_oid::text) || '.' || (ss.x).n, current_database(), ss.n_nspname, ((ss.proname::text || '_'::text) || ss.p_oid::text), 'ROUTINE_COL', CASE WHEN at.typelem <> 0::oid AND at.typlen = -1 THEN 'array_spec' ELSE coalesce (ant.nspname || '.', '') || at.typname END, CASE WHEN at.typelem <> 0::oid AND at.typlen = -1 THEN 'ARR' || at.typelem ELSE NULL END, NULL, NULL FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE'::text) OR has_function_privilege(p.oid, 'EXECUTE'::text))) ss, pg_type at, pg_namespace ant WHERE t.oid = (ss.x).x AND t.typnamespace = nt.oid AND at.oid = t.typelem AND at.typnamespace = ant.oid AND (ss.pro
 argmodes[(ss.x).n] = 'o' OR ss.proargmodes[(ss.x).n] = 'b') AND 'ROUC' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname::text || '_'::text) || ss.p_oid::text) || '.' || (ss.x).n = ##name::string",
+	"SELECT 'ROUC' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname || '_') || ss.p_oid) || '.' || (ss.x).n, current_database(), ss.n_nspname, ((ss.proname || '_') || ss.p_oid), 'ROUTINE_COL', CASE WHEN at.typelem <> 0 AND at.typlen = -1 THEN 'array_spec' ELSE coalesce (ant.nspname || '.', '') || at.typname END, CASE WHEN at.typelem <> 0 AND at.typlen = -1 THEN 'ARR' || at.typelem ELSE NULL END, NULL, NULL FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE') OR has_function_privilege(p.oid, 'EXECUTE'))) ss, pg_type at, pg_namespace ant WHERE t.oid = (ss.x).x AND t.typnamespace = nt.oid AND at.oid = t.typelem AND at.typnamespace = ant.oid AND (ss.proargmodes[(ss.x).n] = 'o' OR ss.proargmodes[(ss.x).n] = 'b'
 ) AND 'ROUC' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname || '_') || ss.p_oid) || '.' || (ss.x).n = ##name::string",
 
 	/* I_STMT_EL_TYPES_ALL */
 	"SELECT 'UDT' || current_database() || '.' || n.nspname || '.' || udt.typname || '.' || a.attnum, pg_catalog.current_database(), n.nspname, udt.typname, 'UDT_COL', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_type udt INNER JOIN pg_namespace n ON (udt.typnamespace=n.oid) INNER JOIN pg_attribute a ON (a.attrelid=udt.typrelid) INNER JOIN pg_type t ON (a.atttypid=t.oid) INNER JOIN pg_namespace nt ON (t.typnamespace = nt.oid), pg_type bt, pg_namespace nbt where udt.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = udt.typrelid) AND t.typelem = bt.oid AND bt.typnamespace = nbt.oid AND t.typlen = -1 "
 	"UNION SELECT 'DOM' || current_database() || '.' || nt.nspname || '.' || t.typname, current_database(), nt.nspname, t.typname, 'DOMAIN', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_type t, pg_namespace nt, pg_type bt, pg_namespace nbt WHERE t.typnamespace = nt.oid AND t.typelem = bt.oid AND bt.typnamespace = nbt.oid AND t.typtype = 'd' AND t.typlen = -1 "
-	"UNION SELECT 'COL' || current_database() || '.' || nc.nspname || '.' || c.relname || '.' || a.attnum, current_database(), nc.nspname, c.relname, 'TABLE_COL', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_attribute a, pg_class c, pg_namespace nc, pg_type t JOIN pg_namespace nt ON t.typnamespace = nt.oid LEFT JOIN (pg_type bt JOIN pg_namespace nbt ON bt.typnamespace = nbt.oid) ON t.typelem = bt.oid WHERE a.attrelid = c.oid AND a.atttypid = t.oid AND nc.oid = c.relnamespace AND NOT pg_is_other_temp_schema(nc.oid) AND a.attnum > 0 AND NOT a.attisdropped AND (c.relkind = ANY (ARRAY['r'::\"char\", 'v'::\"char\"])) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::text) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text)) AND t.typelem <> 0::oid AND t.typlen = -1 "
-	"UNION SELECT 'ROUP' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname::text || '_'::text) || ss.p_oid::text) || '.' || (ss.x).n, current_database(), ss.n_nspname, ((ss.proname::text || '_'::text) || ss.p_oid::text), 'ROUTINE_PAR', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_type t, pg_type bt, pg_namespace nbt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE'::text) OR has_function_privilege(p.oid, 'EXECUTE'::text))) ss WHERE t.oid = (ss.x).x AND bt.oid= t.typelem AND bt.typnamespace = nbt.oid AND t.typelem <> 0::oid AND t.typlen = -1 "
-	"UNION SELECT 'ROUC' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname::text || '_'::text) || ss.p_oid::text) || '.' || (ss.x).n, current_database(), ss.n_nspname, ((ss.proname::text || '_'::text) || ss.p_oid::text), 'ROUTINE_COL', CASE WHEN at.typelem <> 0::oid AND at.typlen = -1 THEN 'array_spec' ELSE coalesce (ant.nspname || '.', '') || at.typname END, CASE WHEN at.typelem <> 0::oid AND at.typlen = -1 THEN 'ARR' || at.typelem ELSE NULL END, NULL, NULL FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE'::text) OR has_function_privilege(p.oid, 'EXECUTE'::text))) ss, pg_type at, pg_namespace ant WHERE t.oid = (ss.x).x AND t.typnamespace = nt.oid AND at.oid = t.typelem AND at.typnamespace = ant.oid AND (
 ss.proargmodes[(ss.x).n] = 'o' OR ss.proargmodes[(ss.x).n] = 'b')",
+	"UNION SELECT 'COL' || current_database() || '.' || nc.nspname || '.' || c.relname || '.' || a.attnum, current_database(), nc.nspname, c.relname, 'TABLE_COL', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_attribute a, pg_class c, pg_namespace nc, pg_type t JOIN pg_namespace nt ON t.typnamespace = nt.oid LEFT JOIN (pg_type bt JOIN pg_namespace nbt ON bt.typnamespace = nbt.oid) ON t.typelem = bt.oid WHERE a.attrelid = c.oid AND a.atttypid = t.oid AND nc.oid = c.relnamespace AND NOT pg_is_other_temp_schema(nc.oid) AND a.attnum > 0 AND NOT a.attisdropped AND (c.relkind = ANY (ARRAY['r', 'v'])) AND (pg_has_role(c.relowner, 'USAGE') OR has_table_privilege(c.oid, 'SELECT') OR has_table_privilege(c.oid, 'INSERT') OR has_table_privilege(c.oid, 'UPDATE') OR has_table_privilege(c.oid, 'REFERENCES')) AND t.typelem <> 0 AND t.typlen = -1 "
+	"UNION SELECT 'ROUP' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname || '_') || ss.p_oid) || '.' || (ss.x).n, current_database(), ss.n_nspname, ((ss.proname || '_') || ss.p_oid), 'ROUTINE_PAR', coalesce (nbt.nspname || '.', '') || bt.typname, NULL, NULL, NULL FROM pg_type t, pg_type bt, pg_namespace nbt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE') OR has_function_privilege(p.oid, 'EXECUTE'))) ss WHERE t.oid = (ss.x).x AND bt.oid= t.typelem AND bt.typnamespace = nbt.oid AND t.typelem <> 0 AND t.typlen = -1 "
+	"UNION SELECT 'ROUC' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname || '_') || ss.p_oid) || '.' || (ss.x).n, current_database(), ss.n_nspname, ((ss.proname || '_') || ss.p_oid), 'ROUTINE_COL', CASE WHEN at.typelem <> 0 AND at.typlen = -1 THEN 'array_spec' ELSE coalesce (ant.nspname || '.', '') || at.typname END, CASE WHEN at.typelem <> 0 AND at.typlen = -1 THEN 'ARR' || at.typelem ELSE NULL END, NULL, NULL FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE') OR has_function_privilege(p.oid, 'EXECUTE'))) ss, pg_type at, pg_namespace ant WHERE t.oid = (ss.x).x AND t.typnamespace = nt.oid AND at.oid = t.typelem AND at.typnamespace = ant.oid AND (ss.proargmodes[(ss.x).n] = 'o' OR ss.proargmodes[(ss.x).n]
  = 'b')",
 
 	/* I_STMT_ROUTINES_ALL */
-	"SELECT current_database()::information_schema.sql_identifier, n.nspname::information_schema.sql_identifier, ((p.proname::text || '_'::text) || p.oid::text)::information_schema.sql_identifier, current_database()::information_schema.sql_identifier, n.nspname::information_schema.sql_identifier, p.proname::information_schema.sql_identifier, CASE WHEN p.proisagg THEN 'AGGREGATE' ELSE 'FUNCTION' END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'ROUC' || current_database() || '.' || n.nspname || '.' || p.proname || '.' || p.oid ELSE coalesce (nt.nspname || '.', '') || t.typname END AS rettype, p.proretset, p.pronargs::int, CASE WHEN l.lanname = 'sql'::name THEN 'SQL'::text ELSE 'EXTERNAL'::text END, CASE WHEN pg_has_role(p.proowner, 'USAGE'::text) THEN p.prosrc ELSE NULL::text END, CASE WHEN l.lanname = 'c'::name THEN p.prosrc ELSE NULL::text END, upper(l.lanname::text)::information_schema.character_data AS external_language, 'GENERAL'::character varying::information_sch
 ema.character_data AS parameter_style, CASE WHEN p.provolatile = 'i' THEN TRUE ELSE FALSE END, 'MODIFIES'::character varying::information_schema.character_data AS sql_data_access, CASE WHEN p.proisstrict THEN TRUE ELSE FALSE END, pg_catalog.obj_description(p.oid), CASE WHEN pg_catalog.pg_function_is_visible(p.oid) IS TRUE THEN p.proname ELSE coalesce (n.nspname || '.', '') || p.proname END, coalesce (n.nspname || '.', '') || p.proname, o.rolname FROM pg_namespace n, pg_proc p, pg_language l, pg_type t, pg_namespace nt, pg_roles o WHERE n.oid = p.pronamespace AND p.prolang = l.oid AND p.prorettype = t.oid AND t.typnamespace = nt.oid AND (pg_has_role(p.proowner, 'USAGE'::text) OR has_function_privilege(p.oid, 'EXECUTE'::text)) AND o.oid=p.proowner",
+	"SELECT current_database(), n.nspname, ((p.proname || '_') || p.oid), current_database(), n.nspname, p.proname, CASE WHEN p.proisagg THEN 'AGGREGATE' ELSE 'FUNCTION' END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'ROUC' || current_database() || '.' || n.nspname || '.' || p.proname || '.' || p.oid ELSE coalesce (nt.nspname || '.', '') || t.typname END AS rettype, p.proretset, p.pronargs, CASE WHEN l.lanname = 'sql' THEN 'SQL' ELSE 'EXTERNAL' END, CASE WHEN pg_has_role(p.proowner, 'USAGE') THEN p.prosrc ELSE NULL END, CASE WHEN l.lanname = 'c' THEN p.prosrc ELSE NULL END, upper(l.lanname) AS external_language, 'GENERAL' AS parameter_style, CASE WHEN p.provolatile = 'i' THEN TRUE ELSE FALSE END, 'MODIFIES' AS sql_data_access, CASE WHEN p.proisstrict THEN TRUE ELSE FALSE END, pg_catalog.obj_description(p.oid), CASE WHEN pg_catalog.pg_function_is_visible(p.oid) IS TRUE THEN p.proname ELSE coalesce (n.nspname || '.', '') || p.proname END, coalesce (n.nspname || '.', '') || 
 p.proname, o.rolname FROM pg_namespace n, pg_proc p, pg_language l, pg_type t, pg_namespace nt, pg_roles o WHERE n.oid = p.pronamespace AND p.prolang = l.oid AND p.prorettype = t.oid AND t.typnamespace = nt.oid AND (pg_has_role(p.proowner, 'USAGE') OR has_function_privilege(p.oid, 'EXECUTE')) AND o.oid=p.proowner",
 
 	/* I_STMT_ROUTINES */
-	"SELECT current_database()::information_schema.sql_identifier, n.nspname::information_schema.sql_identifier, ((p.proname::text || '_'::text) || p.oid::text)::information_schema.sql_identifier, current_database()::information_schema.sql_identifier, n.nspname::information_schema.sql_identifier, p.proname::information_schema.sql_identifier, CASE WHEN p.proisagg THEN 'AGGREGATE' ELSE 'FUNCTION' END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'ROUC' || current_database() || '.' || n.nspname || '.' || p.proname || '.' || p.oid ELSE coalesce (nt.nspname || '.', '') || t.typname END AS rettype, p.proretset, p.pronargs::int, CASE WHEN l.lanname = 'sql'::name THEN 'SQL'::text ELSE 'EXTERNAL'::text END, CASE WHEN pg_has_role(p.proowner, 'USAGE'::text) THEN p.prosrc ELSE NULL::text END, CASE WHEN l.lanname = 'c'::name THEN p.prosrc ELSE NULL::text END, upper(l.lanname::text)::information_schema.character_data AS external_language, 'GENERAL'::character varying::information_sch
 ema.character_data AS parameter_style, CASE WHEN p.provolatile = 'i' THEN TRUE ELSE FALSE END, 'MODIFIES'::character varying::information_schema.character_data AS sql_data_access, CASE WHEN p.proisstrict THEN TRUE ELSE FALSE END, pg_catalog.obj_description(p.oid), CASE WHEN pg_catalog.pg_function_is_visible(p.oid) IS TRUE THEN p.proname ELSE coalesce (n.nspname || '.', '') || p.proname END, coalesce (n.nspname || '.', '') || p.proname, o.rolname FROM pg_namespace n, pg_proc p, pg_language l, pg_type t, pg_namespace nt, pg_roles o WHERE current_database()::information_schema.sql_identifier = ##cat::string AND n.nspname::information_schema.sql_identifier = ##schema::string AND n.oid = p.pronamespace AND p.prolang = l.oid AND p.prorettype = t.oid AND t.typnamespace = nt.oid AND (pg_has_role(p.proowner, 'USAGE'::text) OR has_function_privilege(p.oid, 'EXECUTE'::text)) AND o.oid=p.proowner",
+	"SELECT current_database(), n.nspname, ((p.proname || '_') || p.oid), current_database(), n.nspname, p.proname, CASE WHEN p.proisagg THEN 'AGGREGATE' ELSE 'FUNCTION' END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'ROUC' || current_database() || '.' || n.nspname || '.' || p.proname || '.' || p.oid ELSE coalesce (nt.nspname || '.', '') || t.typname END AS rettype, p.proretset, p.pronargs, CASE WHEN l.lanname = 'sql' THEN 'SQL' ELSE 'EXTERNAL' END, CASE WHEN pg_has_role(p.proowner, 'USAGE') THEN p.prosrc ELSE NULL END, CASE WHEN l.lanname = 'c' THEN p.prosrc ELSE NULL END, upper(l.lanname) AS external_language, 'GENERAL' AS parameter_style, CASE WHEN p.provolatile = 'i' THEN TRUE ELSE FALSE END, 'MODIFIES' AS sql_data_access, CASE WHEN p.proisstrict THEN TRUE ELSE FALSE END, pg_catalog.obj_description(p.oid), CASE WHEN pg_catalog.pg_function_is_visible(p.oid) IS TRUE THEN p.proname ELSE coalesce (n.nspname || '.', '') || p.proname END, coalesce (n.nspname || '.', '') || 
 p.proname, o.rolname FROM pg_namespace n, pg_proc p, pg_language l, pg_type t, pg_namespace nt, pg_roles o WHERE current_database() = ##cat::string AND n.nspname = ##schema::string AND n.oid = p.pronamespace AND p.prolang = l.oid AND p.prorettype = t.oid AND t.typnamespace = nt.oid AND (pg_has_role(p.proowner, 'USAGE') OR has_function_privilege(p.oid, 'EXECUTE')) AND o.oid=p.proowner",
 
 	/* I_STMT_ROUTINES_ONE */
-	"SELECT current_database()::information_schema.sql_identifier, n.nspname::information_schema.sql_identifier, ((p.proname::text || '_'::text) || p.oid::text)::information_schema.sql_identifier, current_database()::information_schema.sql_identifier, n.nspname::information_schema.sql_identifier, p.proname::information_schema.sql_identifier, CASE WHEN p.proisagg THEN 'AGGREGATE' ELSE 'FUNCTION' END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'ROUC' || current_database() || '.' || n.nspname || '.' || p.proname || '.' || p.oid ELSE coalesce (nt.nspname || '.', '') || t.typname END AS rettype, p.proretset, p.pronargs, CASE WHEN l.lanname = 'sql'::name THEN 'SQL'::text ELSE 'EXTERNAL'::text END, CASE WHEN pg_has_role(p.proowner, 'USAGE'::text) THEN p.prosrc ELSE NULL::text END, CASE WHEN l.lanname = 'c'::name THEN p.prosrc ELSE NULL::text END, upper(l.lanname::text)::information_schema.character_data AS external_language, 'GENERAL'::character varying::information_schema.c
 haracter_data AS parameter_style, CASE WHEN p.provolatile = 'i' THEN TRUE ELSE FALSE END, 'MODIFIES'::character varying::information_schema.character_data AS sql_data_access, CASE WHEN p.proisstrict THEN TRUE ELSE FALSE END, pg_catalog.obj_description(p.oid), CASE WHEN pg_catalog.pg_function_is_visible(p.oid) IS TRUE THEN p.proname ELSE coalesce (n.nspname || '.', '') || p.proname END, coalesce (n.nspname || '.', '') || p.proname, o.rolname FROM pg_namespace n, pg_proc p, pg_language l, pg_type t, pg_namespace nt, pg_roles o WHERE current_database()::information_schema.sql_identifier = ##cat::string AND n.nspname::information_schema.sql_identifier = ##schema::string AND ((p.proname::text || '_'::text) || p.oid::text)::information_schema.sql_identifier = ##name::string AND n.oid = p.pronamespace AND p.prolang = l.oid AND p.prorettype = t.oid AND t.typnamespace = nt.oid AND (pg_has_role(p.proowner, 'USAGE'::text) OR has_function_privilege(p.oid, 'EXECUTE'::text)) AND o.oid=p.p
 roowner",
+	"SELECT current_database(), n.nspname, ((p.proname || '_') || p.oid), current_database(), n.nspname, p.proname, CASE WHEN p.proisagg THEN 'AGGREGATE' ELSE 'FUNCTION' END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'ROUC' || current_database() || '.' || n.nspname || '.' || p.proname || '.' || p.oid ELSE coalesce (nt.nspname || '.', '') || t.typname END AS rettype, p.proretset, p.pronargs, CASE WHEN l.lanname = 'sql' THEN 'SQL' ELSE 'EXTERNAL' END, CASE WHEN pg_has_role(p.proowner, 'USAGE') THEN p.prosrc ELSE NULL END, CASE WHEN l.lanname = 'c' THEN p.prosrc ELSE NULL END, upper(l.lanname) AS external_language, 'GENERAL' AS parameter_style, CASE WHEN p.provolatile = 'i' THEN TRUE ELSE FALSE END, 'MODIFIES' AS sql_data_access, CASE WHEN p.proisstrict THEN TRUE ELSE FALSE END, pg_catalog.obj_description(p.oid), CASE WHEN pg_catalog.pg_function_is_visible(p.oid) IS TRUE THEN p.proname ELSE coalesce (n.nspname || '.', '') || p.proname END, coalesce (n.nspname || '.', '') || 
 p.proname, o.rolname FROM pg_namespace n, pg_proc p, pg_language l, pg_type t, pg_namespace nt, pg_roles o WHERE current_database() = ##cat::string AND n.nspname = ##schema::string AND ((p.proname || '_') || p.oid) = ##name::string AND n.oid = p.pronamespace AND p.prolang = l.oid AND p.prorettype = t.oid AND t.typnamespace = nt.oid AND (pg_has_role(p.proowner, 'USAGE') OR has_function_privilege(p.oid, 'EXECUTE')) AND o.oid=p.proowner",
 
 	/* I_STMT_ROUTINE_PAR_ALL */
-	"SELECT current_database(), ss.n_nspname, ((ss.proname::text || '_'::text) || ss.p_oid::text), (ss.x).n, CASE WHEN ss.proargmodes IS NULL THEN 'IN'::text WHEN ss.proargmodes[(ss.x).n] = 'i' THEN 'IN' WHEN ss.proargmodes[(ss.x).n] = 'o' THEN 'OUT' WHEN ss.proargmodes[(ss.x).n] = 'b' THEN 'INOUT' ELSE NULL::text END, NULLIF(ss.proargnames[(ss.x).n], ''), CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'array_spec' ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'ROUP' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname::text || '_'::text) || ss.p_oid::text) || '.' || (ss.x).n ELSE NULL END FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE'::
 text) OR has_function_privilege(p.oid, 'EXECUTE'::text))) ss WHERE t.oid = (ss.x).x AND t.typnamespace = nt.oid",
+	"SELECT current_database(), ss.n_nspname, ((ss.proname || '_') || ss.p_oid), (ss.x).n, CASE WHEN ss.proargmodes IS NULL THEN 'IN' WHEN ss.proargmodes[(ss.x).n] = 'i' THEN 'IN' WHEN ss.proargmodes[(ss.x).n] = 'o' THEN 'OUT' WHEN ss.proargmodes[(ss.x).n] = 'b' THEN 'INOUT' ELSE NULL END, NULLIF(ss.proargnames[(ss.x).n], ''), CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'array_spec' ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'ROUP' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname || '_') || ss.p_oid) || '.' || (ss.x).n ELSE NULL END FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE') OR has_function_privilege(p.oid, 'EXECUTE'))) ss WHERE t.o
 id = (ss.x).x AND t.typnamespace = nt.oid",
 
 	/* I_STMT_ROUTINE_PAR */
-	"SELECT current_database(), ss.n_nspname, ((ss.proname::text || '_'::text) || ss.p_oid::text), (ss.x).n, CASE WHEN ss.proargmodes IS NULL THEN 'IN'::text WHEN ss.proargmodes[(ss.x).n] = 'i' THEN 'IN' WHEN ss.proargmodes[(ss.x).n] = 'o' THEN 'OUT' WHEN ss.proargmodes[(ss.x).n] = 'b' THEN 'INOUT' ELSE NULL::text END, NULLIF(ss.proargnames[(ss.x).n], ''), CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'array_spec' ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'ROUP' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname::text || '_'::text) || ss.p_oid::text) || '.' || (ss.x).n ELSE NULL END FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE'::
 text) OR has_function_privilege(p.oid, 'EXECUTE'::text))) ss WHERE t.oid = (ss.x).x AND t.typnamespace = nt.oid AND current_database() = ##cat::string AND ss.n_nspname = ##schema::string AND ((ss.proname::text || '_'::text) || ss.p_oid::text) = ##name::string",
+	"SELECT current_database(), ss.n_nspname, ((ss.proname || '_') || ss.p_oid), (ss.x).n, CASE WHEN ss.proargmodes IS NULL THEN 'IN' WHEN ss.proargmodes[(ss.x).n] = 'i' THEN 'IN' WHEN ss.proargmodes[(ss.x).n] = 'o' THEN 'OUT' WHEN ss.proargmodes[(ss.x).n] = 'b' THEN 'INOUT' ELSE NULL END, NULLIF(ss.proargnames[(ss.x).n], ''), CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'array_spec' ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'ROUP' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname || '_') || ss.p_oid) || '.' || (ss.x).n ELSE NULL END FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE') OR has_function_privilege(p.oid, 'EXECUTE'))) ss WHERE t.o
 id = (ss.x).x AND t.typnamespace = nt.oid AND current_database() = ##cat::string AND ss.n_nspname = ##schema::string AND ((ss.proname || '_') || ss.p_oid) = ##name::string",
 
 	/* I_STMT_ROUTINE_COL_ALL */
-	"SELECT current_database(), ss.n_nspname, ((ss.proname::text || '_'::text) || ss.p_oid::text), NULLIF(ss.proargnames[(ss.x).n], ''), (ss.x).n, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'array_spec' ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'ROUC' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname::text || '_'::text) || ss.p_oid::text) || '.' || (ss.x).n ELSE NULL END FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE'::text) OR has_function_privilege(p.oid, 'EXECUTE'::text))) ss WHERE t.oid = (ss.x).x AND t.typnamespace = nt.oid AND (ss.proargmodes[(ss.x).n] = 'o' OR ss.proargmodes[(ss.x).n] = 'b') ORDER BY 1, 2, 3, 4, 5",
+	"SELECT current_database(), ss.n_nspname, ((ss.proname || '_') || ss.p_oid), NULLIF(ss.proargnames[(ss.x).n], ''), (ss.x).n, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'array_spec' ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'ROUC' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname || '_') || ss.p_oid) || '.' || (ss.x).n ELSE NULL END FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE') OR has_function_privilege(p.oid, 'EXECUTE'))) ss WHERE t.oid = (ss.x).x AND t.typnamespace = nt.oid AND (ss.proargmodes[(ss.x).n] = 'o' OR ss.proargmodes[(ss.x).n] = 'b') ORDER BY 1, 2, 3, 4, 5",
 
 	/* I_STMT_ROUTINE_COL */
-	"SELECT current_database(), ss.n_nspname, ((ss.proname::text || '_'::text) || ss.p_oid::text), NULLIF(ss.proargnames[(ss.x).n], ''), (ss.x).n, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'array_spec' ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'ROUC' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname::text || '_'::text) || ss.p_oid::text) || '.' || (ss.x).n ELSE NULL END FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE'::text) OR has_function_privilege(p.oid, 'EXECUTE'::text))) ss WHERE t.oid = (ss.x).x AND t.typnamespace = nt.oid AND (ss.proargmodes[(ss.x).n] = 'o' OR ss.proargmodes[(ss.x).n] = 'b') AND current_database() = ##ca
 t::string AND ss.n_nspname = ##schema::string AND ((ss.proname::text || '_'::text) || ss.p_oid::text) = ##name::string ORDER BY 1, 2, 3, 4, 5"
+	"SELECT current_database(), ss.n_nspname, ((ss.proname || '_') || ss.p_oid), NULLIF(ss.proargnames[(ss.x).n], ''), (ss.x).n, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'array_spec' ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'ROUC' || current_database() || '.' || ss.n_nspname || '.' || ((ss.proname || '_') || ss.p_oid) || '.' || (ss.x).n ELSE NULL END FROM pg_type t, pg_namespace nt, ( SELECT n.nspname AS n_nspname, p.proname, p.oid AS p_oid, p.proargnames, p.proargmodes, information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x FROM pg_namespace n, pg_proc p WHERE n.oid = p.pronamespace AND (pg_has_role(p.proowner, 'USAGE') OR has_function_privilege(p.oid, 'EXECUTE'))) ss WHERE t.oid = (ss.x).x AND t.typnamespace = nt.oid AND (ss.proargmodes[(ss.x).n] = 'o' OR ss.proargmodes[(ss.x).n] = 'b') AND current_database() = ##cat::string AND ss.n_nspname = ##schema::string AND ((ss.pro
 name || '_') || ss.p_oid) = ##name::string ORDER BY 1, 2, 3, 4, 5",
 
+	/* I_STMT_INDEXES */
+	"SELECT current_database() AS index_catalog, nc2.nspname AS index_schema, c2.relname AS index_name, current_database() AS table_catalog, nc.nspname AS table_schema, c.relname AS table_name, i.indisunique, pg_get_indexdef (i.indexrelid, 0, false), NULL, NULL, o.rolname, pg_catalog.obj_description (c2.oid), i.indexrelid FROM pg_catalog.pg_class c INNER JOIN pg_namespace nc ON (c.relnamespace = nc.oid), pg_catalog.pg_class c2 INNER JOIN pg_namespace nc2 ON (c2.relnamespace = nc2.oid) LEFT JOIN pg_roles o ON (o.oid=c2.relowner), pg_catalog.pg_index i WHERE c.oid = i.indrelid AND i.indexrelid = c2.oid AND NOT i.indisprimary AND pg_catalog.pg_table_is_visible(c.oid) AND nc.nspname = ##schema::string AND c.relname = ##name::string ORDER BY c.relname",
+
+	/* I_STMT_INDEXES_ALL */
+	"SELECT current_database() AS index_catalog, nc2.nspname AS index_schema, c2.relname AS index_name, current_database() AS table_catalog, nc.nspname AS table_schema, c.relname AS table_name, i.indisunique, pg_get_indexdef (i.indexrelid, 0, false), NULL, NULL, o.rolname, pg_catalog.obj_description (c2.oid), i.indexrelid FROM pg_catalog.pg_class c INNER JOIN pg_namespace nc ON (c.relnamespace = nc.oid), pg_catalog.pg_class c2 INNER JOIN pg_namespace nc2 ON (c2.relnamespace = nc2.oid) LEFT JOIN pg_roles o ON (o.oid=c2.relowner), pg_catalog.pg_index i WHERE c.oid = i.indrelid AND i.indexrelid = c2.oid AND NOT i.indisprimary AND pg_catalog.pg_table_is_visible(c.oid) ORDER BY c.relname",
+
+	/* I_STMT_INDEXES_NAMED */
+	"SELECT current_database() AS index_catalog, nc2.nspname AS index_schema, c2.relname AS index_name, current_database() AS table_catalog, nc.nspname AS table_schema, c.relname AS table_name, i.indisunique, pg_get_indexdef (i.indexrelid, 0, false), NULL, NULL, o.rolname, pg_catalog.obj_description (c2.oid), i.indexrelid FROM pg_catalog.pg_class c INNER JOIN pg_namespace nc ON (c.relnamespace = nc.oid), pg_catalog.pg_class c2 INNER JOIN pg_namespace nc2 ON (c2.relnamespace = nc2.oid) LEFT JOIN pg_roles o ON (o.oid=c2.relowner), pg_catalog.pg_index i WHERE c.oid = i.indrelid AND i.indexrelid = c2.oid AND NOT i.indisprimary AND pg_catalog.pg_table_is_visible(c.oid) AND nc.nspname = ##schema::string AND c.relname = ##name::string AND c2.relname = ##name2::string ORDER BY c.relname",
+
+	/* I_STMT_INDEXES_COLUMNS_GET_ALL_INDEXES */
+	"SELECT i.indexrelid FROM pg_catalog.pg_class c, pg_catalog.pg_index i WHERE c.oid = i.indrelid AND NOT i.indisprimary AND pg_catalog.pg_table_is_visible(c.oid)",
+
+	/* I_STMT_INDEXES_COLUMNS_GET_NAMED_INDEXES */
+	"SELECT i.indexrelid FROM pg_catalog.pg_class c INNER JOIN pg_namespace nc ON (c.relnamespace = nc.oid), pg_catalog.pg_index i, pg_catalog.pg_class c2 INNER JOIN pg_namespace nc2 ON (c2.relnamespace = nc2.oid) WHERE c.oid = i.indrelid AND NOT i.indisprimary AND pg_catalog.pg_table_is_visible(c.oid) AND i.indexrelid = c2.oid AND c.relname = ##name::string AND nc.nspname = ##schema::string AND c2.relname=##name2::string",
+
+	/* I_STMT_INDEXES_COLUMNS_FOR_INDEX */
+	"SELECT current_database() AS index_catalog, nc2.nspname AS index_schema, c2.relname AS index_name, current_database() AS table_catalog, nc.nspname AS table_schema, c.relname AS table_name, a.attname, NULL, (ss.a).n FROM pg_catalog.pg_index i, (SELECT information_schema._pg_expandarray(indkey) AS a FROM pg_catalog.pg_index WHERE indexrelid = ##oid::guint) ss, pg_catalog.pg_class c INNER JOIN pg_namespace nc ON (c.relnamespace = nc.oid) INNER JOIN pg_catalog.pg_attribute a ON (a.attrelid = c.oid), pg_catalog.pg_class c2 INNER JOIN pg_namespace nc2 ON (c2.relnamespace = nc2.oid) WHERE i.indexrelid = ##oid::guint AND (ss.a).x != 0 AND a.attnum = (ss.a).x AND c.oid = i.indrelid AND i.indexrelid = c2.oid AND pg_catalog.pg_table_is_visible(c.oid) UNION SELECT current_database() AS index_catalog, nc2.nspname AS index_schema, c2.relname AS index_name, current_database() AS table_catalog, nc.nspname AS table_schema, c.relname AS table_name, NULL, pg_get_indexdef (i.indexrelid, (ss.a
 ).n, false), (ss.a).n FROM pg_catalog.pg_index i, (SELECT information_schema._pg_expandarray(indkey) AS a FROM pg_catalog.pg_index WHERE indexrelid = ##oid::guint) ss, pg_catalog.pg_class c INNER JOIN pg_namespace nc ON (c.relnamespace = nc.oid), pg_catalog.pg_class c2 INNER JOIN pg_namespace nc2 ON (c2.relnamespace = nc2.oid) WHERE i.indexrelid = ##oid::guint AND (ss.a).x = 0 AND c.oid = i.indrelid AND i.indexrelid = c2.oid AND pg_catalog.pg_table_is_visible(c.oid) order by 9"
 };
 
 /*
@@ -247,7 +272,6 @@ static gchar *internal_sql[] = {
  * predefined statements' GdaStatement, all initialized in _gda_postgres_provider_meta_init()
  */
 static GdaStatement **internal_stmt;
-static GdaSqlParser *internal_parser = NULL;
 static GdaSet       *i_set;
 
 /*
@@ -258,21 +282,28 @@ _gda_postgres_provider_meta_init (GdaServerProvider *provider)
 {
 	static GStaticMutex init_mutex = G_STATIC_MUTEX_INIT;
 	InternalStatementItem i;
+	GdaSqlParser *parser;
 
 	g_static_mutex_lock (&init_mutex);
 
-        internal_parser = gda_server_provider_internal_get_parser (provider);
+	if (provider)
+		parser = gda_server_provider_internal_get_parser (provider);
+	else
+		parser = GDA_SQL_PARSER (g_object_new (GDA_TYPE_POSTGRES_PARSER, NULL));
         internal_stmt = g_new0 (GdaStatement *, sizeof (internal_sql) / sizeof (gchar*));
         for (i = I_STMT_CATALOG; i < sizeof (internal_sql) / sizeof (gchar*); i++) {
-                internal_stmt[i] = gda_sql_parser_parse_string (internal_parser, internal_sql[i], NULL, NULL);
+                internal_stmt[i] = gda_sql_parser_parse_string (parser, internal_sql[i], NULL, NULL);
                 if (!internal_stmt[i])
                         g_error ("Could not parse internal statement: %s\n", internal_sql[i]);
         }
+	if (!provider)
+		g_object_unref (parser);
 
-	i_set = gda_set_new_inline (4, "cat", G_TYPE_STRING, "", 
+	i_set = gda_set_new_inline (5, "cat", G_TYPE_STRING, "", 
 				    "name", G_TYPE_STRING, "",
 				    "schema", G_TYPE_STRING, "",
-				    "name2", G_TYPE_STRING, "");
+				    "name2", G_TYPE_STRING, "",
+				    "oid", G_TYPE_UINT, 0);
 
 	g_static_mutex_unlock (&init_mutex);
 
@@ -293,7 +324,12 @@ _gda_postgres_meta__info (GdaServerProvider *prov, GdaConnection *cnc,
 	if (!cdata)
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_CATALOG], NULL, error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_CATALOG],
+							      NULL, 
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_information_schema_catalog_name,
+							      error);
 	if (!model)
 		return FALSE;
 
@@ -318,7 +354,11 @@ _gda_postgres_meta__btypes (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 
 	/* use a prepared statement for the "base" model */
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_BTYPES], NULL, error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_BTYPES],
+							      NULL, 
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_builtin_data_types, error);
 	if (!model)
 		return FALSE;
 
@@ -369,8 +409,11 @@ _gda_postgres_meta__udt (GdaServerProvider *prov, GdaConnection *cnc,
 	if (!cdata)
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_UDT_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_UDT_ALL],
+							      NULL, 
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_udt, error);
 	if (!model)
 		return FALSE;
 
@@ -398,7 +441,12 @@ _gda_postgres_meta_udt (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "schema"), udt_schema, error))
 		return FALSE;
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_UDT], i_set, error);
+
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_UDT],
+							      i_set,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_udt, error);
 	if (!model)
 		return FALSE;
 
@@ -421,8 +469,11 @@ _gda_postgres_meta__udt_cols (GdaServerProvider *prov, GdaConnection *cnc,
 	if (!cdata)
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_UDT_COLUMNS_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_UDT_COLUMNS_ALL],
+							      NULL, 
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_udt_columns, error);
 	if (!model)
 		return FALSE;
 
@@ -452,7 +503,11 @@ _gda_postgres_meta_udt_cols (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), udt_name, error))
 		return FALSE;
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_UDT_COLUMNS], i_set, error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_UDT_COLUMNS],
+							      i_set, 
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_udt_columns, error);
 	if (!model)
 		return FALSE;
 
@@ -492,8 +547,11 @@ _gda_postgres_meta__domains (GdaServerProvider *prov, GdaConnection *cnc,
 	if (!cdata)
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_DOMAINS_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_DOMAINS_ALL],
+							      NULL, 
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_domains, error);
 	if (!model)
 		return FALSE;
 
@@ -521,7 +579,12 @@ _gda_postgres_meta_domains (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "schema"), domain_schema, error))
 		return FALSE;
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_DOMAINS], i_set, error);
+
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_DOMAINS],
+							      i_set,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_domains, error);
 	if (!model)
 		return FALSE;
 
@@ -544,8 +607,11 @@ _gda_postgres_meta__constraints_dom (GdaServerProvider *prov, GdaConnection *cnc
 	if (!cdata)
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_DOMAINS_CONSTRAINTS_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_DOMAINS_CONSTRAINTS_ALL],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_domain_constraints, error);
 	if (!model)
 		return FALSE;
 
@@ -576,7 +642,12 @@ _gda_postgres_meta_constraints_dom (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), domain_name, error))
 		return FALSE;
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_DOMAINS_CONSTRAINTS], i_set, error);
+
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_DOMAINS_CONSTRAINTS],
+							      i_set,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_domain_constraints, error);
 	if (!model)
 		return FALSE;
 
@@ -605,8 +676,11 @@ _gda_postgres_meta__el_types (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	}
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_EL_TYPES_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_EL_TYPES_ALL],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_element_types, error);
 	if (!model)
 		return FALSE;
 
@@ -641,21 +715,36 @@ _gda_postgres_meta_el_types (GdaServerProvider *prov, GdaConnection *cnc,
 				     "%s", _("PostgreSQL version 8.2.0 at least is required"));
 			return FALSE;
 		}
-		model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_EL_TYPES_COL], i_set, 
-								 error);
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_EL_TYPES_COL],
+								      i_set,
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      _col_types_element_types, error);
 	}
 	else if (*cstr == 'D')
-		model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_EL_TYPES_DOM], i_set, 
-								 error);
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_EL_TYPES_DOM],
+								      i_set,
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      _col_types_element_types, error);
 	else if (*cstr == 'U')
-		model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_EL_TYPES_UDT], i_set, 
-								 error);
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_EL_TYPES_UDT],
+								      i_set,
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      _col_types_element_types, error);
 	else if (!strcmp (cstr, "ROUTINE_PAR"))
-		model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_EL_TYPES_ROUT_PAR], i_set, 
-								 error);
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_EL_TYPES_ROUT_PAR],
+								      i_set,
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      _col_types_element_types, error);
 	else if (!strcmp (cstr, "ROUTINE_COL"))
-		model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_EL_TYPES_ROUT_COL], i_set, 
-								 error);
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_EL_TYPES_ROUT_COL],
+								      i_set,
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      _col_types_element_types, error);
 	else
 		TO_IMPLEMENT;
 	
@@ -717,7 +806,11 @@ _gda_postgres_meta__schemata (GdaServerProvider *prov, GdaConnection *cnc,
 	if (!cdata)
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_SCHEMAS_ALL], i_set, error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_SCHEMAS_ALL],
+							      NULL, 
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_schemata, error);
 	if (!model)
 		return FALSE;
 
@@ -744,7 +837,11 @@ _gda_postgres_meta_schemata (GdaServerProvider *prov, GdaConnection *cnc,
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "cat"), catalog_name, error))
 		return FALSE;
 	if (!schema_name_n) {
-		model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_SCHEMAS], i_set, error);
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_SCHEMAS],
+								      i_set, 
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      _col_types_schemata, error);
 		if (!model)
 			return FALSE;
 
@@ -754,7 +851,11 @@ _gda_postgres_meta_schemata (GdaServerProvider *prov, GdaConnection *cnc,
 	else {
 		if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), schema_name_n, error))
 			return FALSE;
-		model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_SCHEMA_NAMED], i_set, error);
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_SCHEMA_NAMED],
+								      i_set, 
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      _col_types_schemata, error);
 		if (!model)
 			return FALSE;
 		
@@ -785,10 +886,18 @@ _gda_postgres_meta__tables_views (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	}
 
-	tables_model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_TABLES_ALL], i_set, error);
+	tables_model = gda_connection_statement_execute_select_full (cnc,
+								     internal_stmt[I_STMT_TABLES_ALL],
+								     NULL, 
+								     GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								     _col_types_tables, error);
 	if (!tables_model)
 		return FALSE;
-	views_model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_VIEWS_ALL], i_set, error);
+	views_model = gda_connection_statement_execute_select_full (cnc,
+								    internal_stmt[I_STMT_VIEWS_ALL],
+								    NULL, 
+								    GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								    _col_types_views, error);
 	if (!views_model) {
 		g_object_unref (tables_model);
 		return FALSE;
@@ -837,10 +946,18 @@ _gda_postgres_meta_tables_views (GdaServerProvider *prov, GdaConnection *cnc,
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "schema"), table_schema, error))
 		return FALSE;
 	if (!table_name_n) {
-		tables_model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_TABLES], i_set, error);
+		tables_model = gda_connection_statement_execute_select_full (cnc,
+									     internal_stmt[I_STMT_TABLES],
+									     i_set, 
+									     GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+									     _col_types_tables, error);
 		if (!tables_model)
 			return FALSE;
-		views_model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_VIEWS], i_set, error);
+		views_model = gda_connection_statement_execute_select_full (cnc,
+									    internal_stmt[I_STMT_VIEWS],
+									    i_set, 
+									    GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+									    _col_types_views, error);
 		if (!views_model) {
 			g_object_unref (tables_model);
 			return FALSE;
@@ -849,10 +966,18 @@ _gda_postgres_meta_tables_views (GdaServerProvider *prov, GdaConnection *cnc,
 	else {
 		if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), table_name_n, error))
 			return FALSE;
-		tables_model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_TABLE_NAMED], i_set, error);
+		tables_model = gda_connection_statement_execute_select_full (cnc,
+									     internal_stmt[I_STMT_TABLE_NAMED],
+									     i_set, 
+									     GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+									     _col_types_tables, error);
 		if (!tables_model)
 			return FALSE;
-		views_model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_VIEW_NAMED], i_set, error);
+		views_model = gda_connection_statement_execute_select_full (cnc,
+									    internal_stmt[I_STMT_VIEW_NAMED],
+									    i_set, 
+									    GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+									    _col_types_views, error);
 		if (!views_model) {
 			g_object_unref (tables_model);
 			return FALSE;
@@ -884,18 +1009,17 @@ gboolean _gda_postgres_meta__columns (GdaServerProvider *prov, GdaConnection *cn
 	gboolean retval = TRUE;
 	gint i, nrows;
 	PostgresConnectionData *cdata;
-	GType col_types[] = {
-		G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, 
-		G_TYPE_INT, G_TYPE_NONE
-	};
 
 	cdata = (PostgresConnectionData*) gda_connection_internal_get_provider_data (cnc);
 	if (!cdata)
 		return FALSE;
 
 	/* use a prepared statement for the "base" model */
-	model = gda_connection_statement_execute_select_full (cnc, internal_stmt[I_STMT_COLUMNS_ALL], i_set, 
-							      GDA_STATEMENT_MODEL_RANDOM_ACCESS, col_types, error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_COLUMNS_ALL],
+							      NULL, 
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_columns, error);
 	if (!model)
 		return FALSE;
 
@@ -978,10 +1102,6 @@ _gda_postgres_meta_columns (GdaServerProvider *prov, GdaConnection *cnc,
 	gboolean retval = TRUE;
 	gint i, nrows;
 	PostgresConnectionData *cdata;
-	GType col_types[] = {
-		G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, 
-		G_TYPE_INT, G_TYPE_NONE
-	};
 
 	/* check correct postgres server version */
 	cdata = (PostgresConnectionData*) gda_connection_internal_get_provider_data (cnc);
@@ -1000,8 +1120,11 @@ _gda_postgres_meta_columns (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), table_name, error))
 		return FALSE;
-	model = gda_connection_statement_execute_select_full (cnc, internal_stmt[I_STMT_COLUMNS_OF_TABLE], i_set, 
-							      GDA_STATEMENT_MODEL_RANDOM_ACCESS, col_types, error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_COLUMNS_OF_TABLE],
+							      i_set, 
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_columns, error);
 	if (!model)
 		return FALSE;
 
@@ -1095,7 +1218,11 @@ _gda_postgres_meta__view_cols (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	}
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_VIEWS_COLUMNS_ALL], i_set, error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_VIEWS_COLUMNS_ALL],
+							      NULL, 
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_view_column_usage, error);
 	if (!model)
 		return FALSE;
 
@@ -1126,7 +1253,12 @@ _gda_postgres_meta_view_cols (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), view_name, error))
 		return FALSE;
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_VIEWS_COLUMNS], i_set, error);
+
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_VIEWS_COLUMNS],
+							      i_set,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_view_column_usage, error);
 	if (!model)
 		return FALSE;
 
@@ -1149,8 +1281,11 @@ _gda_postgres_meta__constraints_tab (GdaServerProvider *prov, GdaConnection *cnc
 	if (!cdata)
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_TABLES_CONSTRAINTS_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_TABLES_CONSTRAINTS_ALL],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_table_constraints, error);
 	if (!model)
 		return FALSE;
 
@@ -1183,8 +1318,11 @@ _gda_postgres_meta_constraints_tab (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 
 	if (!constraint_name_n) {
-		model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_TABLES_CONSTRAINTS], i_set, 
-								 error);
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_TABLES_CONSTRAINTS],
+								      i_set,
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      _col_types_table_constraints, error);
 		if (!model)
 			return FALSE;
 		if (retval) {
@@ -1199,8 +1337,11 @@ _gda_postgres_meta_constraints_tab (GdaServerProvider *prov, GdaConnection *cnc,
 	else {
 		if (! gda_holder_set_value (gda_set_get_holder (i_set, "name2"), constraint_name_n, error))
 			return FALSE;
-		model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_TABLES_CONSTRAINT_NAMED], i_set, 
-								 error);
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_TABLES_CONSTRAINT_NAMED],
+								      i_set,
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      _col_types_table_constraints, error);
 		if (!model)
 			return FALSE;
 		if (retval) {
@@ -1228,8 +1369,11 @@ _gda_postgres_meta__constraints_ref (GdaServerProvider *prov, GdaConnection *cnc
 	if (!cdata)
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_REF_CONSTRAINTS_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_REF_CONSTRAINTS_ALL],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							     _col_types_referential_constraints, error);
 	if (!model)
 		return FALSE;
 
@@ -1262,8 +1406,11 @@ _gda_postgres_meta_constraints_ref (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name2"), constraint_name, error))
 		return FALSE;
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_REF_CONSTRAINTS], i_set, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_REF_CONSTRAINTS],
+							      i_set,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							     _col_types_referential_constraints, error);
 	if (!model)
 		return FALSE;
 
@@ -1293,8 +1440,11 @@ _gda_postgres_meta__key_columns (GdaServerProvider *prov, GdaConnection *cnc,
 	if (!cdata)
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_KEY_COLUMN_USAGE_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_KEY_COLUMN_USAGE_ALL],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							     _col_types_key_column_usage, error);
 	if (!model)
 		return FALSE;
 
@@ -1327,8 +1477,12 @@ _gda_postgres_meta_key_columns (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name2"), constraint_name, error))
 		return FALSE;
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_KEY_COLUMN_USAGE], i_set, 
-							 error);
+
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_KEY_COLUMN_USAGE],
+							      i_set,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_key_column_usage, error);
 	if (!model)
 		return FALSE;
 
@@ -1358,8 +1512,11 @@ _gda_postgres_meta__check_columns (GdaServerProvider *prov, GdaConnection *cnc,
 	if (!cdata)
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_CHECK_COLUMN_USAGE_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_CHECK_COLUMN_USAGE_ALL],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_check_column_usage, error);
 	if (!model)
 		return FALSE;
 
@@ -1392,8 +1549,12 @@ _gda_postgres_meta_check_columns (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name2"), constraint_name, error))
 		return FALSE;
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_CHECK_COLUMN_USAGE], i_set, 
-							 error);
+
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_CHECK_COLUMN_USAGE],
+							      i_set,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_check_column_usage, error);
 	if (!model)
 		return FALSE;
 
@@ -1429,8 +1590,11 @@ _gda_postgres_meta__triggers (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	}
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_TRIGGERS_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_TRIGGERS_ALL],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_triggers, error);
 	if (!model)
 		return FALSE;
 
@@ -1468,8 +1632,11 @@ _gda_postgres_meta_triggers (GdaServerProvider *prov, GdaConnection *cnc,
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), table_name, error))
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_TRIGGERS], i_set, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_TRIGGERS],
+							      i_set,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_triggers, error);
 	if (!model)
 		return FALSE;
 
@@ -1498,8 +1665,11 @@ _gda_postgres_meta__routines (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	}
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_ROUTINES_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_ROUTINES_ALL],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_routines, error);
 	if (!model)
 		return FALSE;
 
@@ -1537,12 +1707,18 @@ _gda_postgres_meta_routines (GdaServerProvider *prov, GdaConnection *cnc,
 	if (routine_name_n) {
 		if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), routine_name_n, error))
 			return FALSE;
-		model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_ROUTINES_ONE], i_set, 
-								 error);
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_ROUTINES_ONE],
+								      i_set,
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      _col_types_routines, error);
 	}
 	else 
-		model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_ROUTINES], i_set, 
-								 error);
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_ROUTINES],
+								      i_set,
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      _col_types_routines, error);
 
 	if (!model)
 		return FALSE;
@@ -1574,8 +1750,11 @@ _gda_postgres_meta__routine_col (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	}
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_ROUTINE_COL_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_ROUTINE_COL_ALL],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_routine_columns, error);
 	if (!model)
 		return FALSE;
 
@@ -1643,8 +1822,11 @@ GdaDataModel *model, *proxy;
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), rout_name, error))
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_ROUTINE_COL], i_set, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_ROUTINE_COL],
+							      i_set,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_routine_columns, error);
 	if (!model)
 		return FALSE;
 
@@ -1702,8 +1884,11 @@ _gda_postgres_meta__routine_par (GdaServerProvider *prov, GdaConnection *cnc,
 		return FALSE;
 	}
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_ROUTINE_PAR_ALL], NULL, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_ROUTINE_PAR_ALL],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_parameters, error);
 	if (!model)
 		return FALSE;
 
@@ -1741,8 +1926,114 @@ _gda_postgres_meta_routine_par (GdaServerProvider *prov, GdaConnection *cnc,
 	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), rout_name, error))
 		return FALSE;
 
-	model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_ROUTINE_PAR], i_set, 
-							 error);
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_ROUTINE_PAR],
+							      i_set,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      _col_types_parameters, error);
+	if (!model)
+		return FALSE;
+
+	gda_meta_store_set_reserved_keywords_func (store, _gda_postgres_get_reserved_keyword_func (cdata));
+	retval = gda_meta_store_modify_with_context (store, context, model, error);
+	g_object_unref (model);
+		
+	return retval;
+}
+
+gboolean
+_gda_postgres_meta__indexes_tab (GdaServerProvider *prov, GdaConnection *cnc, 
+				 GdaMetaStore *store, GdaMetaContext *context, GError **error)
+{
+	GdaDataModel *model;
+	gboolean retval;
+	GType *types;
+
+	/* check correct postgres server version */
+	PostgresConnectionData *cdata;
+	cdata = (PostgresConnectionData*) gda_connection_internal_get_provider_data (cnc);
+	if (!cdata)
+		return FALSE;
+	if (cdata->version_float < 8.2) {
+		/* nothing for this version of PostgreSQL */
+		return TRUE;
+	}
+
+	gint tsize;
+	tsize = sizeof (_col_types_table_indexes) / sizeof (GType);
+	types = g_new (GType, tsize + 1);
+	memcpy (types, _col_types_table_indexes, tsize * sizeof (GType));
+	types [tsize-1] = G_TYPE_UINT;
+	types [tsize] = G_TYPE_NONE;
+
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_INDEXES_ALL],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      types, error);
+	g_free (types);
+	if (!model)
+		return FALSE;
+
+	gda_meta_store_set_reserved_keywords_func (store, _gda_postgres_get_reserved_keyword_func (cdata));
+	retval = gda_meta_store_modify_with_context (store, context, model, error);
+	g_object_unref (model);
+
+	return retval;
+}
+
+gboolean
+_gda_postgres_meta_indexes_tab (GdaServerProvider *prov, GdaConnection *cnc, 
+				GdaMetaStore *store, GdaMetaContext *context, GError **error,
+				const GValue *table_catalog, const GValue *table_schema, const GValue *table_name,
+				const GValue *index_name_n)
+{
+	GdaDataModel *model;
+	gboolean retval = TRUE;
+	GType *types;
+
+	/* check correct postgres server version */
+	PostgresConnectionData *cdata;
+	cdata = (PostgresConnectionData*) gda_connection_internal_get_provider_data (cnc);
+	if (!cdata)
+		return FALSE;
+	if (cdata->version_float < 8.2) {
+		/* nothing for this version of PostgreSQL */
+		return TRUE;
+	}
+
+	if (! gda_holder_set_value (gda_set_get_holder (i_set, "cat"), table_catalog, error))
+		return FALSE;
+	if (! gda_holder_set_value (gda_set_get_holder (i_set, "schema"), table_schema, error))
+		return FALSE;
+	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), table_name, error))
+		return FALSE;
+
+	gint tsize;
+	tsize = sizeof (_col_types_table_indexes) / sizeof (GType);
+	types = g_new (GType, tsize + 1);
+	memcpy (types, _col_types_table_indexes, tsize * sizeof (GType));
+	types [tsize-1] = G_TYPE_UINT;
+	types [tsize] = G_TYPE_NONE;
+
+	if (index_name_n) {
+		if (! gda_holder_set_value (gda_set_get_holder (i_set, "name2"), index_name_n, error)) {
+			g_free (types);
+			return FALSE;
+		}
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_INDEXES_NAMED],
+								      i_set,
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      types, error);
+	}
+	else
+		model = gda_connection_statement_execute_select_full (cnc,
+								      internal_stmt[I_STMT_INDEXES],
+								      i_set,
+								      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+								      types, error);
+	g_free (types);
 	if (!model)
 		return FALSE;
 
@@ -1752,3 +2043,169 @@ _gda_postgres_meta_routine_par (GdaServerProvider *prov, GdaConnection *cnc,
 		
 	return retval;
 }
+
+static GdaDataModel *
+concatenate_index_details (GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *store,
+			   GdaDataModel *index_oid_model, GError **error)
+{
+	GdaDataModel *concat = NULL;
+	gint i, nrows;
+	nrows = gda_data_model_get_n_rows (index_oid_model);
+	if (nrows == 0) {
+		g_set_error (error, GDA_SERVER_PROVIDER_ERROR, GDA_SERVER_PROVIDER_INTERNAL_ERROR,
+			     _("could not determine the indexed columns for index"));
+		return NULL;
+	}
+	for (i = 0; i < nrows; i++) {
+		const GValue *value;
+		value = gda_data_model_get_value_at (index_oid_model, 0, i, error);
+		if (!value) {
+			if (concat)
+				g_object_unref (concat);
+			return NULL;
+		}
+
+		if (G_VALUE_TYPE (value) == GDA_TYPE_NULL)
+			continue;
+		
+		/* get index's columns details */
+		GdaDataModel *tmpmodel;
+		if (! gda_holder_set_value (gda_set_get_holder (i_set, "oid"), value, error)) {
+			if (concat)
+				g_object_unref (concat);
+			return NULL;
+		}
+		tmpmodel = gda_connection_statement_execute_select_full (cnc,
+									 internal_stmt[I_STMT_INDEXES_COLUMNS_FOR_INDEX],
+									 i_set,
+									 GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+									 _col_types_index_column_usage, error);
+		if (!tmpmodel) {
+			if (concat)
+				g_object_unref (concat);
+			return NULL;
+		}
+
+		/* create a concatenated model of all the @tmpmodel's contents */
+		if (!concat) {
+			concat = (GdaDataModel*) gda_data_model_array_copy_model (tmpmodel, error);
+			if (!concat) {
+				g_object_unref (tmpmodel);
+				return NULL;
+			}
+		}
+		else {
+			gint tnrows, ti, tncols;
+			tnrows = gda_data_model_get_n_rows (tmpmodel);
+			tncols = gda_data_model_get_n_columns (tmpmodel);
+			for (ti = 0; ti < tnrows; ti++) {
+				GList *list = NULL;
+				gint tj;
+				for (tj = tncols - 1; tj >= 0 ; tj--) {
+					value = gda_data_model_get_value_at (tmpmodel, tj, ti, error);
+					if (!value) {
+						g_list_free (list);
+						g_object_unref (tmpmodel);
+						if (concat)
+							g_object_unref (concat);
+						return NULL;
+					}
+					list = g_list_prepend (list, (gpointer) value);
+				}
+				if (gda_data_model_append_values (concat, list, error) == -1) {
+					g_list_free (list);
+					g_object_unref (tmpmodel);
+					if (concat)
+						g_object_unref (concat);
+					return NULL;
+				}
+				g_list_free (list);
+			}
+		}
+	}
+	return concat;
+}
+
+gboolean
+_gda_postgres_meta__index_cols (GdaServerProvider *prov, GdaConnection *cnc, 
+				GdaMetaStore *store, GdaMetaContext *context, GError **error)
+{
+	GdaDataModel *model, *concat;
+	GType index_oids_types[] = {G_TYPE_UINT, G_TYPE_NONE};
+
+	/* check correct postgres server version */
+	PostgresConnectionData *cdata;
+	cdata = (PostgresConnectionData*) gda_connection_internal_get_provider_data (cnc);
+	if (!cdata)
+		return FALSE;
+	if (cdata->version_float < 8.2) {
+		/* nothing for this version of PostgreSQL */
+		return TRUE;
+	}
+
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_INDEXES_COLUMNS_GET_ALL_INDEXES],
+							      NULL,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      index_oids_types, error);
+	if (!model)
+		return FALSE;
+
+	concat = concatenate_index_details (prov, cnc, store, model, error);
+	g_object_unref (model);
+	if (!concat)
+		return FALSE;
+
+	gboolean retval;
+	gda_meta_store_set_reserved_keywords_func (store, _gda_postgres_get_reserved_keyword_func (cdata));
+	retval = gda_meta_store_modify_with_context (store, context, concat, error);
+	g_object_unref (concat);
+
+	return retval;
+}
+
+gboolean
+_gda_postgres_meta_index_cols (GdaServerProvider *prov, GdaConnection *cnc, 
+			       GdaMetaStore *store, GdaMetaContext *context, GError **error,
+			       const GValue *table_catalog, const GValue *table_schema,
+			       const GValue *table_name, const GValue *index_name)
+{
+	GdaDataModel *model, *concat;
+	GType index_oids_types[] = {G_TYPE_UINT, G_TYPE_NONE};
+
+	/* check correct postgres server version */
+	PostgresConnectionData *cdata;
+	cdata = (PostgresConnectionData*) gda_connection_internal_get_provider_data (cnc);
+	if (!cdata)
+		return FALSE;
+	if (cdata->version_float < 8.2) {
+		/* nothing for this version of PostgreSQL */
+		return TRUE;
+	}
+	if (! gda_holder_set_value (gda_set_get_holder (i_set, "cat"), table_catalog, error))
+		return FALSE;
+	if (! gda_holder_set_value (gda_set_get_holder (i_set, "schema"), table_schema, error))
+		return FALSE;
+	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name"), table_name, error))
+		return FALSE;
+	if (! gda_holder_set_value (gda_set_get_holder (i_set, "name2"), index_name, error))
+		return FALSE;
+	model = gda_connection_statement_execute_select_full (cnc,
+							      internal_stmt[I_STMT_INDEXES_COLUMNS_GET_NAMED_INDEXES],
+							      i_set,
+							      GDA_STATEMENT_MODEL_RANDOM_ACCESS,
+							      index_oids_types, error);
+	if (!model)
+		return FALSE;
+
+	concat = concatenate_index_details (prov, cnc, store, model, error);
+	g_object_unref (model);
+	if (!concat)
+		return FALSE;
+
+	gboolean retval;
+	gda_meta_store_set_reserved_keywords_func (store, _gda_postgres_get_reserved_keyword_func (cdata));
+	retval = gda_meta_store_modify_with_context (store, context, concat, error);
+	g_object_unref (concat);
+	return retval;
+}
diff --git a/providers/postgres/gda-postgres-meta.h b/providers/postgres/gda-postgres-meta.h
index 46e4ef9..3dce5ed 100644
--- a/providers/postgres/gda-postgres-meta.h
+++ b/providers/postgres/gda-postgres-meta.h
@@ -190,6 +190,21 @@ gboolean _gda_postgres_meta_routine_par      (GdaServerProvider *prov, GdaConnec
 					      const GValue *rout_catalog, const GValue *rout_schema, 
 					      const GValue *rout_name);
 
+/* _table_indexes */
+gboolean _gda_postgres_meta__indexes_tab     (GdaServerProvider *prov, GdaConnection *cnc, 
+					      GdaMetaStore *store, GdaMetaContext *context, GError **error);
+gboolean _gda_postgres_meta_indexes_tab      (GdaServerProvider *prov, GdaConnection *cnc, 
+					      GdaMetaStore *store, GdaMetaContext *context, GError **error,
+					      const GValue *table_catalog, const GValue *table_schema, const GValue *table_name,
+					      const GValue *index_name_n);
+
+/* _index_column_usage */
+gboolean _gda_postgres_meta__index_cols      (GdaServerProvider *prov, GdaConnection *cnc, 
+					      GdaMetaStore *store, GdaMetaContext *context, GError **error);
+gboolean _gda_postgres_meta_index_cols       (GdaServerProvider *prov, GdaConnection *cnc, 
+					      GdaMetaStore *store, GdaMetaContext *context, GError **error,
+					      const GValue *table_catalog, const GValue *table_schema,
+					      const GValue *table_name, const GValue *index_name);
 G_END_DECLS
 
 #endif
diff --git a/providers/postgres/gda-postgres-provider.c b/providers/postgres/gda-postgres-provider.c
index 2555a01..aca6e22 100644
--- a/providers/postgres/gda-postgres-provider.c
+++ b/providers/postgres/gda-postgres-provider.c
@@ -260,6 +260,10 @@ gda_postgres_provider_class_init (GdaPostgresProviderClass *klass)
 	provider_class->meta_funcs.routine_col = _gda_postgres_meta_routine_col;
 	provider_class->meta_funcs._routine_par = _gda_postgres_meta__routine_par;
 	provider_class->meta_funcs.routine_par = _gda_postgres_meta_routine_par;
+	provider_class->meta_funcs._indexes_tab = _gda_postgres_meta__indexes_tab;
+        provider_class->meta_funcs.indexes_tab = _gda_postgres_meta_indexes_tab;
+        provider_class->meta_funcs._index_cols = _gda_postgres_meta__index_cols;
+        provider_class->meta_funcs.index_cols = _gda_postgres_meta_index_cols;
 
 	provider_class->xa_funcs = g_new0 (GdaServerProviderXa, 1);
 	provider_class->xa_funcs->xa_start = gda_postgres_provider_xa_start;
diff --git a/providers/postgres/gda-postgres-recordset.c b/providers/postgres/gda-postgres-recordset.c
index 088ebb9..440809a 100644
--- a/providers/postgres/gda-postgres-recordset.c
+++ b/providers/postgres/gda-postgres-recordset.c
@@ -607,6 +607,8 @@ set_value (GdaConnection *cnc, GdaRow *row, GValue *value, GType type, const gch
 		g_value_set_string (value, thevalue);
 	else if (type == G_TYPE_INT)
 		g_value_set_int (value, atol (thevalue));
+	else if (type == G_TYPE_UINT)
+		g_value_set_uint (value, (guint) g_ascii_strtoull (thevalue, NULL, 10));
 	else if (type == G_TYPE_DATE) {
 		GDate date;
 		if (!gda_parse_iso8601_date (&date, thevalue)) {



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