1<!-- doc/src/sgml/information_schema.sgml --> 2 3<chapter id="information-schema"> 4 <title>The Information Schema</title> 5 6 <indexterm zone="information-schema"> 7 <primary>information schema</primary> 8 </indexterm> 9 10 <para> 11 The information schema consists of a set of views that contain 12 information about the objects defined in the current database. The 13 information schema is defined in the SQL standard and can therefore 14 be expected to be portable and remain stable — unlike the system 15 catalogs, which are specific to 16 <productname>PostgreSQL</productname> and are modeled after 17 implementation concerns. The information schema views do not, 18 however, contain information about 19 <productname>PostgreSQL</productname>-specific features; to inquire 20 about those you need to query the system catalogs or other 21 <productname>PostgreSQL</productname>-specific views. 22 </para> 23 24 <note> 25 <para> 26 When querying the database for constraint information, it is possible 27 for a standard-compliant query that expects to return one row to 28 return several. This is because the SQL standard requires constraint 29 names to be unique within a schema, but 30 <productname>PostgreSQL</productname> does not enforce this 31 restriction. <productname>PostgreSQL</productname> 32 automatically-generated constraint names avoid duplicates in the 33 same schema, but users can specify such duplicate names. 34 </para> 35 36 <para> 37 This problem can appear when querying information schema views such 38 as <literal>check_constraint_routine_usage</literal>, 39 <literal>check_constraints</literal>, <literal>domain_constraints</literal>, and 40 <literal>referential_constraints</literal>. Some other views have similar 41 issues but contain the table name to help distinguish duplicate 42 rows, e.g., <literal>constraint_column_usage</literal>, 43 <literal>constraint_table_usage</literal>, <literal>table_constraints</literal>. 44 </para> 45 </note> 46 47 48 <sect1 id="infoschema-schema"> 49 <title>The Schema</title> 50 51 <para> 52 The information schema itself is a schema named 53 <literal>information_schema</literal>. This schema automatically 54 exists in all databases. The owner of this schema is the initial 55 database user in the cluster, and that user naturally has all the 56 privileges on this schema, including the ability to drop it (but 57 the space savings achieved by that are minuscule). 58 </para> 59 60 <para> 61 By default, the information schema is not in the schema search 62 path, so you need to access all objects in it through qualified 63 names. Since the names of some of the objects in the information 64 schema are generic names that might occur in user applications, you 65 should be careful if you want to put the information schema in the 66 path. 67 </para> 68 </sect1> 69 70 <sect1 id="infoschema-datatypes"> 71 <title>Data Types</title> 72 73 <para> 74 The columns of the information schema views use special data types 75 that are defined in the information schema. These are defined as 76 simple domains over ordinary built-in types. You should not use 77 these types for work outside the information schema, but your 78 applications must be prepared for them if they select from the 79 information schema. 80 </para> 81 82 <para> 83 These types are: 84 85 <variablelist> 86 <varlistentry> 87 <term><type>cardinal_number</type></term> 88 <listitem> 89 <para> 90 A nonnegative integer. 91 </para> 92 </listitem> 93 </varlistentry> 94 95 <varlistentry> 96 <term><type>character_data</type></term> 97 <listitem> 98 <para> 99 A character string (without specific maximum length). 100 </para> 101 </listitem> 102 </varlistentry> 103 104 <varlistentry> 105 <term><type>sql_identifier</type></term> 106 <listitem> 107 <para> 108 A character string. This type is used for SQL identifiers, the 109 type <type>character_data</type> is used for any other kind of 110 text data. 111 </para> 112 </listitem> 113 </varlistentry> 114 115 <varlistentry> 116 <term><type>time_stamp</type></term> 117 <listitem> 118 <para> 119 A domain over the type <type>timestamp with time zone</type> 120 </para> 121 </listitem> 122 </varlistentry> 123 124 <varlistentry> 125 <term><type>yes_or_no</type></term> 126 <listitem> 127 <para> 128 A character string domain that contains 129 either <literal>YES</literal> or <literal>NO</literal>. This 130 is used to represent Boolean (true/false) data in the 131 information schema. (The information schema was invented 132 before the type <type>boolean</type> was added to the SQL 133 standard, so this convention is necessary to keep the 134 information schema backward compatible.) 135 </para> 136 </listitem> 137 </varlistentry> 138 </variablelist> 139 140 Every column in the information schema has one of these five types. 141 </para> 142 </sect1> 143 144 <sect1 id="infoschema-information-schema-catalog-name"> 145 <title><literal>information_schema_catalog_name</literal></title> 146 147 <para> 148 <literal>information_schema_catalog_name</literal> is a table that 149 always contains one row and one column containing the name of the 150 current database (current catalog, in SQL terminology). 151 </para> 152 153 <table> 154 <title><structname>information_schema_catalog_name</structname> Columns</title> 155 <tgroup cols="1"> 156 <thead> 157 <row> 158 <entry role="catalog_table_entry"><para role="column_definition"> 159 Column Type 160 </para> 161 <para> 162 Description 163 </para></entry> 164 </row> 165 </thead> 166 167 <tbody> 168 <row> 169 <entry role="catalog_table_entry"><para role="column_definition"> 170 <structfield>catalog_name</structfield> <type>sql_identifier</type> 171 </para> 172 <para> 173 Name of the database that contains this information schema 174 </para></entry> 175 </row> 176 </tbody> 177 </tgroup> 178 </table> 179 </sect1> 180 181 <sect1 id="infoschema-administrable-role-authorizations"> 182 <title><literal>administrable_role_&zwsp;authorizations</literal></title> 183 184 <para> 185 The view <literal>administrable_role_authorizations</literal> 186 identifies all roles that the current user has the admin option 187 for. 188 </para> 189 190 <table> 191 <title><structname>administrable_role_authorizations</structname> Columns</title> 192 <tgroup cols="1"> 193 <thead> 194 <row> 195 <entry role="catalog_table_entry"><para role="column_definition"> 196 Column Type 197 </para> 198 <para> 199 Description 200 </para></entry> 201 </row> 202 </thead> 203 204 <tbody> 205 <row> 206 <entry role="catalog_table_entry"><para role="column_definition"> 207 <structfield>grantee</structfield> <type>sql_identifier</type> 208 </para> 209 <para> 210 Name of the role to which this role membership was granted (can 211 be the current user, or a different role in case of nested role 212 memberships) 213 </para></entry> 214 </row> 215 216 <row> 217 <entry role="catalog_table_entry"><para role="column_definition"> 218 <structfield>role_name</structfield> <type>sql_identifier</type> 219 </para> 220 <para> 221 Name of a role 222 </para></entry> 223 </row> 224 225 <row> 226 <entry role="catalog_table_entry"><para role="column_definition"> 227 <structfield>is_grantable</structfield> <type>yes_or_no</type> 228 </para> 229 <para> 230 Always <literal>YES</literal> 231 </para></entry> 232 </row> 233 </tbody> 234 </tgroup> 235 </table> 236 </sect1> 237 238 <sect1 id="infoschema-applicable-roles"> 239 <title><literal>applicable_roles</literal></title> 240 241 <para> 242 The view <literal>applicable_roles</literal> identifies all roles 243 whose privileges the current user can use. This means there is 244 some chain of role grants from the current user to the role in 245 question. The current user itself is also an applicable role. The 246 set of applicable roles is generally used for permission checking. 247 <indexterm><primary>applicable role</primary></indexterm> 248 <indexterm><primary>role</primary><secondary>applicable</secondary></indexterm> 249 </para> 250 251 <table> 252 <title><structname>applicable_roles</structname> Columns</title> 253 <tgroup cols="1"> 254 <thead> 255 <row> 256 <entry role="catalog_table_entry"><para role="column_definition"> 257 Column Type 258 </para> 259 <para> 260 Description 261 </para></entry> 262 </row> 263 </thead> 264 265 <tbody> 266 <row> 267 <entry role="catalog_table_entry"><para role="column_definition"> 268 <structfield>grantee</structfield> <type>sql_identifier</type> 269 </para> 270 <para> 271 Name of the role to which this role membership was granted (can 272 be the current user, or a different role in case of nested role 273 memberships) 274 </para></entry> 275 </row> 276 277 <row> 278 <entry role="catalog_table_entry"><para role="column_definition"> 279 <structfield>role_name</structfield> <type>sql_identifier</type> 280 </para> 281 <para> 282 Name of a role 283 </para></entry> 284 </row> 285 286 <row> 287 <entry role="catalog_table_entry"><para role="column_definition"> 288 <structfield>is_grantable</structfield> <type>yes_or_no</type> 289 </para> 290 <para> 291 <literal>YES</literal> if the grantee has the admin option on 292 the role, <literal>NO</literal> if not 293 </para></entry> 294 </row> 295 </tbody> 296 </tgroup> 297 </table> 298 </sect1> 299 300 <sect1 id="infoschema-attributes"> 301 <title><literal>attributes</literal></title> 302 303 <para> 304 The view <literal>attributes</literal> contains information about 305 the attributes of composite data types defined in the database. 306 (Note that the view does not give information about table columns, 307 which are sometimes called attributes in PostgreSQL contexts.) 308 Only those attributes are shown that the current user has access to (by way 309 of being the owner of or having some privilege on the type). 310 </para> 311 312 <table> 313 <title><structname>attributes</structname> Columns</title> 314 <tgroup cols="1"> 315 <thead> 316 <row> 317 <entry role="catalog_table_entry"><para role="column_definition"> 318 Column Type 319 </para> 320 <para> 321 Description 322 </para></entry> 323 </row> 324 </thead> 325 326 <tbody> 327 <row> 328 <entry role="catalog_table_entry"><para role="column_definition"> 329 <structfield>udt_catalog</structfield> <type>sql_identifier</type> 330 </para> 331 <para> 332 Name of the database containing the data type (always the current database) 333 </para></entry> 334 </row> 335 336 <row> 337 <entry role="catalog_table_entry"><para role="column_definition"> 338 <structfield>udt_schema</structfield> <type>sql_identifier</type> 339 </para> 340 <para> 341 Name of the schema containing the data type 342 </para></entry> 343 </row> 344 345 <row> 346 <entry role="catalog_table_entry"><para role="column_definition"> 347 <structfield>udt_name</structfield> <type>sql_identifier</type> 348 </para> 349 <para> 350 Name of the data type 351 </para></entry> 352 </row> 353 354 <row> 355 <entry role="catalog_table_entry"><para role="column_definition"> 356 <structfield>attribute_name</structfield> <type>sql_identifier</type> 357 </para> 358 <para> 359 Name of the attribute 360 </para></entry> 361 </row> 362 363 <row> 364 <entry role="catalog_table_entry"><para role="column_definition"> 365 <structfield>ordinal_position</structfield> <type>cardinal_number</type> 366 </para> 367 <para> 368 Ordinal position of the attribute within the data type (count starts at 1) 369 </para></entry> 370 </row> 371 372 <row> 373 <entry role="catalog_table_entry"><para role="column_definition"> 374 <structfield>attribute_default</structfield> <type>character_data</type> 375 </para> 376 <para> 377 Default expression of the attribute 378 </para></entry> 379 </row> 380 381 <row> 382 <entry role="catalog_table_entry"><para role="column_definition"> 383 <structfield>is_nullable</structfield> <type>yes_or_no</type> 384 </para> 385 <para> 386 <literal>YES</literal> if the attribute is possibly nullable, 387 <literal>NO</literal> if it is known not nullable. 388 </para></entry> 389 </row> 390 391 <row> 392 <entry role="catalog_table_entry"><para role="column_definition"> 393 <structfield>data_type</structfield> <type>character_data</type> 394 </para> 395 <para> 396 Data type of the attribute, if it is a built-in type, or 397 <literal>ARRAY</literal> if it is some array (in that case, see 398 the view <literal>element_types</literal>), else 399 <literal>USER-DEFINED</literal> (in that case, the type is 400 identified in <literal>attribute_udt_name</literal> and 401 associated columns). 402 </para></entry> 403 </row> 404 405 <row> 406 <entry role="catalog_table_entry"><para role="column_definition"> 407 <structfield>character_maximum_length</structfield> <type>cardinal_number</type> 408 </para> 409 <para> 410 If <literal>data_type</literal> identifies a character or bit 411 string type, the declared maximum length; null for all other 412 data types or if no maximum length was declared. 413 </para></entry> 414 </row> 415 416 <row> 417 <entry role="catalog_table_entry"><para role="column_definition"> 418 <structfield>character_octet_length</structfield> <type>cardinal_number</type> 419 </para> 420 <para> 421 If <literal>data_type</literal> identifies a character type, 422 the maximum possible length in octets (bytes) of a datum; null 423 for all other data types. The maximum octet length depends on 424 the declared character maximum length (see above) and the 425 server encoding. 426 </para></entry> 427 </row> 428 429 <row> 430 <entry role="catalog_table_entry"><para role="column_definition"> 431 <structfield>character_set_catalog</structfield> <type>sql_identifier</type> 432 </para> 433 <para> 434 Applies to a feature not available in <productname>PostgreSQL</productname> 435 </para></entry> 436 </row> 437 438 <row> 439 <entry role="catalog_table_entry"><para role="column_definition"> 440 <structfield>character_set_schema</structfield> <type>sql_identifier</type> 441 </para> 442 <para> 443 Applies to a feature not available in <productname>PostgreSQL</productname> 444 </para></entry> 445 </row> 446 447 <row> 448 <entry role="catalog_table_entry"><para role="column_definition"> 449 <structfield>character_set_name</structfield> <type>sql_identifier</type> 450 </para> 451 <para> 452 Applies to a feature not available in <productname>PostgreSQL</productname> 453 </para></entry> 454 </row> 455 456 <row> 457 <entry role="catalog_table_entry"><para role="column_definition"> 458 <structfield>collation_catalog</structfield> <type>sql_identifier</type> 459 </para> 460 <para> 461 Name of the database containing the collation of the attribute 462 (always the current database), null if default or the data type 463 of the attribute is not collatable 464 </para></entry> 465 </row> 466 467 <row> 468 <entry role="catalog_table_entry"><para role="column_definition"> 469 <structfield>collation_schema</structfield> <type>sql_identifier</type> 470 </para> 471 <para> 472 Name of the schema containing the collation of the attribute, 473 null if default or the data type of the attribute is not 474 collatable 475 </para></entry> 476 </row> 477 478 <row> 479 <entry role="catalog_table_entry"><para role="column_definition"> 480 <structfield>collation_name</structfield> <type>sql_identifier</type> 481 </para> 482 <para> 483 Name of the collation of the attribute, null if default or the 484 data type of the attribute is not collatable 485 </para></entry> 486 </row> 487 488 <row> 489 <entry role="catalog_table_entry"><para role="column_definition"> 490 <structfield>numeric_precision</structfield> <type>cardinal_number</type> 491 </para> 492 <para> 493 If <literal>data_type</literal> identifies a numeric type, this 494 column contains the (declared or implicit) precision of the 495 type for this attribute. The precision indicates the number of 496 significant digits. It can be expressed in decimal (base 10) 497 or binary (base 2) terms, as specified in the column 498 <literal>numeric_precision_radix</literal>. For all other data 499 types, this column is null. 500 </para></entry> 501 </row> 502 503 <row> 504 <entry role="catalog_table_entry"><para role="column_definition"> 505 <structfield>numeric_precision_radix</structfield> <type>cardinal_number</type> 506 </para> 507 <para> 508 If <literal>data_type</literal> identifies a numeric type, this 509 column indicates in which base the values in the columns 510 <literal>numeric_precision</literal> and 511 <literal>numeric_scale</literal> are expressed. The value is 512 either 2 or 10. For all other data types, this column is null. 513 </para></entry> 514 </row> 515 516 <row> 517 <entry role="catalog_table_entry"><para role="column_definition"> 518 <structfield>numeric_scale</structfield> <type>cardinal_number</type> 519 </para> 520 <para> 521 If <literal>data_type</literal> identifies an exact numeric 522 type, this column contains the (declared or implicit) scale of 523 the type for this attribute. The scale indicates the number of 524 significant digits to the right of the decimal point. It can 525 be expressed in decimal (base 10) or binary (base 2) terms, as 526 specified in the column 527 <literal>numeric_precision_radix</literal>. For all other data 528 types, this column is null. 529 </para></entry> 530 </row> 531 532 <row> 533 <entry role="catalog_table_entry"><para role="column_definition"> 534 <structfield>datetime_precision</structfield> <type>cardinal_number</type> 535 </para> 536 <para> 537 If <literal>data_type</literal> identifies a date, time, 538 timestamp, or interval type, this column contains the (declared 539 or implicit) fractional seconds precision of the type for this 540 attribute, that is, the number of decimal digits maintained 541 following the decimal point in the seconds value. For all 542 other data types, this column is null. 543 </para></entry> 544 </row> 545 546 <row> 547 <entry role="catalog_table_entry"><para role="column_definition"> 548 <structfield>interval_type</structfield> <type>character_data</type> 549 </para> 550 <para> 551 If <literal>data_type</literal> identifies an interval type, 552 this column contains the specification which fields the 553 intervals include for this attribute, e.g., <literal>YEAR TO 554 MONTH</literal>, <literal>DAY TO SECOND</literal>, etc. If no 555 field restrictions were specified (that is, the interval 556 accepts all fields), and for all other data types, this field 557 is null. 558 </para></entry> 559 </row> 560 561 <row> 562 <entry role="catalog_table_entry"><para role="column_definition"> 563 <structfield>interval_precision</structfield> <type>cardinal_number</type> 564 </para> 565 <para> 566 Applies to a feature not available 567 in <productname>PostgreSQL</productname> 568 (see <literal>datetime_precision</literal> for the fractional 569 seconds precision of interval type attributes) 570 </para></entry> 571 </row> 572 573 <row> 574 <entry role="catalog_table_entry"><para role="column_definition"> 575 <structfield>attribute_udt_catalog</structfield> <type>sql_identifier</type> 576 </para> 577 <para> 578 Name of the database that the attribute data type is defined in 579 (always the current database) 580 </para></entry> 581 </row> 582 583 <row> 584 <entry role="catalog_table_entry"><para role="column_definition"> 585 <structfield>attribute_udt_schema</structfield> <type>sql_identifier</type> 586 </para> 587 <para> 588 Name of the schema that the attribute data type is defined in 589 </para></entry> 590 </row> 591 592 <row> 593 <entry role="catalog_table_entry"><para role="column_definition"> 594 <structfield>attribute_udt_name</structfield> <type>sql_identifier</type> 595 </para> 596 <para> 597 Name of the attribute data type 598 </para></entry> 599 </row> 600 601 <row> 602 <entry role="catalog_table_entry"><para role="column_definition"> 603 <structfield>scope_catalog</structfield> <type>sql_identifier</type> 604 </para> 605 <para> 606 Applies to a feature not available in <productname>PostgreSQL</productname> 607 </para></entry> 608 </row> 609 610 <row> 611 <entry role="catalog_table_entry"><para role="column_definition"> 612 <structfield>scope_schema</structfield> <type>sql_identifier</type> 613 </para> 614 <para> 615 Applies to a feature not available in <productname>PostgreSQL</productname> 616 </para></entry> 617 </row> 618 619 <row> 620 <entry role="catalog_table_entry"><para role="column_definition"> 621 <structfield>scope_name</structfield> <type>sql_identifier</type> 622 </para> 623 <para> 624 Applies to a feature not available in <productname>PostgreSQL</productname> 625 </para></entry> 626 </row> 627 628 <row> 629 <entry role="catalog_table_entry"><para role="column_definition"> 630 <structfield>maximum_cardinality</structfield> <type>cardinal_number</type> 631 </para> 632 <para> 633 Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname> 634 </para></entry> 635 </row> 636 637 <row> 638 <entry role="catalog_table_entry"><para role="column_definition"> 639 <structfield>dtd_identifier</structfield> <type>sql_identifier</type> 640 </para> 641 <para> 642 An identifier of the data type descriptor of the column, unique 643 among the data type descriptors pertaining to the table. This 644 is mainly useful for joining with other instances of such 645 identifiers. (The specific format of the identifier is not 646 defined and not guaranteed to remain the same in future 647 versions.) 648 </para></entry> 649 </row> 650 651 <row> 652 <entry role="catalog_table_entry"><para role="column_definition"> 653 <structfield>is_derived_reference_attribute</structfield> <type>yes_or_no</type> 654 </para> 655 <para> 656 Applies to a feature not available in <productname>PostgreSQL</productname> 657 </para></entry> 658 </row> 659 </tbody> 660 </tgroup> 661 </table> 662 663 <para> 664 See also under <xref linkend="infoschema-columns"/>, a similarly 665 structured view, for further information on some of the columns. 666 </para> 667 </sect1> 668 669 <sect1 id="infoschema-character-sets"> 670 <title><literal>character_sets</literal></title> 671 672 <para> 673 The view <literal>character_sets</literal> identifies the character 674 sets available in the current database. Since PostgreSQL does not 675 support multiple character sets within one database, this view only 676 shows one, which is the database encoding. 677 </para> 678 679 <para> 680 Take note of how the following terms are used in the SQL standard: 681 <variablelist> 682 <varlistentry> 683 <term>character repertoire</term> 684 <listitem> 685 <para> 686 An abstract collection of characters, for 687 example <literal>UNICODE</literal>, <literal>UCS</literal>, or 688 <literal>LATIN1</literal>. Not exposed as an SQL object, but 689 visible in this view. 690 </para> 691 </listitem> 692 </varlistentry> 693 694 <varlistentry> 695 <term>character encoding form</term> 696 <listitem> 697 <para> 698 An encoding of some character repertoire. Most older character 699 repertoires only use one encoding form, and so there are no 700 separate names for them (e.g., <literal>LATIN1</literal> is an 701 encoding form applicable to the <literal>LATIN1</literal> 702 repertoire). But for example Unicode has the encoding forms 703 <literal>UTF8</literal>, <literal>UTF16</literal>, etc. (not 704 all supported by PostgreSQL). Encoding forms are not exposed 705 as an SQL object, but are visible in this view. 706 </para> 707 </listitem> 708 </varlistentry> 709 710 <varlistentry> 711 <term>character set</term> 712 <listitem> 713 <para> 714 A named SQL object that identifies a character repertoire, a 715 character encoding, and a default collation. A predefined 716 character set would typically have the same name as an encoding 717 form, but users could define other names. For example, the 718 character set <literal>UTF8</literal> would typically identify 719 the character repertoire <literal>UCS</literal>, encoding 720 form <literal>UTF8</literal>, and some default collation. 721 </para> 722 </listitem> 723 </varlistentry> 724 </variablelist> 725 726 You can think of an <quote>encoding</quote> in PostgreSQL either as 727 a character set or a character encoding form. They will have the 728 same name, and there can only be one in one database. 729 </para> 730 731 <table> 732 <title><structname>character_sets</structname> Columns</title> 733 <tgroup cols="1"> 734 <thead> 735 <row> 736 <entry role="catalog_table_entry"><para role="column_definition"> 737 Column Type 738 </para> 739 <para> 740 Description 741 </para></entry> 742 </row> 743 </thead> 744 745 <tbody> 746 <row> 747 <entry role="catalog_table_entry"><para role="column_definition"> 748 <structfield>character_set_catalog</structfield> <type>sql_identifier</type> 749 </para> 750 <para> 751 Character sets are currently not implemented as schema objects, so this column is null. 752 </para></entry> 753 </row> 754 755 <row> 756 <entry role="catalog_table_entry"><para role="column_definition"> 757 <structfield>character_set_schema</structfield> <type>sql_identifier</type> 758 </para> 759 <para> 760 Character sets are currently not implemented as schema objects, so this column is null. 761 </para></entry> 762 </row> 763 764 <row> 765 <entry role="catalog_table_entry"><para role="column_definition"> 766 <structfield>character_set_name</structfield> <type>sql_identifier</type> 767 </para> 768 <para> 769 Name of the character set, currently implemented as showing the name of the database encoding 770 </para></entry> 771 </row> 772 773 <row> 774 <entry role="catalog_table_entry"><para role="column_definition"> 775 <structfield>character_repertoire</structfield> <type>sql_identifier</type> 776 </para> 777 <para> 778 Character repertoire, showing <literal>UCS</literal> if the encoding is <literal>UTF8</literal>, else just the encoding name 779 </para></entry> 780 </row> 781 782 <row> 783 <entry role="catalog_table_entry"><para role="column_definition"> 784 <structfield>form_of_use</structfield> <type>sql_identifier</type> 785 </para> 786 <para> 787 Character encoding form, same as the database encoding 788 </para></entry> 789 </row> 790 791 <row> 792 <entry role="catalog_table_entry"><para role="column_definition"> 793 <structfield>default_collate_catalog</structfield> <type>sql_identifier</type> 794 </para> 795 <para> 796 Name of the database containing the default collation (always the current database, if any collation is identified) 797 </para></entry> 798 </row> 799 800 <row> 801 <entry role="catalog_table_entry"><para role="column_definition"> 802 <structfield>default_collate_schema</structfield> <type>sql_identifier</type> 803 </para> 804 <para> 805 Name of the schema containing the default collation 806 </para></entry> 807 </row> 808 809 <row> 810 <entry role="catalog_table_entry"><para role="column_definition"> 811 <structfield>default_collate_name</structfield> <type>sql_identifier</type> 812 </para> 813 <para> 814 Name of the default collation. The default collation is 815 identified as the collation that matches 816 the <literal>COLLATE</literal> and <literal>CTYPE</literal> 817 settings of the current database. If there is no such 818 collation, then this column and the associated schema and 819 catalog columns are null. 820 </para></entry> 821 </row> 822 </tbody> 823 </tgroup> 824 </table> 825 </sect1> 826 827 <sect1 id="infoschema-check-constraint-routine-usage"> 828 <title><literal>check_constraint_routine_usage</literal></title> 829 830 <para> 831 The view <literal>check_constraint_routine_usage</literal> 832 identifies routines (functions and procedures) that are used by a 833 check constraint. Only those routines are shown that are owned by 834 a currently enabled role. 835 </para> 836 837 <table> 838 <title><structname>check_constraint_routine_usage</structname> Columns</title> 839 <tgroup cols="1"> 840 <thead> 841 <row> 842 <entry role="catalog_table_entry"><para role="column_definition"> 843 Column Type 844 </para> 845 <para> 846 Description 847 </para></entry> 848 </row> 849 </thead> 850 851 <tbody> 852 <row> 853 <entry role="catalog_table_entry"><para role="column_definition"> 854 <structfield>constraint_catalog</structfield> <type>sql_identifier</type> 855 </para> 856 <para> 857 Name of the database containing the constraint (always the current database) 858 </para></entry> 859 </row> 860 861 <row> 862 <entry role="catalog_table_entry"><para role="column_definition"> 863 <structfield>constraint_schema</structfield> <type>sql_identifier</type> 864 </para> 865 <para> 866 Name of the schema containing the constraint 867 </para></entry> 868 </row> 869 870 <row> 871 <entry role="catalog_table_entry"><para role="column_definition"> 872 <structfield>constraint_name</structfield> <type>sql_identifier</type> 873 </para> 874 <para> 875 Name of the constraint 876 </para></entry> 877 </row> 878 879 <row> 880 <entry role="catalog_table_entry"><para role="column_definition"> 881 <structfield>specific_catalog</structfield> <type>sql_identifier</type> 882 </para> 883 <para> 884 Name of the database containing the function (always the current database) 885 </para></entry> 886 </row> 887 888 <row> 889 <entry role="catalog_table_entry"><para role="column_definition"> 890 <structfield>specific_schema</structfield> <type>sql_identifier</type> 891 </para> 892 <para> 893 Name of the schema containing the function 894 </para></entry> 895 </row> 896 897 <row> 898 <entry role="catalog_table_entry"><para role="column_definition"> 899 <structfield>specific_name</structfield> <type>sql_identifier</type> 900 </para> 901 <para> 902 The <quote>specific name</quote> of the function. See <xref linkend="infoschema-routines"/> for more information. 903 </para></entry> 904 </row> 905 </tbody> 906 </tgroup> 907 </table> 908 </sect1> 909 910 <sect1 id="infoschema-check-constraints"> 911 <title><literal>check_constraints</literal></title> 912 913 <para> 914 The view <literal>check_constraints</literal> contains all check 915 constraints, either defined on a table or on a domain, that are 916 owned by a currently enabled role. (The owner of the table or 917 domain is the owner of the constraint.) 918 </para> 919 920 <table> 921 <title><structname>check_constraints</structname> Columns</title> 922 <tgroup cols="1"> 923 <thead> 924 <row> 925 <entry role="catalog_table_entry"><para role="column_definition"> 926 Column Type 927 </para> 928 <para> 929 Description 930 </para></entry> 931 </row> 932 </thead> 933 934 <tbody> 935 <row> 936 <entry role="catalog_table_entry"><para role="column_definition"> 937 <structfield>constraint_catalog</structfield> <type>sql_identifier</type> 938 </para> 939 <para> 940 Name of the database containing the constraint (always the current database) 941 </para></entry> 942 </row> 943 944 <row> 945 <entry role="catalog_table_entry"><para role="column_definition"> 946 <structfield>constraint_schema</structfield> <type>sql_identifier</type> 947 </para> 948 <para> 949 Name of the schema containing the constraint 950 </para></entry> 951 </row> 952 953 <row> 954 <entry role="catalog_table_entry"><para role="column_definition"> 955 <structfield>constraint_name</structfield> <type>sql_identifier</type> 956 </para> 957 <para> 958 Name of the constraint 959 </para></entry> 960 </row> 961 962 <row> 963 <entry role="catalog_table_entry"><para role="column_definition"> 964 <structfield>check_clause</structfield> <type>character_data</type> 965 </para> 966 <para> 967 The check expression of the check constraint 968 </para></entry> 969 </row> 970 </tbody> 971 </tgroup> 972 </table> 973 </sect1> 974 975 <sect1 id="infoschema-collations"> 976 <title><literal>collations</literal></title> 977 978 <para> 979 The view <literal>collations</literal> contains the collations 980 available in the current database. 981 </para> 982 983 <table> 984 <title><structname>collations</structname> Columns</title> 985 <tgroup cols="1"> 986 <thead> 987 <row> 988 <entry role="catalog_table_entry"><para role="column_definition"> 989 Column Type 990 </para> 991 <para> 992 Description 993 </para></entry> 994 </row> 995 </thead> 996 997 <tbody> 998 <row> 999 <entry role="catalog_table_entry"><para role="column_definition"> 1000 <structfield>collation_catalog</structfield> <type>sql_identifier</type> 1001 </para> 1002 <para> 1003 Name of the database containing the collation (always the current database) 1004 </para></entry> 1005 </row> 1006 1007 <row> 1008 <entry role="catalog_table_entry"><para role="column_definition"> 1009 <structfield>collation_schema</structfield> <type>sql_identifier</type> 1010 </para> 1011 <para> 1012 Name of the schema containing the collation 1013 </para></entry> 1014 </row> 1015 1016 <row> 1017 <entry role="catalog_table_entry"><para role="column_definition"> 1018 <structfield>collation_name</structfield> <type>sql_identifier</type> 1019 </para> 1020 <para> 1021 Name of the default collation 1022 </para></entry> 1023 </row> 1024 1025 <row> 1026 <entry role="catalog_table_entry"><para role="column_definition"> 1027 <structfield>pad_attribute</structfield> <type>character_data</type> 1028 </para> 1029 <para> 1030 Always <literal>NO PAD</literal> (The alternative <literal>PAD 1031 SPACE</literal> is not supported by PostgreSQL.) 1032 </para></entry> 1033 </row> 1034 </tbody> 1035 </tgroup> 1036 </table> 1037 </sect1> 1038 1039 <sect1 id="infoschema-collation-character-set-applicab"> <!-- max 44 characters --> 1040 <title><literal>collation_character_set_&zwsp;applicability</literal></title> 1041 1042 <para> 1043 The view <literal>collation_character_set_applicability</literal> 1044 identifies which character set the available collations are 1045 applicable to. In PostgreSQL, there is only one character set per 1046 database (see explanation 1047 in <xref linkend="infoschema-character-sets"/>), so this view does 1048 not provide much useful information. 1049 </para> 1050 1051 <table> 1052 <title><structname>collation_character_set_applicability</structname> Columns</title> 1053 <tgroup cols="1"> 1054 <thead> 1055 <row> 1056 <entry role="catalog_table_entry"><para role="column_definition"> 1057 Column Type 1058 </para> 1059 <para> 1060 Description 1061 </para></entry> 1062 </row> 1063 </thead> 1064 1065 <tbody> 1066 <row> 1067 <entry role="catalog_table_entry"><para role="column_definition"> 1068 <structfield>collation_catalog</structfield> <type>sql_identifier</type> 1069 </para> 1070 <para> 1071 Name of the database containing the collation (always the current database) 1072 </para></entry> 1073 </row> 1074 1075 <row> 1076 <entry role="catalog_table_entry"><para role="column_definition"> 1077 <structfield>collation_schema</structfield> <type>sql_identifier</type> 1078 </para> 1079 <para> 1080 Name of the schema containing the collation 1081 </para></entry> 1082 </row> 1083 1084 <row> 1085 <entry role="catalog_table_entry"><para role="column_definition"> 1086 <structfield>collation_name</structfield> <type>sql_identifier</type> 1087 </para> 1088 <para> 1089 Name of the default collation 1090 </para></entry> 1091 </row> 1092 1093 <row> 1094 <entry role="catalog_table_entry"><para role="column_definition"> 1095 <structfield>character_set_catalog</structfield> <type>sql_identifier</type> 1096 </para> 1097 <para> 1098 Character sets are currently not implemented as schema objects, so this column is null 1099 </para></entry> 1100 </row> 1101 1102 <row> 1103 <entry role="catalog_table_entry"><para role="column_definition"> 1104 <structfield>character_set_schema</structfield> <type>sql_identifier</type> 1105 </para> 1106 <para> 1107 Character sets are currently not implemented as schema objects, so this column is null 1108 </para></entry> 1109 </row> 1110 1111 <row> 1112 <entry role="catalog_table_entry"><para role="column_definition"> 1113 <structfield>character_set_name</structfield> <type>sql_identifier</type> 1114 </para> 1115 <para> 1116 Name of the character set 1117 </para></entry> 1118 </row> 1119 </tbody> 1120 </tgroup> 1121 </table> 1122 </sect1> 1123 1124 <sect1 id="infoschema-column-column-usage"> 1125 <title><literal>column_column_usage</literal></title> 1126 1127 <para> 1128 The view <literal>column_column_usage</literal> identifies all generated 1129 columns that depend on another base column in the same table. Only tables 1130 owned by a currently enabled role are included. 1131 </para> 1132 1133 <table> 1134 <title><structname>column_column_usage</structname> Columns</title> 1135 <tgroup cols="1"> 1136 <thead> 1137 <row> 1138 <entry role="catalog_table_entry"><para role="column_definition"> 1139 Column Type 1140 </para> 1141 <para> 1142 Description 1143 </para></entry> 1144 </row> 1145 </thead> 1146 1147 <tbody> 1148 <row> 1149 <entry role="catalog_table_entry"><para role="column_definition"> 1150 <structfield>table_catalog</structfield> <type>sql_identifier</type> 1151 </para> 1152 <para> 1153 Name of the database containing the table (always the current database) 1154 </para></entry> 1155 </row> 1156 1157 <row> 1158 <entry role="catalog_table_entry"><para role="column_definition"> 1159 <structfield>table_schema</structfield> <type>sql_identifier</type> 1160 </para> 1161 <para> 1162 Name of the schema containing the table 1163 </para></entry> 1164 </row> 1165 1166 <row> 1167 <entry role="catalog_table_entry"><para role="column_definition"> 1168 <structfield>table_name</structfield> <type>sql_identifier</type> 1169 </para> 1170 <para> 1171 Name of the table 1172 </para></entry> 1173 </row> 1174 1175 <row> 1176 <entry role="catalog_table_entry"><para role="column_definition"> 1177 <structfield>column_name</structfield> <type>sql_identifier</type> 1178 </para> 1179 <para> 1180 Name of the base column that a generated column depends on 1181 </para></entry> 1182 </row> 1183 1184 <row> 1185 <entry role="catalog_table_entry"><para role="column_definition"> 1186 <structfield>dependent_column</structfield> <type>sql_identifier</type> 1187 </para> 1188 <para> 1189 Name of the generated column 1190 </para></entry> 1191 </row> 1192 </tbody> 1193 </tgroup> 1194 </table> 1195 </sect1> 1196 1197 <sect1 id="infoschema-column-domain-usage"> 1198 <title><literal>column_domain_usage</literal></title> 1199 1200 <para> 1201 The view <literal>column_domain_usage</literal> identifies all 1202 columns (of a table or a view) that make use of some domain defined 1203 in the current database and owned by a currently enabled role. 1204 </para> 1205 1206 <table> 1207 <title><structname>column_domain_usage</structname> Columns</title> 1208 <tgroup cols="1"> 1209 <thead> 1210 <row> 1211 <entry role="catalog_table_entry"><para role="column_definition"> 1212 Column Type 1213 </para> 1214 <para> 1215 Description 1216 </para></entry> 1217 </row> 1218 </thead> 1219 1220 <tbody> 1221 <row> 1222 <entry role="catalog_table_entry"><para role="column_definition"> 1223 <structfield>domain_catalog</structfield> <type>sql_identifier</type> 1224 </para> 1225 <para> 1226 Name of the database containing the domain (always the current database) 1227 </para></entry> 1228 </row> 1229 1230 <row> 1231 <entry role="catalog_table_entry"><para role="column_definition"> 1232 <structfield>domain_schema</structfield> <type>sql_identifier</type> 1233 </para> 1234 <para> 1235 Name of the schema containing the domain 1236 </para></entry> 1237 </row> 1238 1239 <row> 1240 <entry role="catalog_table_entry"><para role="column_definition"> 1241 <structfield>domain_name</structfield> <type>sql_identifier</type> 1242 </para> 1243 <para> 1244 Name of the domain 1245 </para></entry> 1246 </row> 1247 1248 <row> 1249 <entry role="catalog_table_entry"><para role="column_definition"> 1250 <structfield>table_catalog</structfield> <type>sql_identifier</type> 1251 </para> 1252 <para> 1253 Name of the database containing the table (always the current database) 1254 </para></entry> 1255 </row> 1256 1257 <row> 1258 <entry role="catalog_table_entry"><para role="column_definition"> 1259 <structfield>table_schema</structfield> <type>sql_identifier</type> 1260 </para> 1261 <para> 1262 Name of the schema containing the table 1263 </para></entry> 1264 </row> 1265 1266 <row> 1267 <entry role="catalog_table_entry"><para role="column_definition"> 1268 <structfield>table_name</structfield> <type>sql_identifier</type> 1269 </para> 1270 <para> 1271 Name of the table 1272 </para></entry> 1273 </row> 1274 1275 <row> 1276 <entry role="catalog_table_entry"><para role="column_definition"> 1277 <structfield>column_name</structfield> <type>sql_identifier</type> 1278 </para> 1279 <para> 1280 Name of the column 1281 </para></entry> 1282 </row> 1283 </tbody> 1284 </tgroup> 1285 </table> 1286 </sect1> 1287 1288 <sect1 id="infoschema-column-options"> 1289 <title><literal>column_options</literal></title> 1290 1291 <para> 1292 The view <literal>column_options</literal> contains all the 1293 options defined for foreign table columns in the current database. Only 1294 those foreign table columns are shown that the current user has access to 1295 (by way of being the owner or having some privilege). 1296 </para> 1297 1298 <table> 1299 <title><structname>column_options</structname> Columns</title> 1300 <tgroup cols="1"> 1301 <thead> 1302 <row> 1303 <entry role="catalog_table_entry"><para role="column_definition"> 1304 Column Type 1305 </para> 1306 <para> 1307 Description 1308 </para></entry> 1309 </row> 1310 </thead> 1311 1312 <tbody> 1313 <row> 1314 <entry role="catalog_table_entry"><para role="column_definition"> 1315 <structfield>table_catalog</structfield> <type>sql_identifier</type> 1316 </para> 1317 <para> 1318 Name of the database that contains the foreign table (always the current database) 1319 </para></entry> 1320 </row> 1321 1322 <row> 1323 <entry role="catalog_table_entry"><para role="column_definition"> 1324 <structfield>table_schema</structfield> <type>sql_identifier</type> 1325 </para> 1326 <para> 1327 Name of the schema that contains the foreign table 1328 </para></entry> 1329 </row> 1330 1331 <row> 1332 <entry role="catalog_table_entry"><para role="column_definition"> 1333 <structfield>table_name</structfield> <type>sql_identifier</type> 1334 </para> 1335 <para> 1336 Name of the foreign table 1337 </para></entry> 1338 </row> 1339 1340 <row> 1341 <entry role="catalog_table_entry"><para role="column_definition"> 1342 <structfield>column_name</structfield> <type>sql_identifier</type> 1343 </para> 1344 <para> 1345 Name of the column 1346 </para></entry> 1347 </row> 1348 1349 <row> 1350 <entry role="catalog_table_entry"><para role="column_definition"> 1351 <structfield>option_name</structfield> <type>sql_identifier</type> 1352 </para> 1353 <para> 1354 Name of an option 1355 </para></entry> 1356 </row> 1357 1358 <row> 1359 <entry role="catalog_table_entry"><para role="column_definition"> 1360 <structfield>option_value</structfield> <type>character_data</type> 1361 </para> 1362 <para> 1363 Value of the option 1364 </para></entry> 1365 </row> 1366 </tbody> 1367 </tgroup> 1368 </table> 1369 </sect1> 1370 1371 <sect1 id="infoschema-column-privileges"> 1372 <title><literal>column_privileges</literal></title> 1373 1374 <para> 1375 The view <literal>column_privileges</literal> identifies all 1376 privileges granted on columns to a currently enabled role or by a 1377 currently enabled role. There is one row for each combination of 1378 column, grantor, and grantee. 1379 </para> 1380 1381 <para> 1382 If a privilege has been granted on an entire table, it will show up in 1383 this view as a grant for each column, but only for the 1384 privilege types where column granularity is possible: 1385 <literal>SELECT</literal>, <literal>INSERT</literal>, 1386 <literal>UPDATE</literal>, <literal>REFERENCES</literal>. 1387 </para> 1388 1389 <table> 1390 <title><structname>column_privileges</structname> Columns</title> 1391 <tgroup cols="1"> 1392 <thead> 1393 <row> 1394 <entry role="catalog_table_entry"><para role="column_definition"> 1395 Column Type 1396 </para> 1397 <para> 1398 Description 1399 </para></entry> 1400 </row> 1401 </thead> 1402 1403 <tbody> 1404 <row> 1405 <entry role="catalog_table_entry"><para role="column_definition"> 1406 <structfield>grantor</structfield> <type>sql_identifier</type> 1407 </para> 1408 <para> 1409 Name of the role that granted the privilege 1410 </para></entry> 1411 </row> 1412 1413 <row> 1414 <entry role="catalog_table_entry"><para role="column_definition"> 1415 <structfield>grantee</structfield> <type>sql_identifier</type> 1416 </para> 1417 <para> 1418 Name of the role that the privilege was granted to 1419 </para></entry> 1420 </row> 1421 1422 <row> 1423 <entry role="catalog_table_entry"><para role="column_definition"> 1424 <structfield>table_catalog</structfield> <type>sql_identifier</type> 1425 </para> 1426 <para> 1427 Name of the database that contains the table that contains the column (always the current database) 1428 </para></entry> 1429 </row> 1430 1431 <row> 1432 <entry role="catalog_table_entry"><para role="column_definition"> 1433 <structfield>table_schema</structfield> <type>sql_identifier</type> 1434 </para> 1435 <para> 1436 Name of the schema that contains the table that contains the column 1437 </para></entry> 1438 </row> 1439 1440 <row> 1441 <entry role="catalog_table_entry"><para role="column_definition"> 1442 <structfield>table_name</structfield> <type>sql_identifier</type> 1443 </para> 1444 <para> 1445 Name of the table that contains the column 1446 </para></entry> 1447 </row> 1448 1449 <row> 1450 <entry role="catalog_table_entry"><para role="column_definition"> 1451 <structfield>column_name</structfield> <type>sql_identifier</type> 1452 </para> 1453 <para> 1454 Name of the column 1455 </para></entry> 1456 </row> 1457 1458 <row> 1459 <entry role="catalog_table_entry"><para role="column_definition"> 1460 <structfield>privilege_type</structfield> <type>character_data</type> 1461 </para> 1462 <para> 1463 Type of the privilege: <literal>SELECT</literal>, 1464 <literal>INSERT</literal>, <literal>UPDATE</literal>, or 1465 <literal>REFERENCES</literal> 1466 </para></entry> 1467 </row> 1468 1469 <row> 1470 <entry role="catalog_table_entry"><para role="column_definition"> 1471 <structfield>is_grantable</structfield> <type>yes_or_no</type> 1472 </para> 1473 <para> 1474 <literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not 1475 </para></entry> 1476 </row> 1477 </tbody> 1478 </tgroup> 1479 </table> 1480 </sect1> 1481 1482 <sect1 id="infoschema-column-udt-usage"> 1483 <title><literal>column_udt_usage</literal></title> 1484 1485 <para> 1486 The view <literal>column_udt_usage</literal> identifies all columns 1487 that use data types owned by a currently enabled role. Note that in 1488 <productname>PostgreSQL</productname>, built-in data types behave 1489 like user-defined types, so they are included here as well. See 1490 also <xref linkend="infoschema-columns"/> for details. 1491 </para> 1492 1493 <table> 1494 <title><structname>column_udt_usage</structname> Columns</title> 1495 <tgroup cols="1"> 1496 <thead> 1497 <row> 1498 <entry role="catalog_table_entry"><para role="column_definition"> 1499 Column Type 1500 </para> 1501 <para> 1502 Description 1503 </para></entry> 1504 </row> 1505 </thead> 1506 1507 <tbody> 1508 <row> 1509 <entry role="catalog_table_entry"><para role="column_definition"> 1510 <structfield>udt_catalog</structfield> <type>sql_identifier</type> 1511 </para> 1512 <para> 1513 Name of the database that the column data type (the underlying 1514 type of the domain, if applicable) is defined in (always the 1515 current database) 1516 </para></entry> 1517 </row> 1518 1519 <row> 1520 <entry role="catalog_table_entry"><para role="column_definition"> 1521 <structfield>udt_schema</structfield> <type>sql_identifier</type> 1522 </para> 1523 <para> 1524 Name of the schema that the column data type (the underlying 1525 type of the domain, if applicable) is defined in 1526 </para></entry> 1527 </row> 1528 1529 <row> 1530 <entry role="catalog_table_entry"><para role="column_definition"> 1531 <structfield>udt_name</structfield> <type>sql_identifier</type> 1532 </para> 1533 <para> 1534 Name of the column data type (the underlying type of the 1535 domain, if applicable) 1536 </para></entry> 1537 </row> 1538 1539 <row> 1540 <entry role="catalog_table_entry"><para role="column_definition"> 1541 <structfield>table_catalog</structfield> <type>sql_identifier</type> 1542 </para> 1543 <para> 1544 Name of the database containing the table (always the current database) 1545 </para></entry> 1546 </row> 1547 1548 <row> 1549 <entry role="catalog_table_entry"><para role="column_definition"> 1550 <structfield>table_schema</structfield> <type>sql_identifier</type> 1551 </para> 1552 <para> 1553 Name of the schema containing the table 1554 </para></entry> 1555 </row> 1556 1557 <row> 1558 <entry role="catalog_table_entry"><para role="column_definition"> 1559 <structfield>table_name</structfield> <type>sql_identifier</type> 1560 </para> 1561 <para> 1562 Name of the table 1563 </para></entry> 1564 </row> 1565 1566 <row> 1567 <entry role="catalog_table_entry"><para role="column_definition"> 1568 <structfield>column_name</structfield> <type>sql_identifier</type> 1569 </para> 1570 <para> 1571 Name of the column 1572 </para></entry> 1573 </row> 1574 </tbody> 1575 </tgroup> 1576 </table> 1577 </sect1> 1578 1579 <sect1 id="infoschema-columns"> 1580 <title><literal>columns</literal></title> 1581 1582 <para> 1583 The view <literal>columns</literal> contains information about all 1584 table columns (or view columns) in the database. System columns 1585 (<literal>ctid</literal>, etc.) are not included. Only those columns are 1586 shown that the current user has access to (by way of being the 1587 owner or having some privilege). 1588 </para> 1589 1590 <table> 1591 <title><structname>columns</structname> Columns</title> 1592 <tgroup cols="1"> 1593 <thead> 1594 <row> 1595 <entry role="catalog_table_entry"><para role="column_definition"> 1596 Column Type 1597 </para> 1598 <para> 1599 Description 1600 </para></entry> 1601 </row> 1602 </thead> 1603 1604 <tbody> 1605 <row> 1606 <entry role="catalog_table_entry"><para role="column_definition"> 1607 <structfield>table_catalog</structfield> <type>sql_identifier</type> 1608 </para> 1609 <para> 1610 Name of the database containing the table (always the current database) 1611 </para></entry> 1612 </row> 1613 1614 <row> 1615 <entry role="catalog_table_entry"><para role="column_definition"> 1616 <structfield>table_schema</structfield> <type>sql_identifier</type> 1617 </para> 1618 <para> 1619 Name of the schema containing the table 1620 </para></entry> 1621 </row> 1622 1623 <row> 1624 <entry role="catalog_table_entry"><para role="column_definition"> 1625 <structfield>table_name</structfield> <type>sql_identifier</type> 1626 </para> 1627 <para> 1628 Name of the table 1629 </para></entry> 1630 </row> 1631 1632 <row> 1633 <entry role="catalog_table_entry"><para role="column_definition"> 1634 <structfield>column_name</structfield> <type>sql_identifier</type> 1635 </para> 1636 <para> 1637 Name of the column 1638 </para></entry> 1639 </row> 1640 1641 <row> 1642 <entry role="catalog_table_entry"><para role="column_definition"> 1643 <structfield>ordinal_position</structfield> <type>cardinal_number</type> 1644 </para> 1645 <para> 1646 Ordinal position of the column within the table (count starts at 1) 1647 </para></entry> 1648 </row> 1649 1650 <row> 1651 <entry role="catalog_table_entry"><para role="column_definition"> 1652 <structfield>column_default</structfield> <type>character_data</type> 1653 </para> 1654 <para> 1655 Default expression of the column 1656 </para></entry> 1657 </row> 1658 1659 <row> 1660 <entry role="catalog_table_entry"><para role="column_definition"> 1661 <structfield>is_nullable</structfield> <type>yes_or_no</type> 1662 </para> 1663 <para> 1664 <literal>YES</literal> if the column is possibly nullable, 1665 <literal>NO</literal> if it is known not nullable. A not-null 1666 constraint is one way a column can be known not nullable, but 1667 there can be others. 1668 </para></entry> 1669 </row> 1670 1671 <row> 1672 <entry role="catalog_table_entry"><para role="column_definition"> 1673 <structfield>data_type</structfield> <type>character_data</type> 1674 </para> 1675 <para> 1676 Data type of the column, if it is a built-in type, or 1677 <literal>ARRAY</literal> if it is some array (in that case, see 1678 the view <literal>element_types</literal>), else 1679 <literal>USER-DEFINED</literal> (in that case, the type is 1680 identified in <literal>udt_name</literal> and associated 1681 columns). If the column is based on a domain, this column 1682 refers to the type underlying the domain (and the domain is 1683 identified in <literal>domain_name</literal> and associated 1684 columns). 1685 </para></entry> 1686 </row> 1687 1688 <row> 1689 <entry role="catalog_table_entry"><para role="column_definition"> 1690 <structfield>character_maximum_length</structfield> <type>cardinal_number</type> 1691 </para> 1692 <para> 1693 If <literal>data_type</literal> identifies a character or bit 1694 string type, the declared maximum length; null for all other 1695 data types or if no maximum length was declared. 1696 </para></entry> 1697 </row> 1698 1699 <row> 1700 <entry role="catalog_table_entry"><para role="column_definition"> 1701 <structfield>character_octet_length</structfield> <type>cardinal_number</type> 1702 </para> 1703 <para> 1704 If <literal>data_type</literal> identifies a character type, 1705 the maximum possible length in octets (bytes) of a datum; null 1706 for all other data types. The maximum octet length depends on 1707 the declared character maximum length (see above) and the 1708 server encoding. 1709 </para></entry> 1710 </row> 1711 1712 <row> 1713 <entry role="catalog_table_entry"><para role="column_definition"> 1714 <structfield>numeric_precision</structfield> <type>cardinal_number</type> 1715 </para> 1716 <para> 1717 If <literal>data_type</literal> identifies a numeric type, this 1718 column contains the (declared or implicit) precision of the 1719 type for this column. The precision indicates the number of 1720 significant digits. It can be expressed in decimal (base 10) 1721 or binary (base 2) terms, as specified in the column 1722 <literal>numeric_precision_radix</literal>. For all other data 1723 types, this column is null. 1724 </para></entry> 1725 </row> 1726 1727 <row> 1728 <entry role="catalog_table_entry"><para role="column_definition"> 1729 <structfield>numeric_precision_radix</structfield> <type>cardinal_number</type> 1730 </para> 1731 <para> 1732 If <literal>data_type</literal> identifies a numeric type, this 1733 column indicates in which base the values in the columns 1734 <literal>numeric_precision</literal> and 1735 <literal>numeric_scale</literal> are expressed. The value is 1736 either 2 or 10. For all other data types, this column is null. 1737 </para></entry> 1738 </row> 1739 1740 <row> 1741 <entry role="catalog_table_entry"><para role="column_definition"> 1742 <structfield>numeric_scale</structfield> <type>cardinal_number</type> 1743 </para> 1744 <para> 1745 If <literal>data_type</literal> identifies an exact numeric 1746 type, this column contains the (declared or implicit) scale of 1747 the type for this column. The scale indicates the number of 1748 significant digits to the right of the decimal point. It can 1749 be expressed in decimal (base 10) or binary (base 2) terms, as 1750 specified in the column 1751 <literal>numeric_precision_radix</literal>. For all other data 1752 types, this column is null. 1753 </para></entry> 1754 </row> 1755 1756 <row> 1757 <entry role="catalog_table_entry"><para role="column_definition"> 1758 <structfield>datetime_precision</structfield> <type>cardinal_number</type> 1759 </para> 1760 <para> 1761 If <literal>data_type</literal> identifies a date, time, 1762 timestamp, or interval type, this column contains the (declared 1763 or implicit) fractional seconds precision of the type for this 1764 column, that is, the number of decimal digits maintained 1765 following the decimal point in the seconds value. For all 1766 other data types, this column is null. 1767 </para></entry> 1768 </row> 1769 1770 <row> 1771 <entry role="catalog_table_entry"><para role="column_definition"> 1772 <structfield>interval_type</structfield> <type>character_data</type> 1773 </para> 1774 <para> 1775 If <literal>data_type</literal> identifies an interval type, 1776 this column contains the specification which fields the 1777 intervals include for this column, e.g., <literal>YEAR TO 1778 MONTH</literal>, <literal>DAY TO SECOND</literal>, etc. If no 1779 field restrictions were specified (that is, the interval 1780 accepts all fields), and for all other data types, this field 1781 is null. 1782 </para></entry> 1783 </row> 1784 1785 <row> 1786 <entry role="catalog_table_entry"><para role="column_definition"> 1787 <structfield>interval_precision</structfield> <type>cardinal_number</type> 1788 </para> 1789 <para> 1790 Applies to a feature not available 1791 in <productname>PostgreSQL</productname> 1792 (see <literal>datetime_precision</literal> for the fractional 1793 seconds precision of interval type columns) 1794 </para></entry> 1795 </row> 1796 1797 <row> 1798 <entry role="catalog_table_entry"><para role="column_definition"> 1799 <structfield>character_set_catalog</structfield> <type>sql_identifier</type> 1800 </para> 1801 <para> 1802 Applies to a feature not available in <productname>PostgreSQL</productname> 1803 </para></entry> 1804 </row> 1805 1806 <row> 1807 <entry role="catalog_table_entry"><para role="column_definition"> 1808 <structfield>character_set_schema</structfield> <type>sql_identifier</type> 1809 </para> 1810 <para> 1811 Applies to a feature not available in <productname>PostgreSQL</productname> 1812 </para></entry> 1813 </row> 1814 1815 <row> 1816 <entry role="catalog_table_entry"><para role="column_definition"> 1817 <structfield>character_set_name</structfield> <type>sql_identifier</type> 1818 </para> 1819 <para> 1820 Applies to a feature not available in <productname>PostgreSQL</productname> 1821 </para></entry> 1822 </row> 1823 1824 <row> 1825 <entry role="catalog_table_entry"><para role="column_definition"> 1826 <structfield>collation_catalog</structfield> <type>sql_identifier</type> 1827 </para> 1828 <para> 1829 Name of the database containing the collation of the column 1830 (always the current database), null if default or the data type 1831 of the column is not collatable 1832 </para></entry> 1833 </row> 1834 1835 <row> 1836 <entry role="catalog_table_entry"><para role="column_definition"> 1837 <structfield>collation_schema</structfield> <type>sql_identifier</type> 1838 </para> 1839 <para> 1840 Name of the schema containing the collation of the column, null 1841 if default or the data type of the column is not collatable 1842 </para></entry> 1843 </row> 1844 1845 <row> 1846 <entry role="catalog_table_entry"><para role="column_definition"> 1847 <structfield>collation_name</structfield> <type>sql_identifier</type> 1848 </para> 1849 <para> 1850 Name of the collation of the column, null if default or the 1851 data type of the column is not collatable 1852 </para></entry> 1853 </row> 1854 1855 <row> 1856 <entry role="catalog_table_entry"><para role="column_definition"> 1857 <structfield>domain_catalog</structfield> <type>sql_identifier</type> 1858 </para> 1859 <para> 1860 If the column has a domain type, the name of the database that 1861 the domain is defined in (always the current database), else 1862 null. 1863 </para></entry> 1864 </row> 1865 1866 <row> 1867 <entry role="catalog_table_entry"><para role="column_definition"> 1868 <structfield>domain_schema</structfield> <type>sql_identifier</type> 1869 </para> 1870 <para> 1871 If the column has a domain type, the name of the schema that 1872 the domain is defined in, else null. 1873 </para></entry> 1874 </row> 1875 1876 <row> 1877 <entry role="catalog_table_entry"><para role="column_definition"> 1878 <structfield>domain_name</structfield> <type>sql_identifier</type> 1879 </para> 1880 <para> 1881 If the column has a domain type, the name of the domain, else null. 1882 </para></entry> 1883 </row> 1884 1885 <row> 1886 <entry role="catalog_table_entry"><para role="column_definition"> 1887 <structfield>udt_catalog</structfield> <type>sql_identifier</type> 1888 </para> 1889 <para> 1890 Name of the database that the column data type (the underlying 1891 type of the domain, if applicable) is defined in (always the 1892 current database) 1893 </para></entry> 1894 </row> 1895 1896 <row> 1897 <entry role="catalog_table_entry"><para role="column_definition"> 1898 <structfield>udt_schema</structfield> <type>sql_identifier</type> 1899 </para> 1900 <para> 1901 Name of the schema that the column data type (the underlying 1902 type of the domain, if applicable) is defined in 1903 </para></entry> 1904 </row> 1905 1906 <row> 1907 <entry role="catalog_table_entry"><para role="column_definition"> 1908 <structfield>udt_name</structfield> <type>sql_identifier</type> 1909 </para> 1910 <para> 1911 Name of the column data type (the underlying type of the 1912 domain, if applicable) 1913 </para></entry> 1914 </row> 1915 1916 <row> 1917 <entry role="catalog_table_entry"><para role="column_definition"> 1918 <structfield>scope_catalog</structfield> <type>sql_identifier</type> 1919 </para> 1920 <para> 1921 Applies to a feature not available in <productname>PostgreSQL</productname> 1922 </para></entry> 1923 </row> 1924 1925 <row> 1926 <entry role="catalog_table_entry"><para role="column_definition"> 1927 <structfield>scope_schema</structfield> <type>sql_identifier</type> 1928 </para> 1929 <para> 1930 Applies to a feature not available in <productname>PostgreSQL</productname> 1931 </para></entry> 1932 </row> 1933 1934 <row> 1935 <entry role="catalog_table_entry"><para role="column_definition"> 1936 <structfield>scope_name</structfield> <type>sql_identifier</type> 1937 </para> 1938 <para> 1939 Applies to a feature not available in <productname>PostgreSQL</productname> 1940 </para></entry> 1941 </row> 1942 1943 <row> 1944 <entry role="catalog_table_entry"><para role="column_definition"> 1945 <structfield>maximum_cardinality</structfield> <type>cardinal_number</type> 1946 </para> 1947 <para> 1948 Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname> 1949 </para></entry> 1950 </row> 1951 1952 <row> 1953 <entry role="catalog_table_entry"><para role="column_definition"> 1954 <structfield>dtd_identifier</structfield> <type>sql_identifier</type> 1955 </para> 1956 <para> 1957 An identifier of the data type descriptor of the column, unique 1958 among the data type descriptors pertaining to the table. This 1959 is mainly useful for joining with other instances of such 1960 identifiers. (The specific format of the identifier is not 1961 defined and not guaranteed to remain the same in future 1962 versions.) 1963 </para></entry> 1964 </row> 1965 1966 <row> 1967 <entry role="catalog_table_entry"><para role="column_definition"> 1968 <structfield>is_self_referencing</structfield> <type>yes_or_no</type> 1969 </para> 1970 <para> 1971 Applies to a feature not available in <productname>PostgreSQL</productname> 1972 </para></entry> 1973 </row> 1974 1975 <row> 1976 <entry role="catalog_table_entry"><para role="column_definition"> 1977 <structfield>is_identity</structfield> <type>yes_or_no</type> 1978 </para> 1979 <para> 1980 If the column is an identity column, then <literal>YES</literal>, 1981 else <literal>NO</literal>. 1982 </para></entry> 1983 </row> 1984 1985 <row> 1986 <entry role="catalog_table_entry"><para role="column_definition"> 1987 <structfield>identity_generation</structfield> <type>character_data</type> 1988 </para> 1989 <para> 1990 If the column is an identity column, then <literal>ALWAYS</literal> 1991 or <literal>BY DEFAULT</literal>, reflecting the definition of the 1992 column. 1993 </para></entry> 1994 </row> 1995 1996 <row> 1997 <entry role="catalog_table_entry"><para role="column_definition"> 1998 <structfield>identity_start</structfield> <type>character_data</type> 1999 </para> 2000 <para> 2001 If the column is an identity column, then the start value of the 2002 internal sequence, else null. 2003 </para></entry> 2004 </row> 2005 2006 <row> 2007 <entry role="catalog_table_entry"><para role="column_definition"> 2008 <structfield>identity_increment</structfield> <type>character_data</type> 2009 </para> 2010 <para> 2011 If the column is an identity column, then the increment of the internal 2012 sequence, else null. 2013 </para></entry> 2014 </row> 2015 2016 <row> 2017 <entry role="catalog_table_entry"><para role="column_definition"> 2018 <structfield>identity_maximum</structfield> <type>character_data</type> 2019 </para> 2020 <para> 2021 If the column is an identity column, then the maximum value of the 2022 internal sequence, else null. 2023 </para></entry> 2024 </row> 2025 2026 <row> 2027 <entry role="catalog_table_entry"><para role="column_definition"> 2028 <structfield>identity_minimum</structfield> <type>character_data</type> 2029 </para> 2030 <para> 2031 If the column is an identity column, then the minimum value of the 2032 internal sequence, else null. 2033 </para></entry> 2034 </row> 2035 2036 <row> 2037 <entry role="catalog_table_entry"><para role="column_definition"> 2038 <structfield>identity_cycle</structfield> <type>yes_or_no</type> 2039 </para> 2040 <para> 2041 If the column is an identity column, then <literal>YES</literal> if the 2042 internal sequence cycles or <literal>NO</literal> if it does not; 2043 otherwise null. 2044 </para></entry> 2045 </row> 2046 2047 <row> 2048 <entry role="catalog_table_entry"><para role="column_definition"> 2049 <structfield>is_generated</structfield> <type>character_data</type> 2050 </para> 2051 <para> 2052 If the column is a generated column, then <literal>ALWAYS</literal>, 2053 else <literal>NEVER</literal>. 2054 </para></entry> 2055 </row> 2056 2057 <row> 2058 <entry role="catalog_table_entry"><para role="column_definition"> 2059 <structfield>generation_expression</structfield> <type>character_data</type> 2060 </para> 2061 <para> 2062 If the column is a generated column, then the generation expression, 2063 else null. 2064 </para></entry> 2065 </row> 2066 2067 <row> 2068 <entry role="catalog_table_entry"><para role="column_definition"> 2069 <structfield>is_updatable</structfield> <type>yes_or_no</type> 2070 </para> 2071 <para> 2072 <literal>YES</literal> if the column is updatable, 2073 <literal>NO</literal> if not (Columns in base tables are always 2074 updatable, columns in views not necessarily) 2075 </para></entry> 2076 </row> 2077 </tbody> 2078 </tgroup> 2079 </table> 2080 2081 <para> 2082 Since data types can be defined in a variety of ways in SQL, and 2083 <productname>PostgreSQL</productname> contains additional ways to 2084 define data types, their representation in the information schema 2085 can be somewhat difficult. The column <literal>data_type</literal> 2086 is supposed to identify the underlying built-in type of the column. 2087 In <productname>PostgreSQL</productname>, this means that the type 2088 is defined in the system catalog schema 2089 <literal>pg_catalog</literal>. This column might be useful if the 2090 application can handle the well-known built-in types specially (for 2091 example, format the numeric types differently or use the data in 2092 the precision columns). The columns <literal>udt_name</literal>, 2093 <literal>udt_schema</literal>, and <literal>udt_catalog</literal> 2094 always identify the underlying data type of the column, even if the 2095 column is based on a domain. (Since 2096 <productname>PostgreSQL</productname> treats built-in types like 2097 user-defined types, built-in types appear here as well. This is an 2098 extension of the SQL standard.) These columns should be used if an 2099 application wants to process data differently according to the 2100 type, because in that case it wouldn't matter if the column is 2101 really based on a domain. If the column is based on a domain, the 2102 identity of the domain is stored in the columns 2103 <literal>domain_name</literal>, <literal>domain_schema</literal>, 2104 and <literal>domain_catalog</literal>. If you want to pair up 2105 columns with their associated data types and treat domains as 2106 separate types, you could write <literal>coalesce(domain_name, 2107 udt_name)</literal>, etc. 2108 </para> 2109 </sect1> 2110 2111 <sect1 id="infoschema-constraint-column-usage"> 2112 <title><literal>constraint_column_usage</literal></title> 2113 2114 <para> 2115 The view <literal>constraint_column_usage</literal> identifies all 2116 columns in the current database that are used by some constraint. 2117 Only those columns are shown that are contained in a table owned by 2118 a currently enabled role. For a check constraint, this view 2119 identifies the columns that are used in the check expression. For 2120 a foreign key constraint, this view identifies the columns that the 2121 foreign key references. For a unique or primary key constraint, 2122 this view identifies the constrained columns. 2123 </para> 2124 2125 <table> 2126 <title><structname>constraint_column_usage</structname> Columns</title> 2127 <tgroup cols="1"> 2128 <thead> 2129 <row> 2130 <entry role="catalog_table_entry"><para role="column_definition"> 2131 Column Type 2132 </para> 2133 <para> 2134 Description 2135 </para></entry> 2136 </row> 2137 </thead> 2138 2139 <tbody> 2140 <row> 2141 <entry role="catalog_table_entry"><para role="column_definition"> 2142 <structfield>table_catalog</structfield> <type>sql_identifier</type> 2143 </para> 2144 <para> 2145 Name of the database that contains the table that contains the 2146 column that is used by some constraint (always the current 2147 database) 2148 </para></entry> 2149 </row> 2150 2151 <row> 2152 <entry role="catalog_table_entry"><para role="column_definition"> 2153 <structfield>table_schema</structfield> <type>sql_identifier</type> 2154 </para> 2155 <para> 2156 Name of the schema that contains the table that contains the 2157 column that is used by some constraint 2158 </para></entry> 2159 </row> 2160 2161 <row> 2162 <entry role="catalog_table_entry"><para role="column_definition"> 2163 <structfield>table_name</structfield> <type>sql_identifier</type> 2164 </para> 2165 <para> 2166 Name of the table that contains the column that is used by some 2167 constraint 2168 </para></entry> 2169 </row> 2170 2171 <row> 2172 <entry role="catalog_table_entry"><para role="column_definition"> 2173 <structfield>column_name</structfield> <type>sql_identifier</type> 2174 </para> 2175 <para> 2176 Name of the column that is used by some constraint 2177 </para></entry> 2178 </row> 2179 2180 <row> 2181 <entry role="catalog_table_entry"><para role="column_definition"> 2182 <structfield>constraint_catalog</structfield> <type>sql_identifier</type> 2183 </para> 2184 <para> 2185 Name of the database that contains the constraint (always the current database) 2186 </para></entry> 2187 </row> 2188 2189 <row> 2190 <entry role="catalog_table_entry"><para role="column_definition"> 2191 <structfield>constraint_schema</structfield> <type>sql_identifier</type> 2192 </para> 2193 <para> 2194 Name of the schema that contains the constraint 2195 </para></entry> 2196 </row> 2197 2198 <row> 2199 <entry role="catalog_table_entry"><para role="column_definition"> 2200 <structfield>constraint_name</structfield> <type>sql_identifier</type> 2201 </para> 2202 <para> 2203 Name of the constraint 2204 </para></entry> 2205 </row> 2206 </tbody> 2207 </tgroup> 2208 </table> 2209 </sect1> 2210 2211 <sect1 id="infoschema-constraint-table-usage"> 2212 <title><literal>constraint_table_usage</literal></title> 2213 2214 <para> 2215 The view <literal>constraint_table_usage</literal> identifies all 2216 tables in the current database that are used by some constraint and 2217 are owned by a currently enabled role. (This is different from the 2218 view <literal>table_constraints</literal>, which identifies all 2219 table constraints along with the table they are defined on.) For a 2220 foreign key constraint, this view identifies the table that the 2221 foreign key references. For a unique or primary key constraint, 2222 this view simply identifies the table the constraint belongs to. 2223 Check constraints and not-null constraints are not included in this 2224 view. 2225 </para> 2226 2227 <table> 2228 <title><structname>constraint_table_usage</structname> Columns</title> 2229 <tgroup cols="1"> 2230 <thead> 2231 <row> 2232 <entry role="catalog_table_entry"><para role="column_definition"> 2233 Column Type 2234 </para> 2235 <para> 2236 Description 2237 </para></entry> 2238 </row> 2239 </thead> 2240 2241 <tbody> 2242 <row> 2243 <entry role="catalog_table_entry"><para role="column_definition"> 2244 <structfield>table_catalog</structfield> <type>sql_identifier</type> 2245 </para> 2246 <para> 2247 Name of the database that contains the table that is used by 2248 some constraint (always the current database) 2249 </para></entry> 2250 </row> 2251 2252 <row> 2253 <entry role="catalog_table_entry"><para role="column_definition"> 2254 <structfield>table_schema</structfield> <type>sql_identifier</type> 2255 </para> 2256 <para> 2257 Name of the schema that contains the table that is used by some 2258 constraint 2259 </para></entry> 2260 </row> 2261 2262 <row> 2263 <entry role="catalog_table_entry"><para role="column_definition"> 2264 <structfield>table_name</structfield> <type>sql_identifier</type> 2265 </para> 2266 <para> 2267 Name of the table that is used by some constraint 2268 </para></entry> 2269 </row> 2270 2271 <row> 2272 <entry role="catalog_table_entry"><para role="column_definition"> 2273 <structfield>constraint_catalog</structfield> <type>sql_identifier</type> 2274 </para> 2275 <para> 2276 Name of the database that contains the constraint (always the current database) 2277 </para></entry> 2278 </row> 2279 2280 <row> 2281 <entry role="catalog_table_entry"><para role="column_definition"> 2282 <structfield>constraint_schema</structfield> <type>sql_identifier</type> 2283 </para> 2284 <para> 2285 Name of the schema that contains the constraint 2286 </para></entry> 2287 </row> 2288 2289 <row> 2290 <entry role="catalog_table_entry"><para role="column_definition"> 2291 <structfield>constraint_name</structfield> <type>sql_identifier</type> 2292 </para> 2293 <para> 2294 Name of the constraint 2295 </para></entry> 2296 </row> 2297 </tbody> 2298 </tgroup> 2299 </table> 2300 </sect1> 2301 2302 <sect1 id="infoschema-data-type-privileges"> 2303 <title><literal>data_type_privileges</literal></title> 2304 2305 <para> 2306 The view <literal>data_type_privileges</literal> identifies all 2307 data type descriptors that the current user has access to, by way 2308 of being the owner of the described object or having some privilege 2309 for it. A data type descriptor is generated whenever a data type 2310 is used in the definition of a table column, a domain, or a 2311 function (as parameter or return type) and stores some information 2312 about how the data type is used in that instance (for example, the 2313 declared maximum length, if applicable). Each data type 2314 descriptor is assigned an arbitrary identifier that is unique 2315 among the data type descriptor identifiers assigned for one object 2316 (table, domain, function). This view is probably not useful for 2317 applications, but it is used to define some other views in the 2318 information schema. 2319 </para> 2320 2321 <table> 2322 <title><structname>data_type_privileges</structname> Columns</title> 2323 <tgroup cols="1"> 2324 <thead> 2325 <row> 2326 <entry role="catalog_table_entry"><para role="column_definition"> 2327 Column Type 2328 </para> 2329 <para> 2330 Description 2331 </para></entry> 2332 </row> 2333 </thead> 2334 2335 <tbody> 2336 <row> 2337 <entry role="catalog_table_entry"><para role="column_definition"> 2338 <structfield>object_catalog</structfield> <type>sql_identifier</type> 2339 </para> 2340 <para> 2341 Name of the database that contains the described object (always the current database) 2342 </para></entry> 2343 </row> 2344 2345 <row> 2346 <entry role="catalog_table_entry"><para role="column_definition"> 2347 <structfield>object_schema</structfield> <type>sql_identifier</type> 2348 </para> 2349 <para> 2350 Name of the schema that contains the described object 2351 </para></entry> 2352 </row> 2353 2354 <row> 2355 <entry role="catalog_table_entry"><para role="column_definition"> 2356 <structfield>object_name</structfield> <type>sql_identifier</type> 2357 </para> 2358 <para> 2359 Name of the described object 2360 </para></entry> 2361 </row> 2362 2363 <row> 2364 <entry role="catalog_table_entry"><para role="column_definition"> 2365 <structfield>object_type</structfield> <type>character_data</type> 2366 </para> 2367 <para> 2368 The type of the described object: one of 2369 <literal>TABLE</literal> (the data type descriptor pertains to 2370 a column of that table), <literal>DOMAIN</literal> (the data 2371 type descriptors pertains to that domain), 2372 <literal>ROUTINE</literal> (the data type descriptor pertains 2373 to a parameter or the return data type of that function). 2374 </para></entry> 2375 </row> 2376 2377 <row> 2378 <entry role="catalog_table_entry"><para role="column_definition"> 2379 <structfield>dtd_identifier</structfield> <type>sql_identifier</type> 2380 </para> 2381 <para> 2382 The identifier of the data type descriptor, which is unique 2383 among the data type descriptors for that same object. 2384 </para></entry> 2385 </row> 2386 </tbody> 2387 </tgroup> 2388 </table> 2389 </sect1> 2390 2391 <sect1 id="infoschema-domain-constraints"> 2392 <title><literal>domain_constraints</literal></title> 2393 2394 <para> 2395 The view <literal>domain_constraints</literal> contains all constraints 2396 belonging to domains defined in the current database. Only those domains 2397 are shown that the current user has access to (by way of being the owner or 2398 having some privilege). 2399 </para> 2400 2401 <table> 2402 <title><structname>domain_constraints</structname> Columns</title> 2403 <tgroup cols="1"> 2404 <thead> 2405 <row> 2406 <entry role="catalog_table_entry"><para role="column_definition"> 2407 Column Type 2408 </para> 2409 <para> 2410 Description 2411 </para></entry> 2412 </row> 2413 </thead> 2414 2415 <tbody> 2416 <row> 2417 <entry role="catalog_table_entry"><para role="column_definition"> 2418 <structfield>constraint_catalog</structfield> <type>sql_identifier</type> 2419 </para> 2420 <para> 2421 Name of the database that contains the constraint (always the current database) 2422 </para></entry> 2423 </row> 2424 2425 <row> 2426 <entry role="catalog_table_entry"><para role="column_definition"> 2427 <structfield>constraint_schema</structfield> <type>sql_identifier</type> 2428 </para> 2429 <para> 2430 Name of the schema that contains the constraint 2431 </para></entry> 2432 </row> 2433 2434 <row> 2435 <entry role="catalog_table_entry"><para role="column_definition"> 2436 <structfield>constraint_name</structfield> <type>sql_identifier</type> 2437 </para> 2438 <para> 2439 Name of the constraint 2440 </para></entry> 2441 </row> 2442 2443 <row> 2444 <entry role="catalog_table_entry"><para role="column_definition"> 2445 <structfield>domain_catalog</structfield> <type>sql_identifier</type> 2446 </para> 2447 <para> 2448 Name of the database that contains the domain (always the current database) 2449 </para></entry> 2450 </row> 2451 2452 <row> 2453 <entry role="catalog_table_entry"><para role="column_definition"> 2454 <structfield>domain_schema</structfield> <type>sql_identifier</type> 2455 </para> 2456 <para> 2457 Name of the schema that contains the domain 2458 </para></entry> 2459 </row> 2460 2461 <row> 2462 <entry role="catalog_table_entry"><para role="column_definition"> 2463 <structfield>domain_name</structfield> <type>sql_identifier</type> 2464 </para> 2465 <para> 2466 Name of the domain 2467 </para></entry> 2468 </row> 2469 2470 <row> 2471 <entry role="catalog_table_entry"><para role="column_definition"> 2472 <structfield>is_deferrable</structfield> <type>yes_or_no</type> 2473 </para> 2474 <para> 2475 <literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not 2476 </para></entry> 2477 </row> 2478 2479 <row> 2480 <entry role="catalog_table_entry"><para role="column_definition"> 2481 <structfield>initially_deferred</structfield> <type>yes_or_no</type> 2482 </para> 2483 <para> 2484 <literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not 2485 </para></entry> 2486 </row> 2487 </tbody> 2488 </tgroup> 2489 </table> 2490 </sect1> 2491 2492 <sect1 id="infoschema-domain-udt-usage"> 2493 <title><literal>domain_udt_usage</literal></title> 2494 2495 <para> 2496 The view <literal>domain_udt_usage</literal> identifies all domains 2497 that are based on data types owned by a currently enabled role. 2498 Note that in <productname>PostgreSQL</productname>, built-in data 2499 types behave like user-defined types, so they are included here as 2500 well. 2501 </para> 2502 2503 <table> 2504 <title><structname>domain_udt_usage</structname> Columns</title> 2505 <tgroup cols="1"> 2506 <thead> 2507 <row> 2508 <entry role="catalog_table_entry"><para role="column_definition"> 2509 Column Type 2510 </para> 2511 <para> 2512 Description 2513 </para></entry> 2514 </row> 2515 </thead> 2516 2517 <tbody> 2518 <row> 2519 <entry role="catalog_table_entry"><para role="column_definition"> 2520 <structfield>udt_catalog</structfield> <type>sql_identifier</type> 2521 </para> 2522 <para> 2523 Name of the database that the domain data type is defined in (always the current database) 2524 </para></entry> 2525 </row> 2526 2527 <row> 2528 <entry role="catalog_table_entry"><para role="column_definition"> 2529 <structfield>udt_schema</structfield> <type>sql_identifier</type> 2530 </para> 2531 <para> 2532 Name of the schema that the domain data type is defined in 2533 </para></entry> 2534 </row> 2535 2536 <row> 2537 <entry role="catalog_table_entry"><para role="column_definition"> 2538 <structfield>udt_name</structfield> <type>sql_identifier</type> 2539 </para> 2540 <para> 2541 Name of the domain data type 2542 </para></entry> 2543 </row> 2544 2545 <row> 2546 <entry role="catalog_table_entry"><para role="column_definition"> 2547 <structfield>domain_catalog</structfield> <type>sql_identifier</type> 2548 </para> 2549 <para> 2550 Name of the database that contains the domain (always the current database) 2551 </para></entry> 2552 </row> 2553 2554 <row> 2555 <entry role="catalog_table_entry"><para role="column_definition"> 2556 <structfield>domain_schema</structfield> <type>sql_identifier</type> 2557 </para> 2558 <para> 2559 Name of the schema that contains the domain 2560 </para></entry> 2561 </row> 2562 2563 <row> 2564 <entry role="catalog_table_entry"><para role="column_definition"> 2565 <structfield>domain_name</structfield> <type>sql_identifier</type> 2566 </para> 2567 <para> 2568 Name of the domain 2569 </para></entry> 2570 </row> 2571 </tbody> 2572 </tgroup> 2573 </table> 2574 </sect1> 2575 2576 <sect1 id="infoschema-domains"> 2577 <title><literal>domains</literal></title> 2578 2579 <para> 2580 The view <literal>domains</literal> contains all domains defined in the 2581 current database. Only those domains are shown that the current user has 2582 access to (by way of being the owner or having some privilege). 2583 </para> 2584 2585 <table> 2586 <title><structname>domains</structname> Columns</title> 2587 <tgroup cols="1"> 2588 <thead> 2589 <row> 2590 <entry role="catalog_table_entry"><para role="column_definition"> 2591 Column Type 2592 </para> 2593 <para> 2594 Description 2595 </para></entry> 2596 </row> 2597 </thead> 2598 2599 <tbody> 2600 <row> 2601 <entry role="catalog_table_entry"><para role="column_definition"> 2602 <structfield>domain_catalog</structfield> <type>sql_identifier</type> 2603 </para> 2604 <para> 2605 Name of the database that contains the domain (always the current database) 2606 </para></entry> 2607 </row> 2608 2609 <row> 2610 <entry role="catalog_table_entry"><para role="column_definition"> 2611 <structfield>domain_schema</structfield> <type>sql_identifier</type> 2612 </para> 2613 <para> 2614 Name of the schema that contains the domain 2615 </para></entry> 2616 </row> 2617 2618 <row> 2619 <entry role="catalog_table_entry"><para role="column_definition"> 2620 <structfield>domain_name</structfield> <type>sql_identifier</type> 2621 </para> 2622 <para> 2623 Name of the domain 2624 </para></entry> 2625 </row> 2626 2627 <row> 2628 <entry role="catalog_table_entry"><para role="column_definition"> 2629 <structfield>data_type</structfield> <type>character_data</type> 2630 </para> 2631 <para> 2632 Data type of the domain, if it is a built-in type, or 2633 <literal>ARRAY</literal> if it is some array (in that case, see 2634 the view <literal>element_types</literal>), else 2635 <literal>USER-DEFINED</literal> (in that case, the type is 2636 identified in <literal>udt_name</literal> and associated 2637 columns). 2638 </para></entry> 2639 </row> 2640 2641 <row> 2642 <entry role="catalog_table_entry"><para role="column_definition"> 2643 <structfield>character_maximum_length</structfield> <type>cardinal_number</type> 2644 </para> 2645 <para> 2646 If the domain has a character or bit string type, the declared 2647 maximum length; null for all other data types or if no maximum 2648 length was declared. 2649 </para></entry> 2650 </row> 2651 2652 <row> 2653 <entry role="catalog_table_entry"><para role="column_definition"> 2654 <structfield>character_octet_length</structfield> <type>cardinal_number</type> 2655 </para> 2656 <para> 2657 If the domain has a character type, the maximum possible length 2658 in octets (bytes) of a datum; null for all other data types. 2659 The maximum octet length depends on the declared character 2660 maximum length (see above) and the server encoding. 2661 </para></entry> 2662 </row> 2663 2664 <row> 2665 <entry role="catalog_table_entry"><para role="column_definition"> 2666 <structfield>character_set_catalog</structfield> <type>sql_identifier</type> 2667 </para> 2668 <para> 2669 Applies to a feature not available in <productname>PostgreSQL</productname> 2670 </para></entry> 2671 </row> 2672 2673 <row> 2674 <entry role="catalog_table_entry"><para role="column_definition"> 2675 <structfield>character_set_schema</structfield> <type>sql_identifier</type> 2676 </para> 2677 <para> 2678 Applies to a feature not available in <productname>PostgreSQL</productname> 2679 </para></entry> 2680 </row> 2681 2682 <row> 2683 <entry role="catalog_table_entry"><para role="column_definition"> 2684 <structfield>character_set_name</structfield> <type>sql_identifier</type> 2685 </para> 2686 <para> 2687 Applies to a feature not available in <productname>PostgreSQL</productname> 2688 </para></entry> 2689 </row> 2690 2691 <row> 2692 <entry role="catalog_table_entry"><para role="column_definition"> 2693 <structfield>collation_catalog</structfield> <type>sql_identifier</type> 2694 </para> 2695 <para> 2696 Name of the database containing the collation of the domain 2697 (always the current database), null if default or the data type 2698 of the domain is not collatable 2699 </para></entry> 2700 </row> 2701 2702 <row> 2703 <entry role="catalog_table_entry"><para role="column_definition"> 2704 <structfield>collation_schema</structfield> <type>sql_identifier</type> 2705 </para> 2706 <para> 2707 Name of the schema containing the collation of the domain, null 2708 if default or the data type of the domain is not collatable 2709 </para></entry> 2710 </row> 2711 2712 <row> 2713 <entry role="catalog_table_entry"><para role="column_definition"> 2714 <structfield>collation_name</structfield> <type>sql_identifier</type> 2715 </para> 2716 <para> 2717 Name of the collation of the domain, null if default or the 2718 data type of the domain is not collatable 2719 </para></entry> 2720 </row> 2721 2722 <row> 2723 <entry role="catalog_table_entry"><para role="column_definition"> 2724 <structfield>numeric_precision</structfield> <type>cardinal_number</type> 2725 </para> 2726 <para> 2727 If the domain has a numeric type, this column contains the 2728 (declared or implicit) precision of the type for this domain. 2729 The precision indicates the number of significant digits. It 2730 can be expressed in decimal (base 10) or binary (base 2) terms, 2731 as specified in the column 2732 <literal>numeric_precision_radix</literal>. For all other data 2733 types, this column is null. 2734 </para></entry> 2735 </row> 2736 2737 <row> 2738 <entry role="catalog_table_entry"><para role="column_definition"> 2739 <structfield>numeric_precision_radix</structfield> <type>cardinal_number</type> 2740 </para> 2741 <para> 2742 If the domain has a numeric type, this column indicates in 2743 which base the values in the columns 2744 <literal>numeric_precision</literal> and 2745 <literal>numeric_scale</literal> are expressed. The value is 2746 either 2 or 10. For all other data types, this column is null. 2747 </para></entry> 2748 </row> 2749 2750 <row> 2751 <entry role="catalog_table_entry"><para role="column_definition"> 2752 <structfield>numeric_scale</structfield> <type>cardinal_number</type> 2753 </para> 2754 <para> 2755 If the domain has an exact numeric type, this column contains 2756 the (declared or implicit) scale of the type for this domain. 2757 The scale indicates the number of significant digits to the 2758 right of the decimal point. It can be expressed in decimal 2759 (base 10) or binary (base 2) terms, as specified in the column 2760 <literal>numeric_precision_radix</literal>. For all other data 2761 types, this column is null. 2762 </para></entry> 2763 </row> 2764 2765 <row> 2766 <entry role="catalog_table_entry"><para role="column_definition"> 2767 <structfield>datetime_precision</structfield> <type>cardinal_number</type> 2768 </para> 2769 <para> 2770 If <literal>data_type</literal> identifies a date, time, 2771 timestamp, or interval type, this column contains the (declared 2772 or implicit) fractional seconds precision of the type for this 2773 domain, that is, the number of decimal digits maintained 2774 following the decimal point in the seconds value. For all 2775 other data types, this column is null. 2776 </para></entry> 2777 </row> 2778 2779 <row> 2780 <entry role="catalog_table_entry"><para role="column_definition"> 2781 <structfield>interval_type</structfield> <type>character_data</type> 2782 </para> 2783 <para> 2784 If <literal>data_type</literal> identifies an interval type, 2785 this column contains the specification which fields the 2786 intervals include for this domain, e.g., <literal>YEAR TO 2787 MONTH</literal>, <literal>DAY TO SECOND</literal>, etc. If no 2788 field restrictions were specified (that is, the interval 2789 accepts all fields), and for all other data types, this field 2790 is null. 2791 </para></entry> 2792 </row> 2793 2794 <row> 2795 <entry role="catalog_table_entry"><para role="column_definition"> 2796 <structfield>interval_precision</structfield> <type>cardinal_number</type> 2797 </para> 2798 <para> 2799 Applies to a feature not available 2800 in <productname>PostgreSQL</productname> 2801 (see <literal>datetime_precision</literal> for the fractional 2802 seconds precision of interval type domains) 2803 </para></entry> 2804 </row> 2805 2806 <row> 2807 <entry role="catalog_table_entry"><para role="column_definition"> 2808 <structfield>domain_default</structfield> <type>character_data</type> 2809 </para> 2810 <para> 2811 Default expression of the domain 2812 </para></entry> 2813 </row> 2814 2815 <row> 2816 <entry role="catalog_table_entry"><para role="column_definition"> 2817 <structfield>udt_catalog</structfield> <type>sql_identifier</type> 2818 </para> 2819 <para> 2820 Name of the database that the domain data type is defined in (always the current database) 2821 </para></entry> 2822 </row> 2823 2824 <row> 2825 <entry role="catalog_table_entry"><para role="column_definition"> 2826 <structfield>udt_schema</structfield> <type>sql_identifier</type> 2827 </para> 2828 <para> 2829 Name of the schema that the domain data type is defined in 2830 </para></entry> 2831 </row> 2832 2833 <row> 2834 <entry role="catalog_table_entry"><para role="column_definition"> 2835 <structfield>udt_name</structfield> <type>sql_identifier</type> 2836 </para> 2837 <para> 2838 Name of the domain data type 2839 </para></entry> 2840 </row> 2841 2842 <row> 2843 <entry role="catalog_table_entry"><para role="column_definition"> 2844 <structfield>scope_catalog</structfield> <type>sql_identifier</type> 2845 </para> 2846 <para> 2847 Applies to a feature not available in <productname>PostgreSQL</productname> 2848 </para></entry> 2849 </row> 2850 2851 <row> 2852 <entry role="catalog_table_entry"><para role="column_definition"> 2853 <structfield>scope_schema</structfield> <type>sql_identifier</type> 2854 </para> 2855 <para> 2856 Applies to a feature not available in <productname>PostgreSQL</productname> 2857 </para></entry> 2858 </row> 2859 2860 <row> 2861 <entry role="catalog_table_entry"><para role="column_definition"> 2862 <structfield>scope_name</structfield> <type>sql_identifier</type> 2863 </para> 2864 <para> 2865 Applies to a feature not available in <productname>PostgreSQL</productname> 2866 </para></entry> 2867 </row> 2868 2869 <row> 2870 <entry role="catalog_table_entry"><para role="column_definition"> 2871 <structfield>maximum_cardinality</structfield> <type>cardinal_number</type> 2872 </para> 2873 <para> 2874 Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname> 2875 </para></entry> 2876 </row> 2877 2878 <row> 2879 <entry role="catalog_table_entry"><para role="column_definition"> 2880 <structfield>dtd_identifier</structfield> <type>sql_identifier</type> 2881 </para> 2882 <para> 2883 An identifier of the data type descriptor of the domain, unique 2884 among the data type descriptors pertaining to the domain (which 2885 is trivial, because a domain only contains one data type 2886 descriptor). This is mainly useful for joining with other 2887 instances of such identifiers. (The specific format of the 2888 identifier is not defined and not guaranteed to remain the same 2889 in future versions.) 2890 </para></entry> 2891 </row> 2892 </tbody> 2893 </tgroup> 2894 </table> 2895 </sect1> 2896 2897 <sect1 id="infoschema-element-types"> 2898 <title><literal>element_types</literal></title> 2899 2900 <para> 2901 The view <literal>element_types</literal> contains the data type 2902 descriptors of the elements of arrays. When a table column, composite-type attribute, 2903 domain, function parameter, or function return value is defined to 2904 be of an array type, the respective information schema view only 2905 contains <literal>ARRAY</literal> in the column 2906 <literal>data_type</literal>. To obtain information on the element 2907 type of the array, you can join the respective view with this view. 2908 For example, to show the columns of a table with data types and 2909 array element types, if applicable, you could do: 2910<programlisting> 2911SELECT c.column_name, c.data_type, e.data_type AS element_type 2912FROM information_schema.columns c LEFT JOIN information_schema.element_types e 2913 ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier) 2914 = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.collection_type_identifier)) 2915WHERE c.table_schema = '...' AND c.table_name = '...' 2916ORDER BY c.ordinal_position; 2917</programlisting> 2918 This view only includes objects that the current user has access 2919 to, by way of being the owner or having some privilege. 2920 </para> 2921 2922 <table> 2923 <title><structname>element_types</structname> Columns</title> 2924 <tgroup cols="1"> 2925 <thead> 2926 <row> 2927 <entry role="catalog_table_entry"><para role="column_definition"> 2928 Column Type 2929 </para> 2930 <para> 2931 Description 2932 </para></entry> 2933 </row> 2934 </thead> 2935 2936 <tbody> 2937 <row> 2938 <entry role="catalog_table_entry"><para role="column_definition"> 2939 <structfield>object_catalog</structfield> <type>sql_identifier</type> 2940 </para> 2941 <para> 2942 Name of the database that contains the object that uses the 2943 array being described (always the current database) 2944 </para></entry> 2945 </row> 2946 2947 <row> 2948 <entry role="catalog_table_entry"><para role="column_definition"> 2949 <structfield>object_schema</structfield> <type>sql_identifier</type> 2950 </para> 2951 <para> 2952 Name of the schema that contains the object that uses the array 2953 being described 2954 </para></entry> 2955 </row> 2956 2957 <row> 2958 <entry role="catalog_table_entry"><para role="column_definition"> 2959 <structfield>object_name</structfield> <type>sql_identifier</type> 2960 </para> 2961 <para> 2962 Name of the object that uses the array being described 2963 </para></entry> 2964 </row> 2965 2966 <row> 2967 <entry role="catalog_table_entry"><para role="column_definition"> 2968 <structfield>object_type</structfield> <type>character_data</type> 2969 </para> 2970 <para> 2971 The type of the object that uses the array being described: one 2972 of <literal>TABLE</literal> (the array is used by a column of 2973 that table), <literal>USER-DEFINED TYPE</literal> (the array is 2974 used by an attribute of that composite type), 2975 <literal>DOMAIN</literal> (the array is used by that domain), 2976 <literal>ROUTINE</literal> (the array is used by a parameter or 2977 the return data type of that function). 2978 </para></entry> 2979 </row> 2980 2981 <row> 2982 <entry role="catalog_table_entry"><para role="column_definition"> 2983 <structfield>collection_type_identifier</structfield> <type>sql_identifier</type> 2984 </para> 2985 <para> 2986 The identifier of the data type descriptor of the array being 2987 described. Use this to join with the 2988 <literal>dtd_identifier</literal> columns of other information 2989 schema views. 2990 </para></entry> 2991 </row> 2992 2993 <row> 2994 <entry role="catalog_table_entry"><para role="column_definition"> 2995 <structfield>data_type</structfield> <type>character_data</type> 2996 </para> 2997 <para> 2998 Data type of the array elements, if it is a built-in type, else 2999 <literal>USER-DEFINED</literal> (in that case, the type is 3000 identified in <literal>udt_name</literal> and associated 3001 columns). 3002 </para></entry> 3003 </row> 3004 3005 <row> 3006 <entry role="catalog_table_entry"><para role="column_definition"> 3007 <structfield>character_maximum_length</structfield> <type>cardinal_number</type> 3008 </para> 3009 <para> 3010 Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname> 3011 </para></entry> 3012 </row> 3013 3014 <row> 3015 <entry role="catalog_table_entry"><para role="column_definition"> 3016 <structfield>character_octet_length</structfield> <type>cardinal_number</type> 3017 </para> 3018 <para> 3019 Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname> 3020 </para></entry> 3021 </row> 3022 3023 <row> 3024 <entry role="catalog_table_entry"><para role="column_definition"> 3025 <structfield>character_set_catalog</structfield> <type>sql_identifier</type> 3026 </para> 3027 <para> 3028 Applies to a feature not available in <productname>PostgreSQL</productname> 3029 </para></entry> 3030 </row> 3031 3032 <row> 3033 <entry role="catalog_table_entry"><para role="column_definition"> 3034 <structfield>character_set_schema</structfield> <type>sql_identifier</type> 3035 </para> 3036 <para> 3037 Applies to a feature not available in <productname>PostgreSQL</productname> 3038 </para></entry> 3039 </row> 3040 3041 <row> 3042 <entry role="catalog_table_entry"><para role="column_definition"> 3043 <structfield>character_set_name</structfield> <type>sql_identifier</type> 3044 </para> 3045 <para> 3046 Applies to a feature not available in <productname>PostgreSQL</productname> 3047 </para></entry> 3048 </row> 3049 3050 <row> 3051 <entry role="catalog_table_entry"><para role="column_definition"> 3052 <structfield>collation_catalog</structfield> <type>sql_identifier</type> 3053 </para> 3054 <para> 3055 Name of the database containing the collation of the element 3056 type (always the current database), null if default or the data 3057 type of the element is not collatable 3058 </para></entry> 3059 </row> 3060 3061 <row> 3062 <entry role="catalog_table_entry"><para role="column_definition"> 3063 <structfield>collation_schema</structfield> <type>sql_identifier</type> 3064 </para> 3065 <para> 3066 Name of the schema containing the collation of the element 3067 type, null if default or the data type of the element is not 3068 collatable 3069 </para></entry> 3070 </row> 3071 3072 <row> 3073 <entry role="catalog_table_entry"><para role="column_definition"> 3074 <structfield>collation_name</structfield> <type>sql_identifier</type> 3075 </para> 3076 <para> 3077 Name of the collation of the element type, null if default or 3078 the data type of the element is not collatable 3079 </para></entry> 3080 </row> 3081 3082 <row> 3083 <entry role="catalog_table_entry"><para role="column_definition"> 3084 <structfield>numeric_precision</structfield> <type>cardinal_number</type> 3085 </para> 3086 <para> 3087 Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname> 3088 </para></entry> 3089 </row> 3090 3091 <row> 3092 <entry role="catalog_table_entry"><para role="column_definition"> 3093 <structfield>numeric_precision_radix</structfield> <type>cardinal_number</type> 3094 </para> 3095 <para> 3096 Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname> 3097 </para></entry> 3098 </row> 3099 3100 <row> 3101 <entry role="catalog_table_entry"><para role="column_definition"> 3102 <structfield>numeric_scale</structfield> <type>cardinal_number</type> 3103 </para> 3104 <para> 3105 Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname> 3106 </para></entry> 3107 </row> 3108 3109 <row> 3110 <entry role="catalog_table_entry"><para role="column_definition"> 3111 <structfield>datetime_precision</structfield> <type>cardinal_number</type> 3112 </para> 3113 <para> 3114 Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname> 3115 </para></entry> 3116 </row> 3117 3118 <row> 3119 <entry role="catalog_table_entry"><para role="column_definition"> 3120 <structfield>interval_type</structfield> <type>character_data</type> 3121 </para> 3122 <para> 3123 Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname> 3124 </para></entry> 3125 </row> 3126 3127 <row> 3128 <entry role="catalog_table_entry"><para role="column_definition"> 3129 <structfield>interval_precision</structfield> <type>cardinal_number</type> 3130 </para> 3131 <para> 3132 Always null, since this information is not applied to array element data types in <productname>PostgreSQL</productname> 3133 </para></entry> 3134 </row> 3135 3136 <row> 3137 <entry role="catalog_table_entry"><para role="column_definition"> 3138 <structfield>domain_default</structfield> <type>character_data</type> 3139 </para> 3140 <para> 3141 Not yet implemented 3142 </para></entry> 3143 </row> 3144 3145 <row> 3146 <entry role="catalog_table_entry"><para role="column_definition"> 3147 <structfield>udt_catalog</structfield> <type>sql_identifier</type> 3148 </para> 3149 <para> 3150 Name of the database that the data type of the elements is 3151 defined in (always the current database) 3152 </para></entry> 3153 </row> 3154 3155 <row> 3156 <entry role="catalog_table_entry"><para role="column_definition"> 3157 <structfield>udt_schema</structfield> <type>sql_identifier</type> 3158 </para> 3159 <para> 3160 Name of the schema that the data type of the elements is 3161 defined in 3162 </para></entry> 3163 </row> 3164 3165 <row> 3166 <entry role="catalog_table_entry"><para role="column_definition"> 3167 <structfield>udt_name</structfield> <type>sql_identifier</type> 3168 </para> 3169 <para> 3170 Name of the data type of the elements 3171 </para></entry> 3172 </row> 3173 3174 <row> 3175 <entry role="catalog_table_entry"><para role="column_definition"> 3176 <structfield>scope_catalog</structfield> <type>sql_identifier</type> 3177 </para> 3178 <para> 3179 Applies to a feature not available in <productname>PostgreSQL</productname> 3180 </para></entry> 3181 </row> 3182 3183 <row> 3184 <entry role="catalog_table_entry"><para role="column_definition"> 3185 <structfield>scope_schema</structfield> <type>sql_identifier</type> 3186 </para> 3187 <para> 3188 Applies to a feature not available in <productname>PostgreSQL</productname> 3189 </para></entry> 3190 </row> 3191 3192 <row> 3193 <entry role="catalog_table_entry"><para role="column_definition"> 3194 <structfield>scope_name</structfield> <type>sql_identifier</type> 3195 </para> 3196 <para> 3197 Applies to a feature not available in <productname>PostgreSQL</productname> 3198 </para></entry> 3199 </row> 3200 3201 <row> 3202 <entry role="catalog_table_entry"><para role="column_definition"> 3203 <structfield>maximum_cardinality</structfield> <type>cardinal_number</type> 3204 </para> 3205 <para> 3206 Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname> 3207 </para></entry> 3208 </row> 3209 3210 <row> 3211 <entry role="catalog_table_entry"><para role="column_definition"> 3212 <structfield>dtd_identifier</structfield> <type>sql_identifier</type> 3213 </para> 3214 <para> 3215 An identifier of the data type descriptor of the element. This 3216 is currently not useful. 3217 </para></entry> 3218 </row> 3219 </tbody> 3220 </tgroup> 3221 </table> 3222 </sect1> 3223 3224 <sect1 id="infoschema-enabled-roles"> 3225 <title><literal>enabled_roles</literal></title> 3226 3227 <para> 3228 The view <literal>enabled_roles</literal> identifies the currently 3229 <quote>enabled roles</quote>. The enabled roles are recursively 3230 defined as the current user together with all roles that have been 3231 granted to the enabled roles with automatic inheritance. In other 3232 words, these are all roles that the current user has direct or 3233 indirect, automatically inheriting membership in. 3234 <indexterm><primary>enabled role</primary></indexterm> 3235 <indexterm><primary>role</primary><secondary>enabled</secondary></indexterm> 3236 </para> 3237 3238 <para> 3239 For permission checking, the set of <quote>applicable roles</quote> 3240 is applied, which can be broader than the set of enabled roles. So 3241 generally, it is better to use the view 3242 <literal>applicable_roles</literal> instead of this one; See 3243 <xref linkend="infoschema-applicable-roles"/> for details on 3244 <literal>applicable_roles</literal> view. 3245 </para> 3246 3247 <table> 3248 <title><structname>enabled_roles</structname> Columns</title> 3249 <tgroup cols="1"> 3250 <thead> 3251 <row> 3252 <entry role="catalog_table_entry"><para role="column_definition"> 3253 Column Type 3254 </para> 3255 <para> 3256 Description 3257 </para></entry> 3258 </row> 3259 </thead> 3260 3261 <tbody> 3262 <row> 3263 <entry role="catalog_table_entry"><para role="column_definition"> 3264 <structfield>role_name</structfield> <type>sql_identifier</type> 3265 </para> 3266 <para> 3267 Name of a role 3268 </para></entry> 3269 </row> 3270 </tbody> 3271 </tgroup> 3272 </table> 3273 </sect1> 3274 3275 <sect1 id="infoschema-foreign-data-wrapper-options"> 3276 <title><literal>foreign_data_wrapper_options</literal></title> 3277 3278 <para> 3279 The view <literal>foreign_data_wrapper_options</literal> contains 3280 all the options defined for foreign-data wrappers in the current 3281 database. Only those foreign-data wrappers are shown that the 3282 current user has access to (by way of being the owner or having 3283 some privilege). 3284 </para> 3285 3286 <table> 3287 <title><structname>foreign_data_wrapper_options</structname> Columns</title> 3288 <tgroup cols="1"> 3289 <thead> 3290 <row> 3291 <entry role="catalog_table_entry"><para role="column_definition"> 3292 Column Type 3293 </para> 3294 <para> 3295 Description 3296 </para></entry> 3297 </row> 3298 </thead> 3299 3300 <tbody> 3301 <row> 3302 <entry role="catalog_table_entry"><para role="column_definition"> 3303 <structfield>foreign_data_wrapper_catalog</structfield> <type>sql_identifier</type> 3304 </para> 3305 <para> 3306 Name of the database that the foreign-data wrapper is defined in (always the current database) 3307 </para></entry> 3308 </row> 3309 3310 <row> 3311 <entry role="catalog_table_entry"><para role="column_definition"> 3312 <structfield>foreign_data_wrapper_name</structfield> <type>sql_identifier</type> 3313 </para> 3314 <para> 3315 Name of the foreign-data wrapper 3316 </para></entry> 3317 </row> 3318 3319 <row> 3320 <entry role="catalog_table_entry"><para role="column_definition"> 3321 <structfield>option_name</structfield> <type>sql_identifier</type> 3322 </para> 3323 <para> 3324 Name of an option 3325 </para></entry> 3326 </row> 3327 3328 <row> 3329 <entry role="catalog_table_entry"><para role="column_definition"> 3330 <structfield>option_value</structfield> <type>character_data</type> 3331 </para> 3332 <para> 3333 Value of the option 3334 </para></entry> 3335 </row> 3336 </tbody> 3337 </tgroup> 3338 </table> 3339 </sect1> 3340 3341 <sect1 id="infoschema-foreign-data-wrappers"> 3342 <title><literal>foreign_data_wrappers</literal></title> 3343 3344 <para> 3345 The view <literal>foreign_data_wrappers</literal> contains all 3346 foreign-data wrappers defined in the current database. Only those 3347 foreign-data wrappers are shown that the current user has access to 3348 (by way of being the owner or having some privilege). 3349 </para> 3350 3351 <table> 3352 <title><structname>foreign_data_wrappers</structname> Columns</title> 3353 <tgroup cols="1"> 3354 <thead> 3355 <row> 3356 <entry role="catalog_table_entry"><para role="column_definition"> 3357 Column Type 3358 </para> 3359 <para> 3360 Description 3361 </para></entry> 3362 </row> 3363 </thead> 3364 3365 <tbody> 3366 <row> 3367 <entry role="catalog_table_entry"><para role="column_definition"> 3368 <structfield>foreign_data_wrapper_catalog</structfield> <type>sql_identifier</type> 3369 </para> 3370 <para> 3371 Name of the database that contains the foreign-data 3372 wrapper (always the current database) 3373 </para></entry> 3374 </row> 3375 3376 <row> 3377 <entry role="catalog_table_entry"><para role="column_definition"> 3378 <structfield>foreign_data_wrapper_name</structfield> <type>sql_identifier</type> 3379 </para> 3380 <para> 3381 Name of the foreign-data wrapper 3382 </para></entry> 3383 </row> 3384 3385 <row> 3386 <entry role="catalog_table_entry"><para role="column_definition"> 3387 <structfield>authorization_identifier</structfield> <type>sql_identifier</type> 3388 </para> 3389 <para> 3390 Name of the owner of the foreign server 3391 </para></entry> 3392 </row> 3393 3394 <row> 3395 <entry role="catalog_table_entry"><para role="column_definition"> 3396 <structfield>library_name</structfield> <type>character_data</type> 3397 </para> 3398 <para> 3399 File name of the library that implementing this foreign-data wrapper 3400 </para></entry> 3401 </row> 3402 3403 <row> 3404 <entry role="catalog_table_entry"><para role="column_definition"> 3405 <structfield>foreign_data_wrapper_language</structfield> <type>character_data</type> 3406 </para> 3407 <para> 3408 Language used to implement this foreign-data wrapper 3409 </para></entry> 3410 </row> 3411 </tbody> 3412 </tgroup> 3413 </table> 3414 </sect1> 3415 3416 <sect1 id="infoschema-foreign-server-options"> 3417 <title><literal>foreign_server_options</literal></title> 3418 3419 <para> 3420 The view <literal>foreign_server_options</literal> contains all the 3421 options defined for foreign servers in the current database. Only 3422 those foreign servers are shown that the current user has access to 3423 (by way of being the owner or having some privilege). 3424 </para> 3425 3426 <table> 3427 <title><structname>foreign_server_options</structname> Columns</title> 3428 <tgroup cols="1"> 3429 <thead> 3430 <row> 3431 <entry role="catalog_table_entry"><para role="column_definition"> 3432 Column Type 3433 </para> 3434 <para> 3435 Description 3436 </para></entry> 3437 </row> 3438 </thead> 3439 3440 <tbody> 3441 <row> 3442 <entry role="catalog_table_entry"><para role="column_definition"> 3443 <structfield>foreign_server_catalog</structfield> <type>sql_identifier</type> 3444 </para> 3445 <para> 3446 Name of the database that the foreign server is defined in (always the current database) 3447 </para></entry> 3448 </row> 3449 3450 <row> 3451 <entry role="catalog_table_entry"><para role="column_definition"> 3452 <structfield>foreign_server_name</structfield> <type>sql_identifier</type> 3453 </para> 3454 <para> 3455 Name of the foreign server 3456 </para></entry> 3457 </row> 3458 3459 <row> 3460 <entry role="catalog_table_entry"><para role="column_definition"> 3461 <structfield>option_name</structfield> <type>sql_identifier</type> 3462 </para> 3463 <para> 3464 Name of an option 3465 </para></entry> 3466 </row> 3467 3468 <row> 3469 <entry role="catalog_table_entry"><para role="column_definition"> 3470 <structfield>option_value</structfield> <type>character_data</type> 3471 </para> 3472 <para> 3473 Value of the option 3474 </para></entry> 3475 </row> 3476 </tbody> 3477 </tgroup> 3478 </table> 3479 </sect1> 3480 3481 <sect1 id="infoschema-foreign-servers"> 3482 <title><literal>foreign_servers</literal></title> 3483 3484 <para> 3485 The view <literal>foreign_servers</literal> contains all foreign 3486 servers defined in the current database. Only those foreign 3487 servers are shown that the current user has access to (by way of 3488 being the owner or having some privilege). 3489 </para> 3490 3491 <table> 3492 <title><structname>foreign_servers</structname> Columns</title> 3493 <tgroup cols="1"> 3494 <thead> 3495 <row> 3496 <entry role="catalog_table_entry"><para role="column_definition"> 3497 Column Type 3498 </para> 3499 <para> 3500 Description 3501 </para></entry> 3502 </row> 3503 </thead> 3504 3505 <tbody> 3506 <row> 3507 <entry role="catalog_table_entry"><para role="column_definition"> 3508 <structfield>foreign_server_catalog</structfield> <type>sql_identifier</type> 3509 </para> 3510 <para> 3511 Name of the database that the foreign server is defined in (always the current database) 3512 </para></entry> 3513 </row> 3514 3515 <row> 3516 <entry role="catalog_table_entry"><para role="column_definition"> 3517 <structfield>foreign_server_name</structfield> <type>sql_identifier</type> 3518 </para> 3519 <para> 3520 Name of the foreign server 3521 </para></entry> 3522 </row> 3523 3524 <row> 3525 <entry role="catalog_table_entry"><para role="column_definition"> 3526 <structfield>foreign_data_wrapper_catalog</structfield> <type>sql_identifier</type> 3527 </para> 3528 <para> 3529 Name of the database that contains the foreign-data 3530 wrapper used by the foreign server (always the current database) 3531 </para></entry> 3532 </row> 3533 3534 <row> 3535 <entry role="catalog_table_entry"><para role="column_definition"> 3536 <structfield>foreign_data_wrapper_name</structfield> <type>sql_identifier</type> 3537 </para> 3538 <para> 3539 Name of the foreign-data wrapper used by the foreign server 3540 </para></entry> 3541 </row> 3542 3543 <row> 3544 <entry role="catalog_table_entry"><para role="column_definition"> 3545 <structfield>foreign_server_type</structfield> <type>character_data</type> 3546 </para> 3547 <para> 3548 Foreign server type information, if specified upon creation 3549 </para></entry> 3550 </row> 3551 3552 <row> 3553 <entry role="catalog_table_entry"><para role="column_definition"> 3554 <structfield>foreign_server_version</structfield> <type>character_data</type> 3555 </para> 3556 <para> 3557 Foreign server version information, if specified upon creation 3558 </para></entry> 3559 </row> 3560 3561 <row> 3562 <entry role="catalog_table_entry"><para role="column_definition"> 3563 <structfield>authorization_identifier</structfield> <type>sql_identifier</type> 3564 </para> 3565 <para> 3566 Name of the owner of the foreign server 3567 </para></entry> 3568 </row> 3569 </tbody> 3570 </tgroup> 3571 </table> 3572 </sect1> 3573 3574 <sect1 id="infoschema-foreign-table-options"> 3575 <title><literal>foreign_table_options</literal></title> 3576 3577 <para> 3578 The view <literal>foreign_table_options</literal> contains all the 3579 options defined for foreign tables in the current database. Only 3580 those foreign tables are shown that the current user has access to 3581 (by way of being the owner or having some privilege). 3582 </para> 3583 3584 <table> 3585 <title><structname>foreign_table_options</structname> Columns</title> 3586 <tgroup cols="1"> 3587 <thead> 3588 <row> 3589 <entry role="catalog_table_entry"><para role="column_definition"> 3590 Column Type 3591 </para> 3592 <para> 3593 Description 3594 </para></entry> 3595 </row> 3596 </thead> 3597 3598 <tbody> 3599 <row> 3600 <entry role="catalog_table_entry"><para role="column_definition"> 3601 <structfield>foreign_table_catalog</structfield> <type>sql_identifier</type> 3602 </para> 3603 <para> 3604 Name of the database that contains the foreign table (always the current database) 3605 </para></entry> 3606 </row> 3607 3608 <row> 3609 <entry role="catalog_table_entry"><para role="column_definition"> 3610 <structfield>foreign_table_schema</structfield> <type>sql_identifier</type> 3611 </para> 3612 <para> 3613 Name of the schema that contains the foreign table 3614 </para></entry> 3615 </row> 3616 3617 <row> 3618 <entry role="catalog_table_entry"><para role="column_definition"> 3619 <structfield>foreign_table_name</structfield> <type>sql_identifier</type> 3620 </para> 3621 <para> 3622 Name of the foreign table 3623 </para></entry> 3624 </row> 3625 3626 <row> 3627 <entry role="catalog_table_entry"><para role="column_definition"> 3628 <structfield>option_name</structfield> <type>sql_identifier</type> 3629 </para> 3630 <para> 3631 Name of an option 3632 </para></entry> 3633 </row> 3634 3635 <row> 3636 <entry role="catalog_table_entry"><para role="column_definition"> 3637 <structfield>option_value</structfield> <type>character_data</type> 3638 </para> 3639 <para> 3640 Value of the option 3641 </para></entry> 3642 </row> 3643 </tbody> 3644 </tgroup> 3645 </table> 3646 </sect1> 3647 3648 <sect1 id="infoschema-foreign-tables"> 3649 <title><literal>foreign_tables</literal></title> 3650 3651 <para> 3652 The view <literal>foreign_tables</literal> contains all foreign 3653 tables defined in the current database. Only those foreign 3654 tables are shown that the current user has access to (by way of 3655 being the owner or having some privilege). 3656 </para> 3657 3658 <table> 3659 <title><structname>foreign_tables</structname> Columns</title> 3660 <tgroup cols="1"> 3661 <thead> 3662 <row> 3663 <entry role="catalog_table_entry"><para role="column_definition"> 3664 Column Type 3665 </para> 3666 <para> 3667 Description 3668 </para></entry> 3669 </row> 3670 </thead> 3671 3672 <tbody> 3673 <row> 3674 <entry role="catalog_table_entry"><para role="column_definition"> 3675 <structfield>foreign_table_catalog</structfield> <type>sql_identifier</type> 3676 </para> 3677 <para> 3678 Name of the database that the foreign table is defined in (always the current database) 3679 </para></entry> 3680 </row> 3681 3682 <row> 3683 <entry role="catalog_table_entry"><para role="column_definition"> 3684 <structfield>foreign_table_schema</structfield> <type>sql_identifier</type> 3685 </para> 3686 <para> 3687 Name of the schema that contains the foreign table 3688 </para></entry> 3689 </row> 3690 3691 <row> 3692 <entry role="catalog_table_entry"><para role="column_definition"> 3693 <structfield>foreign_table_name</structfield> <type>sql_identifier</type> 3694 </para> 3695 <para> 3696 Name of the foreign table 3697 </para></entry> 3698 </row> 3699 3700 <row> 3701 <entry role="catalog_table_entry"><para role="column_definition"> 3702 <structfield>foreign_server_catalog</structfield> <type>sql_identifier</type> 3703 </para> 3704 <para> 3705 Name of the database that the foreign server is defined in (always the current database) 3706 </para></entry> 3707 </row> 3708 3709 <row> 3710 <entry role="catalog_table_entry"><para role="column_definition"> 3711 <structfield>foreign_server_name</structfield> <type>sql_identifier</type> 3712 </para> 3713 <para> 3714 Name of the foreign server 3715 </para></entry> 3716 </row> 3717 </tbody> 3718 </tgroup> 3719 </table> 3720 </sect1> 3721 3722 <sect1 id="infoschema-key-column-usage"> 3723 <title><literal>key_column_usage</literal></title> 3724 3725 <para> 3726 The view <literal>key_column_usage</literal> identifies all columns 3727 in the current database that are restricted by some unique, primary 3728 key, or foreign key constraint. Check constraints are not included 3729 in this view. Only those columns are shown that the current user 3730 has access to, by way of being the owner or having some privilege. 3731 </para> 3732 3733 <table> 3734 <title><structname>key_column_usage</structname> Columns</title> 3735 <tgroup cols="1"> 3736 <thead> 3737 <row> 3738 <entry role="catalog_table_entry"><para role="column_definition"> 3739 Column Type 3740 </para> 3741 <para> 3742 Description 3743 </para></entry> 3744 </row> 3745 </thead> 3746 3747 <tbody> 3748 <row> 3749 <entry role="catalog_table_entry"><para role="column_definition"> 3750 <structfield>constraint_catalog</structfield> <type>sql_identifier</type> 3751 </para> 3752 <para> 3753 Name of the database that contains the constraint (always the current database) 3754 </para></entry> 3755 </row> 3756 3757 <row> 3758 <entry role="catalog_table_entry"><para role="column_definition"> 3759 <structfield>constraint_schema</structfield> <type>sql_identifier</type> 3760 </para> 3761 <para> 3762 Name of the schema that contains the constraint 3763 </para></entry> 3764 </row> 3765 3766 <row> 3767 <entry role="catalog_table_entry"><para role="column_definition"> 3768 <structfield>constraint_name</structfield> <type>sql_identifier</type> 3769 </para> 3770 <para> 3771 Name of the constraint 3772 </para></entry> 3773 </row> 3774 3775 <row> 3776 <entry role="catalog_table_entry"><para role="column_definition"> 3777 <structfield>table_catalog</structfield> <type>sql_identifier</type> 3778 </para> 3779 <para> 3780 Name of the database that contains the table that contains the 3781 column that is restricted by this constraint (always the 3782 current database) 3783 </para></entry> 3784 </row> 3785 3786 <row> 3787 <entry role="catalog_table_entry"><para role="column_definition"> 3788 <structfield>table_schema</structfield> <type>sql_identifier</type> 3789 </para> 3790 <para> 3791 Name of the schema that contains the table that contains the 3792 column that is restricted by this constraint 3793 </para></entry> 3794 </row> 3795 3796 <row> 3797 <entry role="catalog_table_entry"><para role="column_definition"> 3798 <structfield>table_name</structfield> <type>sql_identifier</type> 3799 </para> 3800 <para> 3801 Name of the table that contains the column that is restricted 3802 by this constraint 3803 </para></entry> 3804 </row> 3805 3806 <row> 3807 <entry role="catalog_table_entry"><para role="column_definition"> 3808 <structfield>column_name</structfield> <type>sql_identifier</type> 3809 </para> 3810 <para> 3811 Name of the column that is restricted by this constraint 3812 </para></entry> 3813 </row> 3814 3815 <row> 3816 <entry role="catalog_table_entry"><para role="column_definition"> 3817 <structfield>ordinal_position</structfield> <type>cardinal_number</type> 3818 </para> 3819 <para> 3820 Ordinal position of the column within the constraint key (count 3821 starts at 1) 3822 </para></entry> 3823 </row> 3824 3825 <row> 3826 <entry role="catalog_table_entry"><para role="column_definition"> 3827 <structfield>position_in_unique_constraint</structfield> <type>cardinal_number</type> 3828 </para> 3829 <para> 3830 For a foreign-key constraint, ordinal position of the referenced 3831 column within its unique constraint (count starts at 1); 3832 otherwise null 3833 </para></entry> 3834 </row> 3835 </tbody> 3836 </tgroup> 3837 </table> 3838 </sect1> 3839 3840 <sect1 id="infoschema-parameters"> 3841 <title><literal>parameters</literal></title> 3842 3843 <para> 3844 The view <literal>parameters</literal> contains information about 3845 the parameters (arguments) of all functions in the current database. 3846 Only those functions are shown that the current user has access to 3847 (by way of being the owner or having some privilege). 3848 </para> 3849 3850 <table> 3851 <title><structname>parameters</structname> Columns</title> 3852 <tgroup cols="1"> 3853 <thead> 3854 <row> 3855 <entry role="catalog_table_entry"><para role="column_definition"> 3856 Column Type 3857 </para> 3858 <para> 3859 Description 3860 </para></entry> 3861 </row> 3862 </thead> 3863 3864 <tbody> 3865 <row> 3866 <entry role="catalog_table_entry"><para role="column_definition"> 3867 <structfield>specific_catalog</structfield> <type>sql_identifier</type> 3868 </para> 3869 <para> 3870 Name of the database containing the function (always the current database) 3871 </para></entry> 3872 </row> 3873 3874 <row> 3875 <entry role="catalog_table_entry"><para role="column_definition"> 3876 <structfield>specific_schema</structfield> <type>sql_identifier</type> 3877 </para> 3878 <para> 3879 Name of the schema containing the function 3880 </para></entry> 3881 </row> 3882 3883 <row> 3884 <entry role="catalog_table_entry"><para role="column_definition"> 3885 <structfield>specific_name</structfield> <type>sql_identifier</type> 3886 </para> 3887 <para> 3888 The <quote>specific name</quote> of the function. See <xref linkend="infoschema-routines"/> for more information. 3889 </para></entry> 3890 </row> 3891 3892 <row> 3893 <entry role="catalog_table_entry"><para role="column_definition"> 3894 <structfield>ordinal_position</structfield> <type>cardinal_number</type> 3895 </para> 3896 <para> 3897 Ordinal position of the parameter in the argument list of the 3898 function (count starts at 1) 3899 </para></entry> 3900 </row> 3901 3902 <row> 3903 <entry role="catalog_table_entry"><para role="column_definition"> 3904 <structfield>parameter_mode</structfield> <type>character_data</type> 3905 </para> 3906 <para> 3907 <literal>IN</literal> for input parameter, 3908 <literal>OUT</literal> for output parameter, 3909 and <literal>INOUT</literal> for input/output parameter. 3910 </para></entry> 3911 </row> 3912 3913 <row> 3914 <entry role="catalog_table_entry"><para role="column_definition"> 3915 <structfield>is_result</structfield> <type>yes_or_no</type> 3916 </para> 3917 <para> 3918 Applies to a feature not available in <productname>PostgreSQL</productname> 3919 </para></entry> 3920 </row> 3921 3922 <row> 3923 <entry role="catalog_table_entry"><para role="column_definition"> 3924 <structfield>as_locator</structfield> <type>yes_or_no</type> 3925 </para> 3926 <para> 3927 Applies to a feature not available in <productname>PostgreSQL</productname> 3928 </para></entry> 3929 </row> 3930 3931 <row> 3932 <entry role="catalog_table_entry"><para role="column_definition"> 3933 <structfield>parameter_name</structfield> <type>sql_identifier</type> 3934 </para> 3935 <para> 3936 Name of the parameter, or null if the parameter has no name 3937 </para></entry> 3938 </row> 3939 3940 <row> 3941 <entry role="catalog_table_entry"><para role="column_definition"> 3942 <structfield>data_type</structfield> <type>character_data</type> 3943 </para> 3944 <para> 3945 Data type of the parameter, if it is a built-in type, or 3946 <literal>ARRAY</literal> if it is some array (in that case, see 3947 the view <literal>element_types</literal>), else 3948 <literal>USER-DEFINED</literal> (in that case, the type is 3949 identified in <literal>udt_name</literal> and associated 3950 columns). 3951 </para></entry> 3952 </row> 3953 3954 <row> 3955 <entry role="catalog_table_entry"><para role="column_definition"> 3956 <structfield>character_maximum_length</structfield> <type>cardinal_number</type> 3957 </para> 3958 <para> 3959 Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname> 3960 </para></entry> 3961 </row> 3962 3963 <row> 3964 <entry role="catalog_table_entry"><para role="column_definition"> 3965 <structfield>character_octet_length</structfield> <type>cardinal_number</type> 3966 </para> 3967 <para> 3968 Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname> 3969 </para></entry> 3970 </row> 3971 3972 <row> 3973 <entry role="catalog_table_entry"><para role="column_definition"> 3974 <structfield>character_set_catalog</structfield> <type>sql_identifier</type> 3975 </para> 3976 <para> 3977 Applies to a feature not available in <productname>PostgreSQL</productname> 3978 </para></entry> 3979 </row> 3980 3981 <row> 3982 <entry role="catalog_table_entry"><para role="column_definition"> 3983 <structfield>character_set_schema</structfield> <type>sql_identifier</type> 3984 </para> 3985 <para> 3986 Applies to a feature not available in <productname>PostgreSQL</productname> 3987 </para></entry> 3988 </row> 3989 3990 <row> 3991 <entry role="catalog_table_entry"><para role="column_definition"> 3992 <structfield>character_set_name</structfield> <type>sql_identifier</type> 3993 </para> 3994 <para> 3995 Applies to a feature not available in <productname>PostgreSQL</productname> 3996 </para></entry> 3997 </row> 3998 3999 <row> 4000 <entry role="catalog_table_entry"><para role="column_definition"> 4001 <structfield>collation_catalog</structfield> <type>sql_identifier</type> 4002 </para> 4003 <para> 4004 Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname> 4005 </para></entry> 4006 </row> 4007 4008 <row> 4009 <entry role="catalog_table_entry"><para role="column_definition"> 4010 <structfield>collation_schema</structfield> <type>sql_identifier</type> 4011 </para> 4012 <para> 4013 Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname> 4014 </para></entry> 4015 </row> 4016 4017 <row> 4018 <entry role="catalog_table_entry"><para role="column_definition"> 4019 <structfield>collation_name</structfield> <type>sql_identifier</type> 4020 </para> 4021 <para> 4022 Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname> 4023 </para></entry> 4024 </row> 4025 4026 <row> 4027 <entry role="catalog_table_entry"><para role="column_definition"> 4028 <structfield>numeric_precision</structfield> <type>cardinal_number</type> 4029 </para> 4030 <para> 4031 Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname> 4032 </para></entry> 4033 </row> 4034 4035 <row> 4036 <entry role="catalog_table_entry"><para role="column_definition"> 4037 <structfield>numeric_precision_radix</structfield> <type>cardinal_number</type> 4038 </para> 4039 <para> 4040 Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname> 4041 </para></entry> 4042 </row> 4043 4044 <row> 4045 <entry role="catalog_table_entry"><para role="column_definition"> 4046 <structfield>numeric_scale</structfield> <type>cardinal_number</type> 4047 </para> 4048 <para> 4049 Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname> 4050 </para></entry> 4051 </row> 4052 4053 <row> 4054 <entry role="catalog_table_entry"><para role="column_definition"> 4055 <structfield>datetime_precision</structfield> <type>cardinal_number</type> 4056 </para> 4057 <para> 4058 Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname> 4059 </para></entry> 4060 </row> 4061 4062 <row> 4063 <entry role="catalog_table_entry"><para role="column_definition"> 4064 <structfield>interval_type</structfield> <type>character_data</type> 4065 </para> 4066 <para> 4067 Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname> 4068 </para></entry> 4069 </row> 4070 4071 <row> 4072 <entry role="catalog_table_entry"><para role="column_definition"> 4073 <structfield>interval_precision</structfield> <type>cardinal_number</type> 4074 </para> 4075 <para> 4076 Always null, since this information is not applied to parameter data types in <productname>PostgreSQL</productname> 4077 </para></entry> 4078 </row> 4079 4080 <row> 4081 <entry role="catalog_table_entry"><para role="column_definition"> 4082 <structfield>udt_catalog</structfield> <type>sql_identifier</type> 4083 </para> 4084 <para> 4085 Name of the database that the data type of the parameter is 4086 defined in (always the current database) 4087 </para></entry> 4088 </row> 4089 4090 <row> 4091 <entry role="catalog_table_entry"><para role="column_definition"> 4092 <structfield>udt_schema</structfield> <type>sql_identifier</type> 4093 </para> 4094 <para> 4095 Name of the schema that the data type of the parameter is 4096 defined in 4097 </para></entry> 4098 </row> 4099 4100 <row> 4101 <entry role="catalog_table_entry"><para role="column_definition"> 4102 <structfield>udt_name</structfield> <type>sql_identifier</type> 4103 </para> 4104 <para> 4105 Name of the data type of the parameter 4106 </para></entry> 4107 </row> 4108 4109 <row> 4110 <entry role="catalog_table_entry"><para role="column_definition"> 4111 <structfield>scope_catalog</structfield> <type>sql_identifier</type> 4112 </para> 4113 <para> 4114 Applies to a feature not available in <productname>PostgreSQL</productname> 4115 </para></entry> 4116 </row> 4117 4118 <row> 4119 <entry role="catalog_table_entry"><para role="column_definition"> 4120 <structfield>scope_schema</structfield> <type>sql_identifier</type> 4121 </para> 4122 <para> 4123 Applies to a feature not available in <productname>PostgreSQL</productname> 4124 </para></entry> 4125 </row> 4126 4127 <row> 4128 <entry role="catalog_table_entry"><para role="column_definition"> 4129 <structfield>scope_name</structfield> <type>sql_identifier</type> 4130 </para> 4131 <para> 4132 Applies to a feature not available in <productname>PostgreSQL</productname> 4133 </para></entry> 4134 </row> 4135 4136 <row> 4137 <entry role="catalog_table_entry"><para role="column_definition"> 4138 <structfield>maximum_cardinality</structfield> <type>cardinal_number</type> 4139 </para> 4140 <para> 4141 Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname> 4142 </para></entry> 4143 </row> 4144 4145 <row> 4146 <entry role="catalog_table_entry"><para role="column_definition"> 4147 <structfield>dtd_identifier</structfield> <type>sql_identifier</type> 4148 </para> 4149 <para> 4150 An identifier of the data type descriptor of the parameter, 4151 unique among the data type descriptors pertaining to the 4152 function. This is mainly useful for joining with other 4153 instances of such identifiers. (The specific format of the 4154 identifier is not defined and not guaranteed to remain the same 4155 in future versions.) 4156 </para></entry> 4157 </row> 4158 4159 <row> 4160 <entry role="catalog_table_entry"><para role="column_definition"> 4161 <structfield>parameter_default</structfield> <type>character_data</type> 4162 </para> 4163 <para> 4164 The default expression of the parameter, or null if none or if the 4165 function is not owned by a currently enabled role. 4166 </para></entry> 4167 </row> 4168 </tbody> 4169 </tgroup> 4170 </table> 4171 </sect1> 4172 4173 <sect1 id="infoschema-referential-constraints"> 4174 <title><literal>referential_constraints</literal></title> 4175 4176 <para> 4177 The view <literal>referential_constraints</literal> contains all 4178 referential (foreign key) constraints in the current database. 4179 Only those constraints are shown for which the current user has 4180 write access to the referencing table (by way of being the 4181 owner or having some privilege other than <literal>SELECT</literal>). 4182 </para> 4183 4184 <table> 4185 <title><structname>referential_constraints</structname> Columns</title> 4186 <tgroup cols="1"> 4187 <thead> 4188 <row> 4189 <entry role="catalog_table_entry"><para role="column_definition"> 4190 Column Type 4191 </para> 4192 <para> 4193 Description 4194 </para></entry> 4195 </row> 4196 </thead> 4197 4198 <tbody> 4199 <row> 4200 <entry role="catalog_table_entry"><para role="column_definition"> 4201 <structfield>constraint_catalog</structfield> <type>sql_identifier</type> 4202 </para> 4203 <para> 4204 Name of the database containing the constraint (always the current database) 4205 </para></entry> 4206 </row> 4207 4208 <row> 4209 <entry role="catalog_table_entry"><para role="column_definition"> 4210 <structfield>constraint_schema</structfield> <type>sql_identifier</type> 4211 </para> 4212 <para> 4213 Name of the schema containing the constraint 4214 </para></entry> 4215 </row> 4216 4217 <row> 4218 <entry role="catalog_table_entry"><para role="column_definition"> 4219 <structfield>constraint_name</structfield> <type>sql_identifier</type> 4220 </para> 4221 <para> 4222 Name of the constraint 4223 </para></entry> 4224 </row> 4225 4226 <row> 4227 <entry role="catalog_table_entry"><para role="column_definition"> 4228 <structfield>unique_constraint_catalog</structfield> <type>sql_identifier</type> 4229 </para> 4230 <para> 4231 Name of the database that contains the unique or primary key 4232 constraint that the foreign key constraint references (always 4233 the current database) 4234 </para></entry> 4235 </row> 4236 4237 <row> 4238 <entry role="catalog_table_entry"><para role="column_definition"> 4239 <structfield>unique_constraint_schema</structfield> <type>sql_identifier</type> 4240 </para> 4241 <para> 4242 Name of the schema that contains the unique or primary key 4243 constraint that the foreign key constraint references 4244 </para></entry> 4245 </row> 4246 4247 <row> 4248 <entry role="catalog_table_entry"><para role="column_definition"> 4249 <structfield>unique_constraint_name</structfield> <type>sql_identifier</type> 4250 </para> 4251 <para> 4252 Name of the unique or primary key constraint that the foreign 4253 key constraint references 4254 </para></entry> 4255 </row> 4256 4257 <row> 4258 <entry role="catalog_table_entry"><para role="column_definition"> 4259 <structfield>match_option</structfield> <type>character_data</type> 4260 </para> 4261 <para> 4262 Match option of the foreign key constraint: 4263 <literal>FULL</literal>, <literal>PARTIAL</literal>, or 4264 <literal>NONE</literal>. 4265 </para></entry> 4266 </row> 4267 4268 <row> 4269 <entry role="catalog_table_entry"><para role="column_definition"> 4270 <structfield>update_rule</structfield> <type>character_data</type> 4271 </para> 4272 <para> 4273 Update rule of the foreign key constraint: 4274 <literal>CASCADE</literal>, <literal>SET NULL</literal>, 4275 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or 4276 <literal>NO ACTION</literal>. 4277 </para></entry> 4278 </row> 4279 4280 <row> 4281 <entry role="catalog_table_entry"><para role="column_definition"> 4282 <structfield>delete_rule</structfield> <type>character_data</type> 4283 </para> 4284 <para> 4285 Delete rule of the foreign key constraint: 4286 <literal>CASCADE</literal>, <literal>SET NULL</literal>, 4287 <literal>SET DEFAULT</literal>, <literal>RESTRICT</literal>, or 4288 <literal>NO ACTION</literal>. 4289 </para></entry> 4290 </row> 4291 </tbody> 4292 </tgroup> 4293 </table> 4294 4295 </sect1> 4296 4297 <sect1 id="infoschema-role-column-grants"> 4298 <title><literal>role_column_grants</literal></title> 4299 4300 <para> 4301 The view <literal>role_column_grants</literal> identifies all 4302 privileges granted on columns where the grantor or grantee is a 4303 currently enabled role. Further information can be found under 4304 <literal>column_privileges</literal>. The only effective 4305 difference between this view 4306 and <literal>column_privileges</literal> is that this view omits 4307 columns that have been made accessible to the current user by way 4308 of a grant to <literal>PUBLIC</literal>. 4309 </para> 4310 4311 <table> 4312 <title><structname>role_column_grants</structname> Columns</title> 4313 <tgroup cols="1"> 4314 <thead> 4315 <row> 4316 <entry role="catalog_table_entry"><para role="column_definition"> 4317 Column Type 4318 </para> 4319 <para> 4320 Description 4321 </para></entry> 4322 </row> 4323 </thead> 4324 4325 <tbody> 4326 <row> 4327 <entry role="catalog_table_entry"><para role="column_definition"> 4328 <structfield>grantor</structfield> <type>sql_identifier</type> 4329 </para> 4330 <para> 4331 Name of the role that granted the privilege 4332 </para></entry> 4333 </row> 4334 4335 <row> 4336 <entry role="catalog_table_entry"><para role="column_definition"> 4337 <structfield>grantee</structfield> <type>sql_identifier</type> 4338 </para> 4339 <para> 4340 Name of the role that the privilege was granted to 4341 </para></entry> 4342 </row> 4343 4344 <row> 4345 <entry role="catalog_table_entry"><para role="column_definition"> 4346 <structfield>table_catalog</structfield> <type>sql_identifier</type> 4347 </para> 4348 <para> 4349 Name of the database that contains the table that contains the column (always the current database) 4350 </para></entry> 4351 </row> 4352 4353 <row> 4354 <entry role="catalog_table_entry"><para role="column_definition"> 4355 <structfield>table_schema</structfield> <type>sql_identifier</type> 4356 </para> 4357 <para> 4358 Name of the schema that contains the table that contains the column 4359 </para></entry> 4360 </row> 4361 4362 <row> 4363 <entry role="catalog_table_entry"><para role="column_definition"> 4364 <structfield>table_name</structfield> <type>sql_identifier</type> 4365 </para> 4366 <para> 4367 Name of the table that contains the column 4368 </para></entry> 4369 </row> 4370 4371 <row> 4372 <entry role="catalog_table_entry"><para role="column_definition"> 4373 <structfield>column_name</structfield> <type>sql_identifier</type> 4374 </para> 4375 <para> 4376 Name of the column 4377 </para></entry> 4378 </row> 4379 4380 <row> 4381 <entry role="catalog_table_entry"><para role="column_definition"> 4382 <structfield>privilege_type</structfield> <type>character_data</type> 4383 </para> 4384 <para> 4385 Type of the privilege: <literal>SELECT</literal>, 4386 <literal>INSERT</literal>, <literal>UPDATE</literal>, or 4387 <literal>REFERENCES</literal> 4388 </para></entry> 4389 </row> 4390 4391 <row> 4392 <entry role="catalog_table_entry"><para role="column_definition"> 4393 <structfield>is_grantable</structfield> <type>yes_or_no</type> 4394 </para> 4395 <para> 4396 <literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not 4397 </para></entry> 4398 </row> 4399 </tbody> 4400 </tgroup> 4401 </table> 4402 </sect1> 4403 4404 <sect1 id="infoschema-role-routine-grants"> 4405 <title><literal>role_routine_grants</literal></title> 4406 4407 <para> 4408 The view <literal>role_routine_grants</literal> identifies all 4409 privileges granted on functions where the grantor or grantee is a 4410 currently enabled role. Further information can be found under 4411 <literal>routine_privileges</literal>. The only effective 4412 difference between this view 4413 and <literal>routine_privileges</literal> is that this view omits 4414 functions that have been made accessible to the current user by way 4415 of a grant to <literal>PUBLIC</literal>. 4416 </para> 4417 4418 <table> 4419 <title><structname>role_routine_grants</structname> Columns</title> 4420 <tgroup cols="1"> 4421 <thead> 4422 <row> 4423 <entry role="catalog_table_entry"><para role="column_definition"> 4424 Column Type 4425 </para> 4426 <para> 4427 Description 4428 </para></entry> 4429 </row> 4430 </thead> 4431 4432 <tbody> 4433 <row> 4434 <entry role="catalog_table_entry"><para role="column_definition"> 4435 <structfield>grantor</structfield> <type>sql_identifier</type> 4436 </para> 4437 <para> 4438 Name of the role that granted the privilege 4439 </para></entry> 4440 </row> 4441 4442 <row> 4443 <entry role="catalog_table_entry"><para role="column_definition"> 4444 <structfield>grantee</structfield> <type>sql_identifier</type> 4445 </para> 4446 <para> 4447 Name of the role that the privilege was granted to 4448 </para></entry> 4449 </row> 4450 4451 <row> 4452 <entry role="catalog_table_entry"><para role="column_definition"> 4453 <structfield>specific_catalog</structfield> <type>sql_identifier</type> 4454 </para> 4455 <para> 4456 Name of the database containing the function (always the current database) 4457 </para></entry> 4458 </row> 4459 4460 <row> 4461 <entry role="catalog_table_entry"><para role="column_definition"> 4462 <structfield>specific_schema</structfield> <type>sql_identifier</type> 4463 </para> 4464 <para> 4465 Name of the schema containing the function 4466 </para></entry> 4467 </row> 4468 4469 <row> 4470 <entry role="catalog_table_entry"><para role="column_definition"> 4471 <structfield>specific_name</structfield> <type>sql_identifier</type> 4472 </para> 4473 <para> 4474 The <quote>specific name</quote> of the function. See <xref linkend="infoschema-routines"/> for more information. 4475 </para></entry> 4476 </row> 4477 4478 <row> 4479 <entry role="catalog_table_entry"><para role="column_definition"> 4480 <structfield>routine_catalog</structfield> <type>sql_identifier</type> 4481 </para> 4482 <para> 4483 Name of the database containing the function (always the current database) 4484 </para></entry> 4485 </row> 4486 4487 <row> 4488 <entry role="catalog_table_entry"><para role="column_definition"> 4489 <structfield>routine_schema</structfield> <type>sql_identifier</type> 4490 </para> 4491 <para> 4492 Name of the schema containing the function 4493 </para></entry> 4494 </row> 4495 4496 <row> 4497 <entry role="catalog_table_entry"><para role="column_definition"> 4498 <structfield>routine_name</structfield> <type>sql_identifier</type> 4499 </para> 4500 <para> 4501 Name of the function (might be duplicated in case of overloading) 4502 </para></entry> 4503 </row> 4504 4505 <row> 4506 <entry role="catalog_table_entry"><para role="column_definition"> 4507 <structfield>privilege_type</structfield> <type>character_data</type> 4508 </para> 4509 <para> 4510 Always <literal>EXECUTE</literal> (the only privilege type for functions) 4511 </para></entry> 4512 </row> 4513 4514 <row> 4515 <entry role="catalog_table_entry"><para role="column_definition"> 4516 <structfield>is_grantable</structfield> <type>yes_or_no</type> 4517 </para> 4518 <para> 4519 <literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not 4520 </para></entry> 4521 </row> 4522 </tbody> 4523 </tgroup> 4524 </table> 4525 </sect1> 4526 4527 <sect1 id="infoschema-role-table-grants"> 4528 <title><literal>role_table_grants</literal></title> 4529 4530 <para> 4531 The view <literal>role_table_grants</literal> identifies all 4532 privileges granted on tables or views where the grantor or grantee 4533 is a currently enabled role. Further information can be found 4534 under <literal>table_privileges</literal>. The only effective 4535 difference between this view 4536 and <literal>table_privileges</literal> is that this view omits 4537 tables that have been made accessible to the current user by way of 4538 a grant to <literal>PUBLIC</literal>. 4539 </para> 4540 4541 <table> 4542 <title><structname>role_table_grants</structname> Columns</title> 4543 <tgroup cols="1"> 4544 <thead> 4545 <row> 4546 <entry role="catalog_table_entry"><para role="column_definition"> 4547 Column Type 4548 </para> 4549 <para> 4550 Description 4551 </para></entry> 4552 </row> 4553 </thead> 4554 4555 <tbody> 4556 <row> 4557 <entry role="catalog_table_entry"><para role="column_definition"> 4558 <structfield>grantor</structfield> <type>sql_identifier</type> 4559 </para> 4560 <para> 4561 Name of the role that granted the privilege 4562 </para></entry> 4563 </row> 4564 4565 <row> 4566 <entry role="catalog_table_entry"><para role="column_definition"> 4567 <structfield>grantee</structfield> <type>sql_identifier</type> 4568 </para> 4569 <para> 4570 Name of the role that the privilege was granted to 4571 </para></entry> 4572 </row> 4573 4574 <row> 4575 <entry role="catalog_table_entry"><para role="column_definition"> 4576 <structfield>table_catalog</structfield> <type>sql_identifier</type> 4577 </para> 4578 <para> 4579 Name of the database that contains the table (always the current database) 4580 </para></entry> 4581 </row> 4582 4583 <row> 4584 <entry role="catalog_table_entry"><para role="column_definition"> 4585 <structfield>table_schema</structfield> <type>sql_identifier</type> 4586 </para> 4587 <para> 4588 Name of the schema that contains the table 4589 </para></entry> 4590 </row> 4591 4592 <row> 4593 <entry role="catalog_table_entry"><para role="column_definition"> 4594 <structfield>table_name</structfield> <type>sql_identifier</type> 4595 </para> 4596 <para> 4597 Name of the table 4598 </para></entry> 4599 </row> 4600 4601 <row> 4602 <entry role="catalog_table_entry"><para role="column_definition"> 4603 <structfield>privilege_type</structfield> <type>character_data</type> 4604 </para> 4605 <para> 4606 Type of the privilege: <literal>SELECT</literal>, 4607 <literal>INSERT</literal>, <literal>UPDATE</literal>, 4608 <literal>DELETE</literal>, <literal>TRUNCATE</literal>, 4609 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal> 4610 </para></entry> 4611 </row> 4612 4613 <row> 4614 <entry role="catalog_table_entry"><para role="column_definition"> 4615 <structfield>is_grantable</structfield> <type>yes_or_no</type> 4616 </para> 4617 <para> 4618 <literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not 4619 </para></entry> 4620 </row> 4621 4622 <row> 4623 <entry role="catalog_table_entry"><para role="column_definition"> 4624 <structfield>with_hierarchy</structfield> <type>yes_or_no</type> 4625 </para> 4626 <para> 4627 In the SQL standard, <literal>WITH HIERARCHY OPTION</literal> 4628 is a separate (sub-)privilege allowing certain operations on 4629 table inheritance hierarchies. In PostgreSQL, this is included 4630 in the <literal>SELECT</literal> privilege, so this column 4631 shows <literal>YES</literal> if the privilege 4632 is <literal>SELECT</literal>, else <literal>NO</literal>. 4633 </para></entry> 4634 </row> 4635 </tbody> 4636 </tgroup> 4637 </table> 4638 </sect1> 4639 4640 <sect1 id="infoschema-role-udt-grants"> 4641 <title><literal>role_udt_grants</literal></title> 4642 4643 <para> 4644 The view <literal>role_udt_grants</literal> is intended to identify 4645 <literal>USAGE</literal> privileges granted on user-defined types 4646 where the grantor or grantee is a currently enabled role. Further 4647 information can be found under 4648 <literal>udt_privileges</literal>. The only effective difference 4649 between this view and <literal>udt_privileges</literal> is that 4650 this view omits objects that have been made accessible to the 4651 current user by way of a grant to <literal>PUBLIC</literal>. Since 4652 data types do not have real privileges in PostgreSQL, but only an 4653 implicit grant to <literal>PUBLIC</literal>, this view is empty. 4654 </para> 4655 4656 <table> 4657 <title><structname>role_udt_grants</structname> Columns</title> 4658 <tgroup cols="1"> 4659 <thead> 4660 <row> 4661 <entry role="catalog_table_entry"><para role="column_definition"> 4662 Column Type 4663 </para> 4664 <para> 4665 Description 4666 </para></entry> 4667 </row> 4668 </thead> 4669 4670 <tbody> 4671 <row> 4672 <entry role="catalog_table_entry"><para role="column_definition"> 4673 <structfield>grantor</structfield> <type>sql_identifier</type> 4674 </para> 4675 <para> 4676 The name of the role that granted the privilege 4677 </para></entry> 4678 </row> 4679 4680 <row> 4681 <entry role="catalog_table_entry"><para role="column_definition"> 4682 <structfield>grantee</structfield> <type>sql_identifier</type> 4683 </para> 4684 <para> 4685 The name of the role that the privilege was granted to 4686 </para></entry> 4687 </row> 4688 4689 <row> 4690 <entry role="catalog_table_entry"><para role="column_definition"> 4691 <structfield>udt_catalog</structfield> <type>sql_identifier</type> 4692 </para> 4693 <para> 4694 Name of the database containing the type (always the current database) 4695 </para></entry> 4696 </row> 4697 4698 <row> 4699 <entry role="catalog_table_entry"><para role="column_definition"> 4700 <structfield>udt_schema</structfield> <type>sql_identifier</type> 4701 </para> 4702 <para> 4703 Name of the schema containing the type 4704 </para></entry> 4705 </row> 4706 4707 <row> 4708 <entry role="catalog_table_entry"><para role="column_definition"> 4709 <structfield>udt_name</structfield> <type>sql_identifier</type> 4710 </para> 4711 <para> 4712 Name of the type 4713 </para></entry> 4714 </row> 4715 4716 <row> 4717 <entry role="catalog_table_entry"><para role="column_definition"> 4718 <structfield>privilege_type</structfield> <type>character_data</type> 4719 </para> 4720 <para> 4721 Always <literal>TYPE USAGE</literal> 4722 </para></entry> 4723 </row> 4724 4725 <row> 4726 <entry role="catalog_table_entry"><para role="column_definition"> 4727 <structfield>is_grantable</structfield> <type>yes_or_no</type> 4728 </para> 4729 <para> 4730 <literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not 4731 </para></entry> 4732 </row> 4733 </tbody> 4734 </tgroup> 4735 </table> 4736 </sect1> 4737 4738 <sect1 id="infoschema-role-usage-grants"> 4739 <title><literal>role_usage_grants</literal></title> 4740 4741 <para> 4742 The view <literal>role_usage_grants</literal> identifies 4743 <literal>USAGE</literal> privileges granted on various kinds of 4744 objects where the grantor or grantee is a currently enabled role. 4745 Further information can be found under 4746 <literal>usage_privileges</literal>. The only effective difference 4747 between this view and <literal>usage_privileges</literal> is that 4748 this view omits objects that have been made accessible to the 4749 current user by way of a grant to <literal>PUBLIC</literal>. 4750 </para> 4751 4752 <table> 4753 <title><structname>role_usage_grants</structname> Columns</title> 4754 <tgroup cols="1"> 4755 <thead> 4756 <row> 4757 <entry role="catalog_table_entry"><para role="column_definition"> 4758 Column Type 4759 </para> 4760 <para> 4761 Description 4762 </para></entry> 4763 </row> 4764 </thead> 4765 4766 <tbody> 4767 <row> 4768 <entry role="catalog_table_entry"><para role="column_definition"> 4769 <structfield>grantor</structfield> <type>sql_identifier</type> 4770 </para> 4771 <para> 4772 The name of the role that granted the privilege 4773 </para></entry> 4774 </row> 4775 4776 <row> 4777 <entry role="catalog_table_entry"><para role="column_definition"> 4778 <structfield>grantee</structfield> <type>sql_identifier</type> 4779 </para> 4780 <para> 4781 The name of the role that the privilege was granted to 4782 </para></entry> 4783 </row> 4784 4785 <row> 4786 <entry role="catalog_table_entry"><para role="column_definition"> 4787 <structfield>object_catalog</structfield> <type>sql_identifier</type> 4788 </para> 4789 <para> 4790 Name of the database containing the object (always the current database) 4791 </para></entry> 4792 </row> 4793 4794 <row> 4795 <entry role="catalog_table_entry"><para role="column_definition"> 4796 <structfield>object_schema</structfield> <type>sql_identifier</type> 4797 </para> 4798 <para> 4799 Name of the schema containing the object, if applicable, 4800 else an empty string 4801 </para></entry> 4802 </row> 4803 4804 <row> 4805 <entry role="catalog_table_entry"><para role="column_definition"> 4806 <structfield>object_name</structfield> <type>sql_identifier</type> 4807 </para> 4808 <para> 4809 Name of the object 4810 </para></entry> 4811 </row> 4812 4813 <row> 4814 <entry role="catalog_table_entry"><para role="column_definition"> 4815 <structfield>object_type</structfield> <type>character_data</type> 4816 </para> 4817 <para> 4818 <literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal> or <literal>SEQUENCE</literal> 4819 </para></entry> 4820 </row> 4821 4822 <row> 4823 <entry role="catalog_table_entry"><para role="column_definition"> 4824 <structfield>privilege_type</structfield> <type>character_data</type> 4825 </para> 4826 <para> 4827 Always <literal>USAGE</literal> 4828 </para></entry> 4829 </row> 4830 4831 <row> 4832 <entry role="catalog_table_entry"><para role="column_definition"> 4833 <structfield>is_grantable</structfield> <type>yes_or_no</type> 4834 </para> 4835 <para> 4836 <literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not 4837 </para></entry> 4838 </row> 4839 </tbody> 4840 </tgroup> 4841 </table> 4842 </sect1> 4843 4844 <sect1 id="infoschema-routine-privileges"> 4845 <title><literal>routine_privileges</literal></title> 4846 4847 <para> 4848 The view <literal>routine_privileges</literal> identifies all 4849 privileges granted on functions to a currently enabled role or by a 4850 currently enabled role. There is one row for each combination of function, 4851 grantor, and grantee. 4852 </para> 4853 4854 <table> 4855 <title><structname>routine_privileges</structname> Columns</title> 4856 <tgroup cols="1"> 4857 <thead> 4858 <row> 4859 <entry role="catalog_table_entry"><para role="column_definition"> 4860 Column Type 4861 </para> 4862 <para> 4863 Description 4864 </para></entry> 4865 </row> 4866 </thead> 4867 4868 <tbody> 4869 <row> 4870 <entry role="catalog_table_entry"><para role="column_definition"> 4871 <structfield>grantor</structfield> <type>sql_identifier</type> 4872 </para> 4873 <para> 4874 Name of the role that granted the privilege 4875 </para></entry> 4876 </row> 4877 4878 <row> 4879 <entry role="catalog_table_entry"><para role="column_definition"> 4880 <structfield>grantee</structfield> <type>sql_identifier</type> 4881 </para> 4882 <para> 4883 Name of the role that the privilege was granted to 4884 </para></entry> 4885 </row> 4886 4887 <row> 4888 <entry role="catalog_table_entry"><para role="column_definition"> 4889 <structfield>specific_catalog</structfield> <type>sql_identifier</type> 4890 </para> 4891 <para> 4892 Name of the database containing the function (always the current database) 4893 </para></entry> 4894 </row> 4895 4896 <row> 4897 <entry role="catalog_table_entry"><para role="column_definition"> 4898 <structfield>specific_schema</structfield> <type>sql_identifier</type> 4899 </para> 4900 <para> 4901 Name of the schema containing the function 4902 </para></entry> 4903 </row> 4904 4905 <row> 4906 <entry role="catalog_table_entry"><para role="column_definition"> 4907 <structfield>specific_name</structfield> <type>sql_identifier</type> 4908 </para> 4909 <para> 4910 The <quote>specific name</quote> of the function. See <xref linkend="infoschema-routines"/> for more information. 4911 </para></entry> 4912 </row> 4913 4914 <row> 4915 <entry role="catalog_table_entry"><para role="column_definition"> 4916 <structfield>routine_catalog</structfield> <type>sql_identifier</type> 4917 </para> 4918 <para> 4919 Name of the database containing the function (always the current database) 4920 </para></entry> 4921 </row> 4922 4923 <row> 4924 <entry role="catalog_table_entry"><para role="column_definition"> 4925 <structfield>routine_schema</structfield> <type>sql_identifier</type> 4926 </para> 4927 <para> 4928 Name of the schema containing the function 4929 </para></entry> 4930 </row> 4931 4932 <row> 4933 <entry role="catalog_table_entry"><para role="column_definition"> 4934 <structfield>routine_name</structfield> <type>sql_identifier</type> 4935 </para> 4936 <para> 4937 Name of the function (might be duplicated in case of overloading) 4938 </para></entry> 4939 </row> 4940 4941 <row> 4942 <entry role="catalog_table_entry"><para role="column_definition"> 4943 <structfield>privilege_type</structfield> <type>character_data</type> 4944 </para> 4945 <para> 4946 Always <literal>EXECUTE</literal> (the only privilege type for functions) 4947 </para></entry> 4948 </row> 4949 4950 <row> 4951 <entry role="catalog_table_entry"><para role="column_definition"> 4952 <structfield>is_grantable</structfield> <type>yes_or_no</type> 4953 </para> 4954 <para> 4955 <literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not 4956 </para></entry> 4957 </row> 4958 </tbody> 4959 </tgroup> 4960 </table> 4961 </sect1> 4962 4963 <sect1 id="infoschema-routines"> 4964 <title><literal>routines</literal></title> 4965 4966 <para> 4967 The view <literal>routines</literal> contains all functions and procedures in the 4968 current database. Only those functions and procedures are shown that the current 4969 user has access to (by way of being the owner or having some 4970 privilege). 4971 </para> 4972 4973 <table> 4974 <title><structname>routines</structname> Columns</title> 4975 <tgroup cols="1"> 4976 <thead> 4977 <row> 4978 <entry role="catalog_table_entry"><para role="column_definition"> 4979 Column Type 4980 </para> 4981 <para> 4982 Description 4983 </para></entry> 4984 </row> 4985 </thead> 4986 4987 <tbody> 4988 <row> 4989 <entry role="catalog_table_entry"><para role="column_definition"> 4990 <structfield>specific_catalog</structfield> <type>sql_identifier</type> 4991 </para> 4992 <para> 4993 Name of the database containing the function (always the current database) 4994 </para></entry> 4995 </row> 4996 4997 <row> 4998 <entry role="catalog_table_entry"><para role="column_definition"> 4999 <structfield>specific_schema</structfield> <type>sql_identifier</type> 5000 </para> 5001 <para> 5002 Name of the schema containing the function 5003 </para></entry> 5004 </row> 5005 5006 <row> 5007 <entry role="catalog_table_entry"><para role="column_definition"> 5008 <structfield>specific_name</structfield> <type>sql_identifier</type> 5009 </para> 5010 <para> 5011 The <quote>specific name</quote> of the function. This is a 5012 name that uniquely identifies the function in the schema, even 5013 if the real name of the function is overloaded. The format of 5014 the specific name is not defined, it should only be used to 5015 compare it to other instances of specific routine names. 5016 </para></entry> 5017 </row> 5018 5019 <row> 5020 <entry role="catalog_table_entry"><para role="column_definition"> 5021 <structfield>routine_catalog</structfield> <type>sql_identifier</type> 5022 </para> 5023 <para> 5024 Name of the database containing the function (always the current database) 5025 </para></entry> 5026 </row> 5027 5028 <row> 5029 <entry role="catalog_table_entry"><para role="column_definition"> 5030 <structfield>routine_schema</structfield> <type>sql_identifier</type> 5031 </para> 5032 <para> 5033 Name of the schema containing the function 5034 </para></entry> 5035 </row> 5036 5037 <row> 5038 <entry role="catalog_table_entry"><para role="column_definition"> 5039 <structfield>routine_name</structfield> <type>sql_identifier</type> 5040 </para> 5041 <para> 5042 Name of the function (might be duplicated in case of overloading) 5043 </para></entry> 5044 </row> 5045 5046 <row> 5047 <entry role="catalog_table_entry"><para role="column_definition"> 5048 <structfield>routine_type</structfield> <type>character_data</type> 5049 </para> 5050 <para> 5051 <literal>FUNCTION</literal> for a 5052 function, <literal>PROCEDURE</literal> for a procedure 5053 </para></entry> 5054 </row> 5055 5056 <row> 5057 <entry role="catalog_table_entry"><para role="column_definition"> 5058 <structfield>module_catalog</structfield> <type>sql_identifier</type> 5059 </para> 5060 <para> 5061 Applies to a feature not available in <productname>PostgreSQL</productname> 5062 </para></entry> 5063 </row> 5064 5065 <row> 5066 <entry role="catalog_table_entry"><para role="column_definition"> 5067 <structfield>module_schema</structfield> <type>sql_identifier</type> 5068 </para> 5069 <para> 5070 Applies to a feature not available in <productname>PostgreSQL</productname> 5071 </para></entry> 5072 </row> 5073 5074 <row> 5075 <entry role="catalog_table_entry"><para role="column_definition"> 5076 <structfield>module_name</structfield> <type>sql_identifier</type> 5077 </para> 5078 <para> 5079 Applies to a feature not available in <productname>PostgreSQL</productname> 5080 </para></entry> 5081 </row> 5082 5083 <row> 5084 <entry role="catalog_table_entry"><para role="column_definition"> 5085 <structfield>udt_catalog</structfield> <type>sql_identifier</type> 5086 </para> 5087 <para> 5088 Applies to a feature not available in <productname>PostgreSQL</productname> 5089 </para></entry> 5090 </row> 5091 5092 <row> 5093 <entry role="catalog_table_entry"><para role="column_definition"> 5094 <structfield>udt_schema</structfield> <type>sql_identifier</type> 5095 </para> 5096 <para> 5097 Applies to a feature not available in <productname>PostgreSQL</productname> 5098 </para></entry> 5099 </row> 5100 5101 <row> 5102 <entry role="catalog_table_entry"><para role="column_definition"> 5103 <structfield>udt_name</structfield> <type>sql_identifier</type> 5104 </para> 5105 <para> 5106 Applies to a feature not available in <productname>PostgreSQL</productname> 5107 </para></entry> 5108 </row> 5109 5110 <row> 5111 <entry role="catalog_table_entry"><para role="column_definition"> 5112 <structfield>data_type</structfield> <type>character_data</type> 5113 </para> 5114 <para> 5115 Return data type of the function, if it is a built-in type, or 5116 <literal>ARRAY</literal> if it is some array (in that case, see 5117 the view <literal>element_types</literal>), else 5118 <literal>USER-DEFINED</literal> (in that case, the type is 5119 identified in <literal>type_udt_name</literal> and associated 5120 columns). Null for a procedure. 5121 </para></entry> 5122 </row> 5123 5124 <row> 5125 <entry role="catalog_table_entry"><para role="column_definition"> 5126 <structfield>character_maximum_length</structfield> <type>cardinal_number</type> 5127 </para> 5128 <para> 5129 Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname> 5130 </para></entry> 5131 </row> 5132 5133 <row> 5134 <entry role="catalog_table_entry"><para role="column_definition"> 5135 <structfield>character_octet_length</structfield> <type>cardinal_number</type> 5136 </para> 5137 <para> 5138 Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname> 5139 </para></entry> 5140 </row> 5141 5142 <row> 5143 <entry role="catalog_table_entry"><para role="column_definition"> 5144 <structfield>character_set_catalog</structfield> <type>sql_identifier</type> 5145 </para> 5146 <para> 5147 Applies to a feature not available in <productname>PostgreSQL</productname> 5148 </para></entry> 5149 </row> 5150 5151 <row> 5152 <entry role="catalog_table_entry"><para role="column_definition"> 5153 <structfield>character_set_schema</structfield> <type>sql_identifier</type> 5154 </para> 5155 <para> 5156 Applies to a feature not available in <productname>PostgreSQL</productname> 5157 </para></entry> 5158 </row> 5159 5160 <row> 5161 <entry role="catalog_table_entry"><para role="column_definition"> 5162 <structfield>character_set_name</structfield> <type>sql_identifier</type> 5163 </para> 5164 <para> 5165 Applies to a feature not available in <productname>PostgreSQL</productname> 5166 </para></entry> 5167 </row> 5168 5169 <row> 5170 <entry role="catalog_table_entry"><para role="column_definition"> 5171 <structfield>collation_catalog</structfield> <type>sql_identifier</type> 5172 </para> 5173 <para> 5174 Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname> 5175 </para></entry> 5176 </row> 5177 5178 <row> 5179 <entry role="catalog_table_entry"><para role="column_definition"> 5180 <structfield>collation_schema</structfield> <type>sql_identifier</type> 5181 </para> 5182 <para> 5183 Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname> 5184 </para></entry> 5185 </row> 5186 5187 <row> 5188 <entry role="catalog_table_entry"><para role="column_definition"> 5189 <structfield>collation_name</structfield> <type>sql_identifier</type> 5190 </para> 5191 <para> 5192 Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname> 5193 </para></entry> 5194 </row> 5195 5196 <row> 5197 <entry role="catalog_table_entry"><para role="column_definition"> 5198 <structfield>numeric_precision</structfield> <type>cardinal_number</type> 5199 </para> 5200 <para> 5201 Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname> 5202 </para></entry> 5203 </row> 5204 5205 <row> 5206 <entry role="catalog_table_entry"><para role="column_definition"> 5207 <structfield>numeric_precision_radix</structfield> <type>cardinal_number</type> 5208 </para> 5209 <para> 5210 Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname> 5211 </para></entry> 5212 </row> 5213 5214 <row> 5215 <entry role="catalog_table_entry"><para role="column_definition"> 5216 <structfield>numeric_scale</structfield> <type>cardinal_number</type> 5217 </para> 5218 <para> 5219 Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname> 5220 </para></entry> 5221 </row> 5222 5223 <row> 5224 <entry role="catalog_table_entry"><para role="column_definition"> 5225 <structfield>datetime_precision</structfield> <type>cardinal_number</type> 5226 </para> 5227 <para> 5228 Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname> 5229 </para></entry> 5230 </row> 5231 5232 <row> 5233 <entry role="catalog_table_entry"><para role="column_definition"> 5234 <structfield>interval_type</structfield> <type>character_data</type> 5235 </para> 5236 <para> 5237 Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname> 5238 </para></entry> 5239 </row> 5240 5241 <row> 5242 <entry role="catalog_table_entry"><para role="column_definition"> 5243 <structfield>interval_precision</structfield> <type>cardinal_number</type> 5244 </para> 5245 <para> 5246 Always null, since this information is not applied to return data types in <productname>PostgreSQL</productname> 5247 </para></entry> 5248 </row> 5249 5250 <row> 5251 <entry role="catalog_table_entry"><para role="column_definition"> 5252 <structfield>type_udt_catalog</structfield> <type>sql_identifier</type> 5253 </para> 5254 <para> 5255 Name of the database that the return data type of the function 5256 is defined in (always the current database). Null for a procedure. 5257 </para></entry> 5258 </row> 5259 5260 <row> 5261 <entry role="catalog_table_entry"><para role="column_definition"> 5262 <structfield>type_udt_schema</structfield> <type>sql_identifier</type> 5263 </para> 5264 <para> 5265 Name of the schema that the return data type of the function is 5266 defined in. Null for a procedure. 5267 </para></entry> 5268 </row> 5269 5270 <row> 5271 <entry role="catalog_table_entry"><para role="column_definition"> 5272 <structfield>type_udt_name</structfield> <type>sql_identifier</type> 5273 </para> 5274 <para> 5275 Name of the return data type of the function. Null for a procedure. 5276 </para></entry> 5277 </row> 5278 5279 <row> 5280 <entry role="catalog_table_entry"><para role="column_definition"> 5281 <structfield>scope_catalog</structfield> <type>sql_identifier</type> 5282 </para> 5283 <para> 5284 Applies to a feature not available in <productname>PostgreSQL</productname> 5285 </para></entry> 5286 </row> 5287 5288 <row> 5289 <entry role="catalog_table_entry"><para role="column_definition"> 5290 <structfield>scope_schema</structfield> <type>sql_identifier</type> 5291 </para> 5292 <para> 5293 Applies to a feature not available in <productname>PostgreSQL</productname> 5294 </para></entry> 5295 </row> 5296 5297 <row> 5298 <entry role="catalog_table_entry"><para role="column_definition"> 5299 <structfield>scope_name</structfield> <type>sql_identifier</type> 5300 </para> 5301 <para> 5302 Applies to a feature not available in <productname>PostgreSQL</productname> 5303 </para></entry> 5304 </row> 5305 5306 <row> 5307 <entry role="catalog_table_entry"><para role="column_definition"> 5308 <structfield>maximum_cardinality</structfield> <type>cardinal_number</type> 5309 </para> 5310 <para> 5311 Always null, because arrays always have unlimited maximum cardinality in <productname>PostgreSQL</productname> 5312 </para></entry> 5313 </row> 5314 5315 <row> 5316 <entry role="catalog_table_entry"><para role="column_definition"> 5317 <structfield>dtd_identifier</structfield> <type>sql_identifier</type> 5318 </para> 5319 <para> 5320 An identifier of the data type descriptor of the return data 5321 type of this function, unique among the data type descriptors 5322 pertaining to the function. This is mainly useful for joining 5323 with other instances of such identifiers. (The specific format 5324 of the identifier is not defined and not guaranteed to remain 5325 the same in future versions.) 5326 </para></entry> 5327 </row> 5328 5329 <row> 5330 <entry role="catalog_table_entry"><para role="column_definition"> 5331 <structfield>routine_body</structfield> <type>character_data</type> 5332 </para> 5333 <para> 5334 If the function is an SQL function, then 5335 <literal>SQL</literal>, else <literal>EXTERNAL</literal>. 5336 </para></entry> 5337 </row> 5338 5339 <row> 5340 <entry role="catalog_table_entry"><para role="column_definition"> 5341 <structfield>routine_definition</structfield> <type>character_data</type> 5342 </para> 5343 <para> 5344 The source text of the function (null if the function is not 5345 owned by a currently enabled role). (According to the SQL 5346 standard, this column is only applicable if 5347 <literal>routine_body</literal> is <literal>SQL</literal>, but 5348 in <productname>PostgreSQL</productname> it will contain 5349 whatever source text was specified when the function was 5350 created.) 5351 </para></entry> 5352 </row> 5353 5354 <row> 5355 <entry role="catalog_table_entry"><para role="column_definition"> 5356 <structfield>external_name</structfield> <type>character_data</type> 5357 </para> 5358 <para> 5359 If this function is a C function, then the external name (link 5360 symbol) of the function; else null. (This works out to be the 5361 same value that is shown in 5362 <literal>routine_definition</literal>.) 5363 </para></entry> 5364 </row> 5365 5366 <row> 5367 <entry role="catalog_table_entry"><para role="column_definition"> 5368 <structfield>external_language</structfield> <type>character_data</type> 5369 </para> 5370 <para> 5371 The language the function is written in 5372 </para></entry> 5373 </row> 5374 5375 <row> 5376 <entry role="catalog_table_entry"><para role="column_definition"> 5377 <structfield>parameter_style</structfield> <type>character_data</type> 5378 </para> 5379 <para> 5380 Always <literal>GENERAL</literal> (The SQL standard defines 5381 other parameter styles, which are not available in <productname>PostgreSQL</productname>.) 5382 </para></entry> 5383 </row> 5384 5385 <row> 5386 <entry role="catalog_table_entry"><para role="column_definition"> 5387 <structfield>is_deterministic</structfield> <type>yes_or_no</type> 5388 </para> 5389 <para> 5390 If the function is declared immutable (called deterministic in 5391 the SQL standard), then <literal>YES</literal>, else 5392 <literal>NO</literal>. (You cannot query the other volatility 5393 levels available in <productname>PostgreSQL</productname> through the information schema.) 5394 </para></entry> 5395 </row> 5396 5397 <row> 5398 <entry role="catalog_table_entry"><para role="column_definition"> 5399 <structfield>sql_data_access</structfield> <type>character_data</type> 5400 </para> 5401 <para> 5402 Always <literal>MODIFIES</literal>, meaning that the function 5403 possibly modifies SQL data. This information is not useful for 5404 <productname>PostgreSQL</productname>. 5405 </para></entry> 5406 </row> 5407 5408 <row> 5409 <entry role="catalog_table_entry"><para role="column_definition"> 5410 <structfield>is_null_call</structfield> <type>yes_or_no</type> 5411 </para> 5412 <para> 5413 If the function automatically returns null if any of its 5414 arguments are null, then <literal>YES</literal>, else 5415 <literal>NO</literal>. Null for a procedure. 5416 </para></entry> 5417 </row> 5418 5419 <row> 5420 <entry role="catalog_table_entry"><para role="column_definition"> 5421 <structfield>sql_path</structfield> <type>character_data</type> 5422 </para> 5423 <para> 5424 Applies to a feature not available in <productname>PostgreSQL</productname> 5425 </para></entry> 5426 </row> 5427 5428 <row> 5429 <entry role="catalog_table_entry"><para role="column_definition"> 5430 <structfield>schema_level_routine</structfield> <type>yes_or_no</type> 5431 </para> 5432 <para> 5433 Always <literal>YES</literal> (The opposite would be a method 5434 of a user-defined type, which is a feature not available in 5435 <productname>PostgreSQL</productname>.) 5436 </para></entry> 5437 </row> 5438 5439 <row> 5440 <entry role="catalog_table_entry"><para role="column_definition"> 5441 <structfield>max_dynamic_result_sets</structfield> <type>cardinal_number</type> 5442 </para> 5443 <para> 5444 Applies to a feature not available in <productname>PostgreSQL</productname> 5445 </para></entry> 5446 </row> 5447 5448 <row> 5449 <entry role="catalog_table_entry"><para role="column_definition"> 5450 <structfield>is_user_defined_cast</structfield> <type>yes_or_no</type> 5451 </para> 5452 <para> 5453 Applies to a feature not available in <productname>PostgreSQL</productname> 5454 </para></entry> 5455 </row> 5456 5457 <row> 5458 <entry role="catalog_table_entry"><para role="column_definition"> 5459 <structfield>is_implicitly_invocable</structfield> <type>yes_or_no</type> 5460 </para> 5461 <para> 5462 Applies to a feature not available in <productname>PostgreSQL</productname> 5463 </para></entry> 5464 </row> 5465 5466 <row> 5467 <entry role="catalog_table_entry"><para role="column_definition"> 5468 <structfield>security_type</structfield> <type>character_data</type> 5469 </para> 5470 <para> 5471 If the function runs with the privileges of the current user, 5472 then <literal>INVOKER</literal>, if the function runs with the 5473 privileges of the user who defined it, then 5474 <literal>DEFINER</literal>. 5475 </para></entry> 5476 </row> 5477 5478 <row> 5479 <entry role="catalog_table_entry"><para role="column_definition"> 5480 <structfield>to_sql_specific_catalog</structfield> <type>sql_identifier</type> 5481 </para> 5482 <para> 5483 Applies to a feature not available in <productname>PostgreSQL</productname> 5484 </para></entry> 5485 </row> 5486 5487 <row> 5488 <entry role="catalog_table_entry"><para role="column_definition"> 5489 <structfield>to_sql_specific_schema</structfield> <type>sql_identifier</type> 5490 </para> 5491 <para> 5492 Applies to a feature not available in <productname>PostgreSQL</productname> 5493 </para></entry> 5494 </row> 5495 5496 <row> 5497 <entry role="catalog_table_entry"><para role="column_definition"> 5498 <structfield>to_sql_specific_name</structfield> <type>sql_identifier</type> 5499 </para> 5500 <para> 5501 Applies to a feature not available in <productname>PostgreSQL</productname> 5502 </para></entry> 5503 </row> 5504 5505 <row> 5506 <entry role="catalog_table_entry"><para role="column_definition"> 5507 <structfield>as_locator</structfield> <type>yes_or_no</type> 5508 </para> 5509 <para> 5510 Applies to a feature not available in <productname>PostgreSQL</productname> 5511 </para></entry> 5512 </row> 5513 5514 <row> 5515 <entry role="catalog_table_entry"><para role="column_definition"> 5516 <structfield>created</structfield> <type>time_stamp</type> 5517 </para> 5518 <para> 5519 Applies to a feature not available in <productname>PostgreSQL</productname> 5520 </para></entry> 5521 </row> 5522 5523 <row> 5524 <entry role="catalog_table_entry"><para role="column_definition"> 5525 <structfield>last_altered</structfield> <type>time_stamp</type> 5526 </para> 5527 <para> 5528 Applies to a feature not available in <productname>PostgreSQL</productname> 5529 </para></entry> 5530 </row> 5531 5532 <row> 5533 <entry role="catalog_table_entry"><para role="column_definition"> 5534 <structfield>new_savepoint_level</structfield> <type>yes_or_no</type> 5535 </para> 5536 <para> 5537 Applies to a feature not available in <productname>PostgreSQL</productname> 5538 </para></entry> 5539 </row> 5540 5541 <row> 5542 <entry role="catalog_table_entry"><para role="column_definition"> 5543 <structfield>is_udt_dependent</structfield> <type>yes_or_no</type> 5544 </para> 5545 <para> 5546 Currently always <literal>NO</literal>. The alternative 5547 <literal>YES</literal> applies to a feature not available in 5548 <productname>PostgreSQL</productname>. 5549 </para></entry> 5550 </row> 5551 5552 <row> 5553 <entry role="catalog_table_entry"><para role="column_definition"> 5554 <structfield>result_cast_from_data_type</structfield> <type>character_data</type> 5555 </para> 5556 <para> 5557 Applies to a feature not available in <productname>PostgreSQL</productname> 5558 </para></entry> 5559 </row> 5560 5561 <row> 5562 <entry role="catalog_table_entry"><para role="column_definition"> 5563 <structfield>result_cast_as_locator</structfield> <type>yes_or_no</type> 5564 </para> 5565 <para> 5566 Applies to a feature not available in <productname>PostgreSQL</productname> 5567 </para></entry> 5568 </row> 5569 5570 <row> 5571 <entry role="catalog_table_entry"><para role="column_definition"> 5572 <structfield>result_cast_char_max_length</structfield> <type>cardinal_number</type> 5573 </para> 5574 <para> 5575 Applies to a feature not available in <productname>PostgreSQL</productname> 5576 </para></entry> 5577 </row> 5578 5579 <row> 5580 <entry role="catalog_table_entry"><para role="column_definition"> 5581 <structfield>result_cast_char_octet_length</structfield> <type>cardinal_number</type> 5582 </para> 5583 <para> 5584 Applies to a feature not available in <productname>PostgreSQL</productname> 5585 </para></entry> 5586 </row> 5587 5588 <row> 5589 <entry role="catalog_table_entry"><para role="column_definition"> 5590 <structfield>result_cast_char_set_catalog</structfield> <type>sql_identifier</type> 5591 </para> 5592 <para> 5593 Applies to a feature not available in <productname>PostgreSQL</productname> 5594 </para></entry> 5595 </row> 5596 5597 <row> 5598 <entry role="catalog_table_entry"><para role="column_definition"> 5599 <structfield>result_cast_char_set_schema</structfield> <type>sql_identifier</type> 5600 </para> 5601 <para> 5602 Applies to a feature not available in <productname>PostgreSQL</productname> 5603 </para></entry> 5604 </row> 5605 5606 <row> 5607 <entry role="catalog_table_entry"><para role="column_definition"> 5608 <structfield>result_cast_char_set_name</structfield> <type>sql_identifier</type> 5609 </para> 5610 <para> 5611 Applies to a feature not available in <productname>PostgreSQL</productname> 5612 </para></entry> 5613 </row> 5614 5615 <row> 5616 <entry role="catalog_table_entry"><para role="column_definition"> 5617 <structfield>result_cast_collation_catalog</structfield> <type>sql_identifier</type> 5618 </para> 5619 <para> 5620 Applies to a feature not available in <productname>PostgreSQL</productname> 5621 </para></entry> 5622 </row> 5623 5624 <row> 5625 <entry role="catalog_table_entry"><para role="column_definition"> 5626 <structfield>result_cast_collation_schema</structfield> <type>sql_identifier</type> 5627 </para> 5628 <para> 5629 Applies to a feature not available in <productname>PostgreSQL</productname> 5630 </para></entry> 5631 </row> 5632 5633 <row> 5634 <entry role="catalog_table_entry"><para role="column_definition"> 5635 <structfield>result_cast_collation_name</structfield> <type>sql_identifier</type> 5636 </para> 5637 <para> 5638 Applies to a feature not available in <productname>PostgreSQL</productname> 5639 </para></entry> 5640 </row> 5641 5642 <row> 5643 <entry role="catalog_table_entry"><para role="column_definition"> 5644 <structfield>result_cast_numeric_precision</structfield> <type>cardinal_number</type> 5645 </para> 5646 <para> 5647 Applies to a feature not available in <productname>PostgreSQL</productname> 5648 </para></entry> 5649 </row> 5650 5651 <row> 5652 <entry role="catalog_table_entry"><para role="column_definition"> 5653 <structfield>result_cast_numeric_precision_radix</structfield> <type>cardinal_number</type> 5654 </para> 5655 <para> 5656 Applies to a feature not available in <productname>PostgreSQL</productname> 5657 </para></entry> 5658 </row> 5659 5660 <row> 5661 <entry role="catalog_table_entry"><para role="column_definition"> 5662 <structfield>result_cast_numeric_scale</structfield> <type>cardinal_number</type> 5663 </para> 5664 <para> 5665 Applies to a feature not available in <productname>PostgreSQL</productname> 5666 </para></entry> 5667 </row> 5668 5669 <row> 5670 <entry role="catalog_table_entry"><para role="column_definition"> 5671 <structfield>result_cast_datetime_precision</structfield> <type>cardinal_number</type> 5672 </para> 5673 <para> 5674 Applies to a feature not available in <productname>PostgreSQL</productname> 5675 </para></entry> 5676 </row> 5677 5678 <row> 5679 <entry role="catalog_table_entry"><para role="column_definition"> 5680 <structfield>result_cast_interval_type</structfield> <type>character_data</type> 5681 </para> 5682 <para> 5683 Applies to a feature not available in <productname>PostgreSQL</productname> 5684 </para></entry> 5685 </row> 5686 5687 <row> 5688 <entry role="catalog_table_entry"><para role="column_definition"> 5689 <structfield>result_cast_interval_precision</structfield> <type>cardinal_number</type> 5690 </para> 5691 <para> 5692 Applies to a feature not available in <productname>PostgreSQL</productname> 5693 </para></entry> 5694 </row> 5695 5696 <row> 5697 <entry role="catalog_table_entry"><para role="column_definition"> 5698 <structfield>result_cast_type_udt_catalog</structfield> <type>sql_identifier</type> 5699 </para> 5700 <para> 5701 Applies to a feature not available in <productname>PostgreSQL</productname> 5702 </para></entry> 5703 </row> 5704 5705 <row> 5706 <entry role="catalog_table_entry"><para role="column_definition"> 5707 <structfield>result_cast_type_udt_schema</structfield> <type>sql_identifier</type> 5708 </para> 5709 <para> 5710 Applies to a feature not available in <productname>PostgreSQL</productname> 5711 </para></entry> 5712 </row> 5713 5714 <row> 5715 <entry role="catalog_table_entry"><para role="column_definition"> 5716 <structfield>result_cast_type_udt_name</structfield> <type>sql_identifier</type> 5717 </para> 5718 <para> 5719 Applies to a feature not available in <productname>PostgreSQL</productname> 5720 </para></entry> 5721 </row> 5722 5723 <row> 5724 <entry role="catalog_table_entry"><para role="column_definition"> 5725 <structfield>result_cast_scope_catalog</structfield> <type>sql_identifier</type> 5726 </para> 5727 <para> 5728 Applies to a feature not available in <productname>PostgreSQL</productname> 5729 </para></entry> 5730 </row> 5731 5732 <row> 5733 <entry role="catalog_table_entry"><para role="column_definition"> 5734 <structfield>result_cast_scope_schema</structfield> <type>sql_identifier</type> 5735 </para> 5736 <para> 5737 Applies to a feature not available in <productname>PostgreSQL</productname> 5738 </para></entry> 5739 </row> 5740 5741 <row> 5742 <entry role="catalog_table_entry"><para role="column_definition"> 5743 <structfield>result_cast_scope_name</structfield> <type>sql_identifier</type> 5744 </para> 5745 <para> 5746 Applies to a feature not available in <productname>PostgreSQL</productname> 5747 </para></entry> 5748 </row> 5749 5750 <row> 5751 <entry role="catalog_table_entry"><para role="column_definition"> 5752 <structfield>result_cast_maximum_cardinality</structfield> <type>cardinal_number</type> 5753 </para> 5754 <para> 5755 Applies to a feature not available in <productname>PostgreSQL</productname> 5756 </para></entry> 5757 </row> 5758 5759 <row> 5760 <entry role="catalog_table_entry"><para role="column_definition"> 5761 <structfield>result_cast_dtd_identifier</structfield> <type>sql_identifier</type> 5762 </para> 5763 <para> 5764 Applies to a feature not available in <productname>PostgreSQL</productname> 5765 </para></entry> 5766 </row> 5767 </tbody> 5768 </tgroup> 5769 </table> 5770 </sect1> 5771 5772 <sect1 id="infoschema-schemata"> 5773 <title><literal>schemata</literal></title> 5774 5775 <para> 5776 The view <literal>schemata</literal> contains all schemas in the current 5777 database that the current user has access to (by way of being the owner or 5778 having some privilege). 5779 </para> 5780 5781 <table> 5782 <title><structname>schemata</structname> Columns</title> 5783 <tgroup cols="1"> 5784 <thead> 5785 <row> 5786 <entry role="catalog_table_entry"><para role="column_definition"> 5787 Column Type 5788 </para> 5789 <para> 5790 Description 5791 </para></entry> 5792 </row> 5793 </thead> 5794 5795 <tbody> 5796 <row> 5797 <entry role="catalog_table_entry"><para role="column_definition"> 5798 <structfield>catalog_name</structfield> <type>sql_identifier</type> 5799 </para> 5800 <para> 5801 Name of the database that the schema is contained in (always the current database) 5802 </para></entry> 5803 </row> 5804 5805 <row> 5806 <entry role="catalog_table_entry"><para role="column_definition"> 5807 <structfield>schema_name</structfield> <type>sql_identifier</type> 5808 </para> 5809 <para> 5810 Name of the schema 5811 </para></entry> 5812 </row> 5813 5814 <row> 5815 <entry role="catalog_table_entry"><para role="column_definition"> 5816 <structfield>schema_owner</structfield> <type>sql_identifier</type> 5817 </para> 5818 <para> 5819 Name of the owner of the schema 5820 </para></entry> 5821 </row> 5822 5823 <row> 5824 <entry role="catalog_table_entry"><para role="column_definition"> 5825 <structfield>default_character_set_catalog</structfield> <type>sql_identifier</type> 5826 </para> 5827 <para> 5828 Applies to a feature not available in <productname>PostgreSQL</productname> 5829 </para></entry> 5830 </row> 5831 5832 <row> 5833 <entry role="catalog_table_entry"><para role="column_definition"> 5834 <structfield>default_character_set_schema</structfield> <type>sql_identifier</type> 5835 </para> 5836 <para> 5837 Applies to a feature not available in <productname>PostgreSQL</productname> 5838 </para></entry> 5839 </row> 5840 5841 <row> 5842 <entry role="catalog_table_entry"><para role="column_definition"> 5843 <structfield>default_character_set_name</structfield> <type>sql_identifier</type> 5844 </para> 5845 <para> 5846 Applies to a feature not available in <productname>PostgreSQL</productname> 5847 </para></entry> 5848 </row> 5849 5850 <row> 5851 <entry role="catalog_table_entry"><para role="column_definition"> 5852 <structfield>sql_path</structfield> <type>character_data</type> 5853 </para> 5854 <para> 5855 Applies to a feature not available in <productname>PostgreSQL</productname> 5856 </para></entry> 5857 </row> 5858 </tbody> 5859 </tgroup> 5860 </table> 5861 </sect1> 5862 5863 <sect1 id="infoschema-sequences"> 5864 <title><literal>sequences</literal></title> 5865 5866 <para> 5867 The view <literal>sequences</literal> contains all sequences 5868 defined in the current database. Only those sequences are shown 5869 that the current user has access to (by way of being the owner or 5870 having some privilege). 5871 </para> 5872 5873 <table> 5874 <title><structname>sequences</structname> Columns</title> 5875 <tgroup cols="1"> 5876 <thead> 5877 <row> 5878 <entry role="catalog_table_entry"><para role="column_definition"> 5879 Column Type 5880 </para> 5881 <para> 5882 Description 5883 </para></entry> 5884 </row> 5885 </thead> 5886 5887 <tbody> 5888 <row> 5889 <entry role="catalog_table_entry"><para role="column_definition"> 5890 <structfield>sequence_catalog</structfield> <type>sql_identifier</type> 5891 </para> 5892 <para> 5893 Name of the database that contains the sequence (always the current database) 5894 </para></entry> 5895 </row> 5896 5897 <row> 5898 <entry role="catalog_table_entry"><para role="column_definition"> 5899 <structfield>sequence_schema</structfield> <type>sql_identifier</type> 5900 </para> 5901 <para> 5902 Name of the schema that contains the sequence 5903 </para></entry> 5904 </row> 5905 5906 <row> 5907 <entry role="catalog_table_entry"><para role="column_definition"> 5908 <structfield>sequence_name</structfield> <type>sql_identifier</type> 5909 </para> 5910 <para> 5911 Name of the sequence 5912 </para></entry> 5913 </row> 5914 5915 <row> 5916 <entry role="catalog_table_entry"><para role="column_definition"> 5917 <structfield>data_type</structfield> <type>character_data</type> 5918 </para> 5919 <para> 5920 The data type of the sequence. 5921 </para></entry> 5922 </row> 5923 5924 <row> 5925 <entry role="catalog_table_entry"><para role="column_definition"> 5926 <structfield>numeric_precision</structfield> <type>cardinal_number</type> 5927 </para> 5928 <para> 5929 This column contains the (declared or implicit) precision of 5930 the sequence data type (see above). The precision indicates 5931 the number of significant digits. It can be expressed in 5932 decimal (base 10) or binary (base 2) terms, as specified in the 5933 column <literal>numeric_precision_radix</literal>. 5934 </para></entry> 5935 </row> 5936 5937 <row> 5938 <entry role="catalog_table_entry"><para role="column_definition"> 5939 <structfield>numeric_precision_radix</structfield> <type>cardinal_number</type> 5940 </para> 5941 <para> 5942 This column indicates in which base the values in the columns 5943 <literal>numeric_precision</literal> and 5944 <literal>numeric_scale</literal> are expressed. The value is 5945 either 2 or 10. 5946 </para></entry> 5947 </row> 5948 5949 <row> 5950 <entry role="catalog_table_entry"><para role="column_definition"> 5951 <structfield>numeric_scale</structfield> <type>cardinal_number</type> 5952 </para> 5953 <para> 5954 This column contains the (declared or implicit) scale of the 5955 sequence data type (see above). The scale indicates the number 5956 of significant digits to the right of the decimal point. It 5957 can be expressed in decimal (base 10) or binary (base 2) terms, 5958 as specified in the column 5959 <literal>numeric_precision_radix</literal>. 5960 </para></entry> 5961 </row> 5962 5963 <row> 5964 <entry role="catalog_table_entry"><para role="column_definition"> 5965 <structfield>start_value</structfield> <type>character_data</type> 5966 </para> 5967 <para> 5968 The start value of the sequence 5969 </para></entry> 5970 </row> 5971 5972 <row> 5973 <entry role="catalog_table_entry"><para role="column_definition"> 5974 <structfield>minimum_value</structfield> <type>character_data</type> 5975 </para> 5976 <para> 5977 The minimum value of the sequence 5978 </para></entry> 5979 </row> 5980 5981 <row> 5982 <entry role="catalog_table_entry"><para role="column_definition"> 5983 <structfield>maximum_value</structfield> <type>character_data</type> 5984 </para> 5985 <para> 5986 The maximum value of the sequence 5987 </para></entry> 5988 </row> 5989 5990 <row> 5991 <entry role="catalog_table_entry"><para role="column_definition"> 5992 <structfield>increment</structfield> <type>character_data</type> 5993 </para> 5994 <para> 5995 The increment of the sequence 5996 </para></entry> 5997 </row> 5998 5999 <row> 6000 <entry role="catalog_table_entry"><para role="column_definition"> 6001 <structfield>cycle_option</structfield> <type>yes_or_no</type> 6002 </para> 6003 <para> 6004 <literal>YES</literal> if the sequence cycles, else <literal>NO</literal> 6005 </para></entry> 6006 </row> 6007 </tbody> 6008 </tgroup> 6009 </table> 6010 6011 <para> 6012 Note that in accordance with the SQL standard, the start, minimum, 6013 maximum, and increment values are returned as character strings. 6014 </para> 6015 </sect1> 6016 6017 <sect1 id="infoschema-sql-features"> 6018 <title><literal>sql_features</literal></title> 6019 6020 <para> 6021 The table <literal>sql_features</literal> contains information 6022 about which formal features defined in the SQL standard are 6023 supported by <productname>PostgreSQL</productname>. This is the 6024 same information that is presented in <xref linkend="features"/>. 6025 There you can also find some additional background information. 6026 </para> 6027 6028 <table> 6029 <title><structname>sql_features</structname> Columns</title> 6030 <tgroup cols="1"> 6031 <thead> 6032 <row> 6033 <entry role="catalog_table_entry"><para role="column_definition"> 6034 Column Type 6035 </para> 6036 <para> 6037 Description 6038 </para></entry> 6039 </row> 6040 </thead> 6041 6042 <tbody> 6043 <row> 6044 <entry role="catalog_table_entry"><para role="column_definition"> 6045 <structfield>feature_id</structfield> <type>character_data</type> 6046 </para> 6047 <para> 6048 Identifier string of the feature 6049 </para></entry> 6050 </row> 6051 6052 <row> 6053 <entry role="catalog_table_entry"><para role="column_definition"> 6054 <structfield>feature_name</structfield> <type>character_data</type> 6055 </para> 6056 <para> 6057 Descriptive name of the feature 6058 </para></entry> 6059 </row> 6060 6061 <row> 6062 <entry role="catalog_table_entry"><para role="column_definition"> 6063 <structfield>sub_feature_id</structfield> <type>character_data</type> 6064 </para> 6065 <para> 6066 Identifier string of the subfeature, or a zero-length string if not a subfeature 6067 </para></entry> 6068 </row> 6069 6070 <row> 6071 <entry role="catalog_table_entry"><para role="column_definition"> 6072 <structfield>sub_feature_name</structfield> <type>character_data</type> 6073 </para> 6074 <para> 6075 Descriptive name of the subfeature, or a zero-length string if not a subfeature 6076 </para></entry> 6077 </row> 6078 6079 <row> 6080 <entry role="catalog_table_entry"><para role="column_definition"> 6081 <structfield>is_supported</structfield> <type>yes_or_no</type> 6082 </para> 6083 <para> 6084 <literal>YES</literal> if the feature is fully supported by the 6085 current version of <productname>PostgreSQL</productname>, <literal>NO</literal> if not 6086 </para></entry> 6087 </row> 6088 6089 <row> 6090 <entry role="catalog_table_entry"><para role="column_definition"> 6091 <structfield>is_verified_by</structfield> <type>character_data</type> 6092 </para> 6093 <para> 6094 Always null, since the <productname>PostgreSQL</productname> development group does not 6095 perform formal testing of feature conformance 6096 </para></entry> 6097 </row> 6098 6099 <row> 6100 <entry role="catalog_table_entry"><para role="column_definition"> 6101 <structfield>comments</structfield> <type>character_data</type> 6102 </para> 6103 <para> 6104 Possibly a comment about the supported status of the feature 6105 </para></entry> 6106 </row> 6107 </tbody> 6108 </tgroup> 6109 </table> 6110 </sect1> 6111 6112 <sect1 id="infoschema-sql-implementation-info"> 6113 <title><literal>sql_implementation_info</literal></title> 6114 6115 <para> 6116 The table <literal>sql_implementation_info</literal> contains 6117 information about various aspects that are left 6118 implementation-defined by the SQL standard. This information is 6119 primarily intended for use in the context of the ODBC interface; 6120 users of other interfaces will probably find this information to be 6121 of little use. For this reason, the individual implementation 6122 information items are not described here; you will find them in the 6123 description of the ODBC interface. 6124 </para> 6125 6126 <table> 6127 <title><structname>sql_implementation_info</structname> Columns</title> 6128 <tgroup cols="1"> 6129 <thead> 6130 <row> 6131 <entry role="catalog_table_entry"><para role="column_definition"> 6132 Column Type 6133 </para> 6134 <para> 6135 Description 6136 </para></entry> 6137 </row> 6138 </thead> 6139 6140 <tbody> 6141 <row> 6142 <entry role="catalog_table_entry"><para role="column_definition"> 6143 <structfield>implementation_info_id</structfield> <type>character_data</type> 6144 </para> 6145 <para> 6146 Identifier string of the implementation information item 6147 </para></entry> 6148 </row> 6149 6150 <row> 6151 <entry role="catalog_table_entry"><para role="column_definition"> 6152 <structfield>implementation_info_name</structfield> <type>character_data</type> 6153 </para> 6154 <para> 6155 Descriptive name of the implementation information item 6156 </para></entry> 6157 </row> 6158 6159 <row> 6160 <entry role="catalog_table_entry"><para role="column_definition"> 6161 <structfield>integer_value</structfield> <type>cardinal_number</type> 6162 </para> 6163 <para> 6164 Value of the implementation information item, or null if the 6165 value is contained in the column 6166 <literal>character_value</literal> 6167 </para></entry> 6168 </row> 6169 6170 <row> 6171 <entry role="catalog_table_entry"><para role="column_definition"> 6172 <structfield>character_value</structfield> <type>character_data</type> 6173 </para> 6174 <para> 6175 Value of the implementation information item, or null if the 6176 value is contained in the column 6177 <literal>integer_value</literal> 6178 </para></entry> 6179 </row> 6180 6181 <row> 6182 <entry role="catalog_table_entry"><para role="column_definition"> 6183 <structfield>comments</structfield> <type>character_data</type> 6184 </para> 6185 <para> 6186 Possibly a comment pertaining to the implementation information item 6187 </para></entry> 6188 </row> 6189 </tbody> 6190 </tgroup> 6191 </table> 6192 </sect1> 6193 6194 <sect1 id="infoschema-sql-parts"> 6195 <title><literal>sql_parts</literal></title> 6196 6197 <para> 6198 The table <literal>sql_parts</literal> contains information about 6199 which of the several parts of the SQL standard are supported by 6200 <productname>PostgreSQL</productname>. 6201 </para> 6202 6203 <table> 6204 <title><structname>sql_parts</structname> Columns</title> 6205 <tgroup cols="1"> 6206 <thead> 6207 <row> 6208 <entry role="catalog_table_entry"><para role="column_definition"> 6209 Column Type 6210 </para> 6211 <para> 6212 Description 6213 </para></entry> 6214 </row> 6215 </thead> 6216 6217 <tbody> 6218 <row> 6219 <entry role="catalog_table_entry"><para role="column_definition"> 6220 <structfield>feature_id</structfield> <type>character_data</type> 6221 </para> 6222 <para> 6223 An identifier string containing the number of the part 6224 </para></entry> 6225 </row> 6226 6227 <row> 6228 <entry role="catalog_table_entry"><para role="column_definition"> 6229 <structfield>feature_name</structfield> <type>character_data</type> 6230 </para> 6231 <para> 6232 Descriptive name of the part 6233 </para></entry> 6234 </row> 6235 6236 <row> 6237 <entry role="catalog_table_entry"><para role="column_definition"> 6238 <structfield>is_supported</structfield> <type>yes_or_no</type> 6239 </para> 6240 <para> 6241 <literal>YES</literal> if the part is fully supported by the 6242 current version of <productname>PostgreSQL</productname>, 6243 <literal>NO</literal> if not 6244 </para></entry> 6245 </row> 6246 6247 <row> 6248 <entry role="catalog_table_entry"><para role="column_definition"> 6249 <structfield>is_verified_by</structfield> <type>character_data</type> 6250 </para> 6251 <para> 6252 Always null, since the <productname>PostgreSQL</productname> development group does not 6253 perform formal testing of feature conformance 6254 </para></entry> 6255 </row> 6256 6257 <row> 6258 <entry role="catalog_table_entry"><para role="column_definition"> 6259 <structfield>comments</structfield> <type>character_data</type> 6260 </para> 6261 <para> 6262 Possibly a comment about the supported status of the part 6263 </para></entry> 6264 </row> 6265 </tbody> 6266 </tgroup> 6267 </table> 6268 </sect1> 6269 6270 <sect1 id="infoschema-sql-sizing"> 6271 <title><literal>sql_sizing</literal></title> 6272 6273 <para> 6274 The table <literal>sql_sizing</literal> contains information about 6275 various size limits and maximum values in 6276 <productname>PostgreSQL</productname>. This information is 6277 primarily intended for use in the context of the ODBC interface; 6278 users of other interfaces will probably find this information to be 6279 of little use. For this reason, the individual sizing items are 6280 not described here; you will find them in the description of the 6281 ODBC interface. 6282 </para> 6283 6284 <table> 6285 <title><structname>sql_sizing</structname> Columns</title> 6286 <tgroup cols="1"> 6287 <thead> 6288 <row> 6289 <entry role="catalog_table_entry"><para role="column_definition"> 6290 Column Type 6291 </para> 6292 <para> 6293 Description 6294 </para></entry> 6295 </row> 6296 </thead> 6297 6298 <tbody> 6299 <row> 6300 <entry role="catalog_table_entry"><para role="column_definition"> 6301 <structfield>sizing_id</structfield> <type>cardinal_number</type> 6302 </para> 6303 <para> 6304 Identifier of the sizing item 6305 </para></entry> 6306 </row> 6307 6308 <row> 6309 <entry role="catalog_table_entry"><para role="column_definition"> 6310 <structfield>sizing_name</structfield> <type>character_data</type> 6311 </para> 6312 <para> 6313 Descriptive name of the sizing item 6314 </para></entry> 6315 </row> 6316 6317 <row> 6318 <entry role="catalog_table_entry"><para role="column_definition"> 6319 <structfield>supported_value</structfield> <type>cardinal_number</type> 6320 </para> 6321 <para> 6322 Value of the sizing item, or 0 if the size is unlimited or 6323 cannot be determined, or null if the features for which the 6324 sizing item is applicable are not supported 6325 </para></entry> 6326 </row> 6327 6328 <row> 6329 <entry role="catalog_table_entry"><para role="column_definition"> 6330 <structfield>comments</structfield> <type>character_data</type> 6331 </para> 6332 <para> 6333 Possibly a comment pertaining to the sizing item 6334 </para></entry> 6335 </row> 6336 </tbody> 6337 </tgroup> 6338 </table> 6339 </sect1> 6340 6341 <sect1 id="infoschema-table-constraints"> 6342 <title><literal>table_constraints</literal></title> 6343 6344 <para> 6345 The view <literal>table_constraints</literal> contains all 6346 constraints belonging to tables that the current user owns or has 6347 some privilege other than <literal>SELECT</literal> on. 6348 </para> 6349 6350 <table> 6351 <title><structname>table_constraints</structname> Columns</title> 6352 <tgroup cols="1"> 6353 <thead> 6354 <row> 6355 <entry role="catalog_table_entry"><para role="column_definition"> 6356 Column Type 6357 </para> 6358 <para> 6359 Description 6360 </para></entry> 6361 </row> 6362 </thead> 6363 6364 <tbody> 6365 <row> 6366 <entry role="catalog_table_entry"><para role="column_definition"> 6367 <structfield>constraint_catalog</structfield> <type>sql_identifier</type> 6368 </para> 6369 <para> 6370 Name of the database that contains the constraint (always the current database) 6371 </para></entry> 6372 </row> 6373 6374 <row> 6375 <entry role="catalog_table_entry"><para role="column_definition"> 6376 <structfield>constraint_schema</structfield> <type>sql_identifier</type> 6377 </para> 6378 <para> 6379 Name of the schema that contains the constraint 6380 </para></entry> 6381 </row> 6382 6383 <row> 6384 <entry role="catalog_table_entry"><para role="column_definition"> 6385 <structfield>constraint_name</structfield> <type>sql_identifier</type> 6386 </para> 6387 <para> 6388 Name of the constraint 6389 </para></entry> 6390 </row> 6391 6392 <row> 6393 <entry role="catalog_table_entry"><para role="column_definition"> 6394 <structfield>table_catalog</structfield> <type>sql_identifier</type> 6395 </para> 6396 <para> 6397 Name of the database that contains the table (always the current database) 6398 </para></entry> 6399 </row> 6400 6401 <row> 6402 <entry role="catalog_table_entry"><para role="column_definition"> 6403 <structfield>table_schema</structfield> <type>sql_identifier</type> 6404 </para> 6405 <para> 6406 Name of the schema that contains the table 6407 </para></entry> 6408 </row> 6409 6410 <row> 6411 <entry role="catalog_table_entry"><para role="column_definition"> 6412 <structfield>table_name</structfield> <type>sql_identifier</type> 6413 </para> 6414 <para> 6415 Name of the table 6416 </para></entry> 6417 </row> 6418 6419 <row> 6420 <entry role="catalog_table_entry"><para role="column_definition"> 6421 <structfield>constraint_type</structfield> <type>character_data</type> 6422 </para> 6423 <para> 6424 Type of the constraint: <literal>CHECK</literal>, 6425 <literal>FOREIGN KEY</literal>, <literal>PRIMARY KEY</literal>, 6426 or <literal>UNIQUE</literal> 6427 </para></entry> 6428 </row> 6429 6430 <row> 6431 <entry role="catalog_table_entry"><para role="column_definition"> 6432 <structfield>is_deferrable</structfield> <type>yes_or_no</type> 6433 </para> 6434 <para> 6435 <literal>YES</literal> if the constraint is deferrable, <literal>NO</literal> if not 6436 </para></entry> 6437 </row> 6438 6439 <row> 6440 <entry role="catalog_table_entry"><para role="column_definition"> 6441 <structfield>initially_deferred</structfield> <type>yes_or_no</type> 6442 </para> 6443 <para> 6444 <literal>YES</literal> if the constraint is deferrable and initially deferred, <literal>NO</literal> if not 6445 </para></entry> 6446 </row> 6447 6448 <row> 6449 <entry role="catalog_table_entry"><para role="column_definition"> 6450 <structfield>enforced</structfield> <type>yes_or_no</type> 6451 </para> 6452 <para> 6453 Applies to a feature not available in 6454 <productname>PostgreSQL</productname> (currently always 6455 <literal>YES</literal>) 6456 </para></entry> 6457 </row> 6458 </tbody> 6459 </tgroup> 6460 </table> 6461 </sect1> 6462 6463 <sect1 id="infoschema-table-privileges"> 6464 <title><literal>table_privileges</literal></title> 6465 6466 <para> 6467 The view <literal>table_privileges</literal> identifies all 6468 privileges granted on tables or views to a currently enabled role 6469 or by a currently enabled role. There is one row for each 6470 combination of table, grantor, and grantee. 6471 </para> 6472 6473 <table> 6474 <title><structname>table_privileges</structname> Columns</title> 6475 <tgroup cols="1"> 6476 <thead> 6477 <row> 6478 <entry role="catalog_table_entry"><para role="column_definition"> 6479 Column Type 6480 </para> 6481 <para> 6482 Description 6483 </para></entry> 6484 </row> 6485 </thead> 6486 6487 <tbody> 6488 <row> 6489 <entry role="catalog_table_entry"><para role="column_definition"> 6490 <structfield>grantor</structfield> <type>sql_identifier</type> 6491 </para> 6492 <para> 6493 Name of the role that granted the privilege 6494 </para></entry> 6495 </row> 6496 6497 <row> 6498 <entry role="catalog_table_entry"><para role="column_definition"> 6499 <structfield>grantee</structfield> <type>sql_identifier</type> 6500 </para> 6501 <para> 6502 Name of the role that the privilege was granted to 6503 </para></entry> 6504 </row> 6505 6506 <row> 6507 <entry role="catalog_table_entry"><para role="column_definition"> 6508 <structfield>table_catalog</structfield> <type>sql_identifier</type> 6509 </para> 6510 <para> 6511 Name of the database that contains the table (always the current database) 6512 </para></entry> 6513 </row> 6514 6515 <row> 6516 <entry role="catalog_table_entry"><para role="column_definition"> 6517 <structfield>table_schema</structfield> <type>sql_identifier</type> 6518 </para> 6519 <para> 6520 Name of the schema that contains the table 6521 </para></entry> 6522 </row> 6523 6524 <row> 6525 <entry role="catalog_table_entry"><para role="column_definition"> 6526 <structfield>table_name</structfield> <type>sql_identifier</type> 6527 </para> 6528 <para> 6529 Name of the table 6530 </para></entry> 6531 </row> 6532 6533 <row> 6534 <entry role="catalog_table_entry"><para role="column_definition"> 6535 <structfield>privilege_type</structfield> <type>character_data</type> 6536 </para> 6537 <para> 6538 Type of the privilege: <literal>SELECT</literal>, 6539 <literal>INSERT</literal>, <literal>UPDATE</literal>, 6540 <literal>DELETE</literal>, <literal>TRUNCATE</literal>, 6541 <literal>REFERENCES</literal>, or <literal>TRIGGER</literal> 6542 </para></entry> 6543 </row> 6544 6545 <row> 6546 <entry role="catalog_table_entry"><para role="column_definition"> 6547 <structfield>is_grantable</structfield> <type>yes_or_no</type> 6548 </para> 6549 <para> 6550 <literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not 6551 </para></entry> 6552 </row> 6553 6554 <row> 6555 <entry role="catalog_table_entry"><para role="column_definition"> 6556 <structfield>with_hierarchy</structfield> <type>yes_or_no</type> 6557 </para> 6558 <para> 6559 In the SQL standard, <literal>WITH HIERARCHY OPTION</literal> 6560 is a separate (sub-)privilege allowing certain operations on 6561 table inheritance hierarchies. In PostgreSQL, this is included 6562 in the <literal>SELECT</literal> privilege, so this column 6563 shows <literal>YES</literal> if the privilege 6564 is <literal>SELECT</literal>, else <literal>NO</literal>. 6565 </para></entry> 6566 </row> 6567 </tbody> 6568 </tgroup> 6569 </table> 6570 </sect1> 6571 6572 <sect1 id="infoschema-tables"> 6573 <title><literal>tables</literal></title> 6574 6575 <para> 6576 The view <literal>tables</literal> contains all tables and views 6577 defined in the current database. Only those tables and views are 6578 shown that the current user has access to (by way of being the 6579 owner or having some privilege). 6580 </para> 6581 6582 <table> 6583 <title><structname>tables</structname> Columns</title> 6584 <tgroup cols="1"> 6585 <thead> 6586 <row> 6587 <entry role="catalog_table_entry"><para role="column_definition"> 6588 Column Type 6589 </para> 6590 <para> 6591 Description 6592 </para></entry> 6593 </row> 6594 </thead> 6595 6596 <tbody> 6597 <row> 6598 <entry role="catalog_table_entry"><para role="column_definition"> 6599 <structfield>table_catalog</structfield> <type>sql_identifier</type> 6600 </para> 6601 <para> 6602 Name of the database that contains the table (always the current database) 6603 </para></entry> 6604 </row> 6605 6606 <row> 6607 <entry role="catalog_table_entry"><para role="column_definition"> 6608 <structfield>table_schema</structfield> <type>sql_identifier</type> 6609 </para> 6610 <para> 6611 Name of the schema that contains the table 6612 </para></entry> 6613 </row> 6614 6615 <row> 6616 <entry role="catalog_table_entry"><para role="column_definition"> 6617 <structfield>table_name</structfield> <type>sql_identifier</type> 6618 </para> 6619 <para> 6620 Name of the table 6621 </para></entry> 6622 </row> 6623 6624 <row> 6625 <entry role="catalog_table_entry"><para role="column_definition"> 6626 <structfield>table_type</structfield> <type>character_data</type> 6627 </para> 6628 <para> 6629 Type of the table: <literal>BASE TABLE</literal> for a 6630 persistent base table (the normal table type), 6631 <literal>VIEW</literal> for a view, <literal>FOREIGN</literal> 6632 for a foreign table, or 6633 <literal>LOCAL TEMPORARY</literal> for a temporary table 6634 </para></entry> 6635 </row> 6636 6637 <row> 6638 <entry role="catalog_table_entry"><para role="column_definition"> 6639 <structfield>self_referencing_column_name</structfield> <type>sql_identifier</type> 6640 </para> 6641 <para> 6642 Applies to a feature not available in <productname>PostgreSQL</productname> 6643 </para></entry> 6644 </row> 6645 6646 <row> 6647 <entry role="catalog_table_entry"><para role="column_definition"> 6648 <structfield>reference_generation</structfield> <type>character_data</type> 6649 </para> 6650 <para> 6651 Applies to a feature not available in <productname>PostgreSQL</productname> 6652 </para></entry> 6653 </row> 6654 6655 <row> 6656 <entry role="catalog_table_entry"><para role="column_definition"> 6657 <structfield>user_defined_type_catalog</structfield> <type>sql_identifier</type> 6658 </para> 6659 <para> 6660 If the table is a typed table, the name of the database that 6661 contains the underlying data type (always the current 6662 database), else null. 6663 </para></entry> 6664 </row> 6665 6666 <row> 6667 <entry role="catalog_table_entry"><para role="column_definition"> 6668 <structfield>user_defined_type_schema</structfield> <type>sql_identifier</type> 6669 </para> 6670 <para> 6671 If the table is a typed table, the name of the schema that 6672 contains the underlying data type, else null. 6673 </para></entry> 6674 </row> 6675 6676 <row> 6677 <entry role="catalog_table_entry"><para role="column_definition"> 6678 <structfield>user_defined_type_name</structfield> <type>sql_identifier</type> 6679 </para> 6680 <para> 6681 If the table is a typed table, the name of the underlying data 6682 type, else null. 6683 </para></entry> 6684 </row> 6685 6686 <row> 6687 <entry role="catalog_table_entry"><para role="column_definition"> 6688 <structfield>is_insertable_into</structfield> <type>yes_or_no</type> 6689 </para> 6690 <para> 6691 <literal>YES</literal> if the table is insertable into, 6692 <literal>NO</literal> if not (Base tables are always insertable 6693 into, views not necessarily.) 6694 </para></entry> 6695 </row> 6696 6697 <row> 6698 <entry role="catalog_table_entry"><para role="column_definition"> 6699 <structfield>is_typed</structfield> <type>yes_or_no</type> 6700 </para> 6701 <para> 6702 <literal>YES</literal> if the table is a typed table, <literal>NO</literal> if not 6703 </para></entry> 6704 </row> 6705 6706 <row> 6707 <entry role="catalog_table_entry"><para role="column_definition"> 6708 <structfield>commit_action</structfield> <type>character_data</type> 6709 </para> 6710 <para> 6711 Not yet implemented 6712 </para></entry> 6713 </row> 6714 </tbody> 6715 </tgroup> 6716 </table> 6717 </sect1> 6718 6719 <sect1 id="infoschema-transforms"> 6720 <title><literal>transforms</literal></title> 6721 6722 <para> 6723 The view <literal>transforms</literal> contains information about the 6724 transforms defined in the current database. More precisely, it contains a 6725 row for each function contained in a transform (the <quote>from SQL</quote> 6726 or <quote>to SQL</quote> function). 6727 </para> 6728 6729 <table> 6730 <title><structname>transforms</structname> Columns</title> 6731 <tgroup cols="1"> 6732 <thead> 6733 <row> 6734 <entry role="catalog_table_entry"><para role="column_definition"> 6735 Column Type 6736 </para> 6737 <para> 6738 Description 6739 </para></entry> 6740 </row> 6741 </thead> 6742 6743 <tbody> 6744 <row> 6745 <entry role="catalog_table_entry"><para role="column_definition"> 6746 <structfield>udt_catalog</structfield> <type>sql_identifier</type> 6747 </para> 6748 <para> 6749 Name of the database that contains the type the transform is for (always the current database) 6750 </para></entry> 6751 </row> 6752 6753 <row> 6754 <entry role="catalog_table_entry"><para role="column_definition"> 6755 <structfield>udt_schema</structfield> <type>sql_identifier</type> 6756 </para> 6757 <para> 6758 Name of the schema that contains the type the transform is for 6759 </para></entry> 6760 </row> 6761 6762 <row> 6763 <entry role="catalog_table_entry"><para role="column_definition"> 6764 <structfield>udt_name</structfield> <type>sql_identifier</type> 6765 </para> 6766 <para> 6767 Name of the type the transform is for 6768 </para></entry> 6769 </row> 6770 6771 <row> 6772 <entry role="catalog_table_entry"><para role="column_definition"> 6773 <structfield>specific_catalog</structfield> <type>sql_identifier</type> 6774 </para> 6775 <para> 6776 Name of the database containing the function (always the current database) 6777 </para></entry> 6778 </row> 6779 6780 <row> 6781 <entry role="catalog_table_entry"><para role="column_definition"> 6782 <structfield>specific_schema</structfield> <type>sql_identifier</type> 6783 </para> 6784 <para> 6785 Name of the schema containing the function 6786 </para></entry> 6787 </row> 6788 6789 <row> 6790 <entry role="catalog_table_entry"><para role="column_definition"> 6791 <structfield>specific_name</structfield> <type>sql_identifier</type> 6792 </para> 6793 <para> 6794 The <quote>specific name</quote> of the function. See <xref linkend="infoschema-routines"/> for more information. 6795 </para></entry> 6796 </row> 6797 6798 <row> 6799 <entry role="catalog_table_entry"><para role="column_definition"> 6800 <structfield>group_name</structfield> <type>sql_identifier</type> 6801 </para> 6802 <para> 6803 The SQL standard allows defining transforms in <quote>groups</quote>, 6804 and selecting a group at run time. PostgreSQL does not support this. 6805 Instead, transforms are specific to a language. As a compromise, this 6806 field contains the language the transform is for. 6807 </para></entry> 6808 </row> 6809 6810 <row> 6811 <entry role="catalog_table_entry"><para role="column_definition"> 6812 <structfield>transform_type</structfield> <type>character_data</type> 6813 </para> 6814 <para> 6815 <literal>FROM SQL</literal> or <literal>TO SQL</literal> 6816 </para></entry> 6817 </row> 6818 </tbody> 6819 </tgroup> 6820 </table> 6821 </sect1> 6822 6823 <sect1 id="infoschema-triggered-update-columns"> 6824 <title><literal>triggered_update_columns</literal></title> 6825 6826 <para> 6827 For triggers in the current database that specify a column list 6828 (like <literal>UPDATE OF column1, column2</literal>), the 6829 view <literal>triggered_update_columns</literal> identifies these 6830 columns. Triggers that do not specify a column list are not 6831 included in this view. Only those columns are shown that the 6832 current user owns or has some privilege other than 6833 <literal>SELECT</literal> on. 6834 </para> 6835 6836 <table> 6837 <title><structname>triggered_update_columns</structname> Columns</title> 6838 <tgroup cols="1"> 6839 <thead> 6840 <row> 6841 <entry role="catalog_table_entry"><para role="column_definition"> 6842 Column Type 6843 </para> 6844 <para> 6845 Description 6846 </para></entry> 6847 </row> 6848 </thead> 6849 6850 <tbody> 6851 <row> 6852 <entry role="catalog_table_entry"><para role="column_definition"> 6853 <structfield>trigger_catalog</structfield> <type>sql_identifier</type> 6854 </para> 6855 <para> 6856 Name of the database that contains the trigger (always the current database) 6857 </para></entry> 6858 </row> 6859 6860 <row> 6861 <entry role="catalog_table_entry"><para role="column_definition"> 6862 <structfield>trigger_schema</structfield> <type>sql_identifier</type> 6863 </para> 6864 <para> 6865 Name of the schema that contains the trigger 6866 </para></entry> 6867 </row> 6868 6869 <row> 6870 <entry role="catalog_table_entry"><para role="column_definition"> 6871 <structfield>trigger_name</structfield> <type>sql_identifier</type> 6872 </para> 6873 <para> 6874 Name of the trigger 6875 </para></entry> 6876 </row> 6877 6878 <row> 6879 <entry role="catalog_table_entry"><para role="column_definition"> 6880 <structfield>event_object_catalog</structfield> <type>sql_identifier</type> 6881 </para> 6882 <para> 6883 Name of the database that contains the table that the trigger 6884 is defined on (always the current database) 6885 </para></entry> 6886 </row> 6887 6888 <row> 6889 <entry role="catalog_table_entry"><para role="column_definition"> 6890 <structfield>event_object_schema</structfield> <type>sql_identifier</type> 6891 </para> 6892 <para> 6893 Name of the schema that contains the table that the trigger is defined on 6894 </para></entry> 6895 </row> 6896 6897 <row> 6898 <entry role="catalog_table_entry"><para role="column_definition"> 6899 <structfield>event_object_table</structfield> <type>sql_identifier</type> 6900 </para> 6901 <para> 6902 Name of the table that the trigger is defined on 6903 </para></entry> 6904 </row> 6905 6906 <row> 6907 <entry role="catalog_table_entry"><para role="column_definition"> 6908 <structfield>event_object_column</structfield> <type>sql_identifier</type> 6909 </para> 6910 <para> 6911 Name of the column that the trigger is defined on 6912 </para></entry> 6913 </row> 6914 </tbody> 6915 </tgroup> 6916 </table> 6917 </sect1> 6918 6919 <sect1 id="infoschema-triggers"> 6920 <title><literal>triggers</literal></title> 6921 6922 <para> 6923 The view <literal>triggers</literal> contains all triggers defined 6924 in the current database on tables and views that the current user owns 6925 or has some privilege other than <literal>SELECT</literal> on. 6926 </para> 6927 6928 <table> 6929 <title><structname>triggers</structname> Columns</title> 6930 <tgroup cols="1"> 6931 <thead> 6932 <row> 6933 <entry role="catalog_table_entry"><para role="column_definition"> 6934 Column Type 6935 </para> 6936 <para> 6937 Description 6938 </para></entry> 6939 </row> 6940 </thead> 6941 6942 <tbody> 6943 <row> 6944 <entry role="catalog_table_entry"><para role="column_definition"> 6945 <structfield>trigger_catalog</structfield> <type>sql_identifier</type> 6946 </para> 6947 <para> 6948 Name of the database that contains the trigger (always the current database) 6949 </para></entry> 6950 </row> 6951 6952 <row> 6953 <entry role="catalog_table_entry"><para role="column_definition"> 6954 <structfield>trigger_schema</structfield> <type>sql_identifier</type> 6955 </para> 6956 <para> 6957 Name of the schema that contains the trigger 6958 </para></entry> 6959 </row> 6960 6961 <row> 6962 <entry role="catalog_table_entry"><para role="column_definition"> 6963 <structfield>trigger_name</structfield> <type>sql_identifier</type> 6964 </para> 6965 <para> 6966 Name of the trigger 6967 </para></entry> 6968 </row> 6969 6970 <row> 6971 <entry role="catalog_table_entry"><para role="column_definition"> 6972 <structfield>event_manipulation</structfield> <type>character_data</type> 6973 </para> 6974 <para> 6975 Event that fires the trigger (<literal>INSERT</literal>, 6976 <literal>UPDATE</literal>, or <literal>DELETE</literal>) 6977 </para></entry> 6978 </row> 6979 6980 <row> 6981 <entry role="catalog_table_entry"><para role="column_definition"> 6982 <structfield>event_object_catalog</structfield> <type>sql_identifier</type> 6983 </para> 6984 <para> 6985 Name of the database that contains the table that the trigger 6986 is defined on (always the current database) 6987 </para></entry> 6988 </row> 6989 6990 <row> 6991 <entry role="catalog_table_entry"><para role="column_definition"> 6992 <structfield>event_object_schema</structfield> <type>sql_identifier</type> 6993 </para> 6994 <para> 6995 Name of the schema that contains the table that the trigger is defined on 6996 </para></entry> 6997 </row> 6998 6999 <row> 7000 <entry role="catalog_table_entry"><para role="column_definition"> 7001 <structfield>event_object_table</structfield> <type>sql_identifier</type> 7002 </para> 7003 <para> 7004 Name of the table that the trigger is defined on 7005 </para></entry> 7006 </row> 7007 7008 <row> 7009 <entry role="catalog_table_entry"><para role="column_definition"> 7010 <structfield>action_order</structfield> <type>cardinal_number</type> 7011 </para> 7012 <para> 7013 Firing order among triggers on the same table having the same 7014 <literal>event_manipulation</literal>, 7015 <literal>action_timing</literal>, and 7016 <literal>action_orientation</literal>. In 7017 <productname>PostgreSQL</productname>, triggers are fired in name 7018 order, so this column reflects that. 7019 </para></entry> 7020 </row> 7021 7022 <row> 7023 <entry role="catalog_table_entry"><para role="column_definition"> 7024 <structfield>action_condition</structfield> <type>character_data</type> 7025 </para> 7026 <para> 7027 <literal>WHEN</literal> condition of the trigger, null if none 7028 (also null if the table is not owned by a currently enabled 7029 role) 7030 </para></entry> 7031 </row> 7032 7033 <row> 7034 <entry role="catalog_table_entry"><para role="column_definition"> 7035 <structfield>action_statement</structfield> <type>character_data</type> 7036 </para> 7037 <para> 7038 Statement that is executed by the trigger (currently always 7039 <literal>EXECUTE FUNCTION 7040 <replaceable>function</replaceable>(...)</literal>) 7041 </para></entry> 7042 </row> 7043 7044 <row> 7045 <entry role="catalog_table_entry"><para role="column_definition"> 7046 <structfield>action_orientation</structfield> <type>character_data</type> 7047 </para> 7048 <para> 7049 Identifies whether the trigger fires once for each processed 7050 row or once for each statement (<literal>ROW</literal> or 7051 <literal>STATEMENT</literal>) 7052 </para></entry> 7053 </row> 7054 7055 <row> 7056 <entry role="catalog_table_entry"><para role="column_definition"> 7057 <structfield>action_timing</structfield> <type>character_data</type> 7058 </para> 7059 <para> 7060 Time at which the trigger fires (<literal>BEFORE</literal>, 7061 <literal>AFTER</literal>, or <literal>INSTEAD OF</literal>) 7062 </para></entry> 7063 </row> 7064 7065 <row> 7066 <entry role="catalog_table_entry"><para role="column_definition"> 7067 <structfield>action_reference_old_table</structfield> <type>sql_identifier</type> 7068 </para> 7069 <para> 7070 Name of the <quote>old</quote> transition table, or null if none 7071 </para></entry> 7072 </row> 7073 7074 <row> 7075 <entry role="catalog_table_entry"><para role="column_definition"> 7076 <structfield>action_reference_new_table</structfield> <type>sql_identifier</type> 7077 </para> 7078 <para> 7079 Name of the <quote>new</quote> transition table, or null if none 7080 </para></entry> 7081 </row> 7082 7083 <row> 7084 <entry role="catalog_table_entry"><para role="column_definition"> 7085 <structfield>action_reference_old_row</structfield> <type>sql_identifier</type> 7086 </para> 7087 <para> 7088 Applies to a feature not available in <productname>PostgreSQL</productname> 7089 </para></entry> 7090 </row> 7091 7092 <row> 7093 <entry role="catalog_table_entry"><para role="column_definition"> 7094 <structfield>action_reference_new_row</structfield> <type>sql_identifier</type> 7095 </para> 7096 <para> 7097 Applies to a feature not available in <productname>PostgreSQL</productname> 7098 </para></entry> 7099 </row> 7100 7101 <row> 7102 <entry role="catalog_table_entry"><para role="column_definition"> 7103 <structfield>created</structfield> <type>time_stamp</type> 7104 </para> 7105 <para> 7106 Applies to a feature not available in <productname>PostgreSQL</productname> 7107 </para></entry> 7108 </row> 7109 </tbody> 7110 </tgroup> 7111 </table> 7112 7113 <para> 7114 Triggers in <productname>PostgreSQL</productname> have two 7115 incompatibilities with the SQL standard that affect the 7116 representation in the information schema. First, trigger names are 7117 local to each table in <productname>PostgreSQL</productname>, rather 7118 than being independent schema objects. Therefore there can be duplicate 7119 trigger names defined in one schema, so long as they belong to 7120 different tables. (<literal>trigger_catalog</literal> and 7121 <literal>trigger_schema</literal> are really the values pertaining 7122 to the table that the trigger is defined on.) Second, triggers can 7123 be defined to fire on multiple events in 7124 <productname>PostgreSQL</productname> (e.g., <literal>ON INSERT OR 7125 UPDATE</literal>), whereas the SQL standard only allows one. If a 7126 trigger is defined to fire on multiple events, it is represented as 7127 multiple rows in the information schema, one for each type of 7128 event. As a consequence of these two issues, the primary key of 7129 the view <literal>triggers</literal> is really 7130 <literal>(trigger_catalog, trigger_schema, event_object_table, 7131 trigger_name, event_manipulation)</literal> instead of 7132 <literal>(trigger_catalog, trigger_schema, trigger_name)</literal>, 7133 which is what the SQL standard specifies. Nonetheless, if you 7134 define your triggers in a manner that conforms with the SQL 7135 standard (trigger names unique in the schema and only one event 7136 type per trigger), this will not affect you. 7137 </para> 7138 7139 <note> 7140 <para> 7141 Prior to <productname>PostgreSQL</productname> 9.1, this view's columns 7142 <structfield>action_timing</structfield>, 7143 <structfield>action_reference_old_table</structfield>, 7144 <structfield>action_reference_new_table</structfield>, 7145 <structfield>action_reference_old_row</structfield>, and 7146 <structfield>action_reference_new_row</structfield> 7147 were named 7148 <structfield>condition_timing</structfield>, 7149 <structfield>condition_reference_old_table</structfield>, 7150 <structfield>condition_reference_new_table</structfield>, 7151 <structfield>condition_reference_old_row</structfield>, and 7152 <structfield>condition_reference_new_row</structfield> 7153 respectively. 7154 That was how they were named in the SQL:1999 standard. 7155 The new naming conforms to SQL:2003 and later. 7156 </para> 7157 </note> 7158 </sect1> 7159 7160 <sect1 id="infoschema-udt-privileges"> 7161 <title><literal>udt_privileges</literal></title> 7162 7163 <para> 7164 The view <literal>udt_privileges</literal> identifies 7165 <literal>USAGE</literal> privileges granted on user-defined types to a 7166 currently enabled role or by a currently enabled role. There is one row for 7167 each combination of type, grantor, and grantee. This view shows only 7168 composite types (see under <xref linkend="infoschema-user-defined-types"/> 7169 for why); see 7170 <xref linkend="infoschema-usage-privileges"/> for domain privileges. 7171 </para> 7172 7173 <table> 7174 <title><structname>udt_privileges</structname> Columns</title> 7175 <tgroup cols="1"> 7176 <thead> 7177 <row> 7178 <entry role="catalog_table_entry"><para role="column_definition"> 7179 Column Type 7180 </para> 7181 <para> 7182 Description 7183 </para></entry> 7184 </row> 7185 </thead> 7186 7187 <tbody> 7188 <row> 7189 <entry role="catalog_table_entry"><para role="column_definition"> 7190 <structfield>grantor</structfield> <type>sql_identifier</type> 7191 </para> 7192 <para> 7193 Name of the role that granted the privilege 7194 </para></entry> 7195 </row> 7196 7197 <row> 7198 <entry role="catalog_table_entry"><para role="column_definition"> 7199 <structfield>grantee</structfield> <type>sql_identifier</type> 7200 </para> 7201 <para> 7202 Name of the role that the privilege was granted to 7203 </para></entry> 7204 </row> 7205 7206 <row> 7207 <entry role="catalog_table_entry"><para role="column_definition"> 7208 <structfield>udt_catalog</structfield> <type>sql_identifier</type> 7209 </para> 7210 <para> 7211 Name of the database containing the type (always the current database) 7212 </para></entry> 7213 </row> 7214 7215 <row> 7216 <entry role="catalog_table_entry"><para role="column_definition"> 7217 <structfield>udt_schema</structfield> <type>sql_identifier</type> 7218 </para> 7219 <para> 7220 Name of the schema containing the type 7221 </para></entry> 7222 </row> 7223 7224 <row> 7225 <entry role="catalog_table_entry"><para role="column_definition"> 7226 <structfield>udt_name</structfield> <type>sql_identifier</type> 7227 </para> 7228 <para> 7229 Name of the type 7230 </para></entry> 7231 </row> 7232 7233 <row> 7234 <entry role="catalog_table_entry"><para role="column_definition"> 7235 <structfield>privilege_type</structfield> <type>character_data</type> 7236 </para> 7237 <para> 7238 Always <literal>TYPE USAGE</literal> 7239 </para></entry> 7240 </row> 7241 7242 <row> 7243 <entry role="catalog_table_entry"><para role="column_definition"> 7244 <structfield>is_grantable</structfield> <type>yes_or_no</type> 7245 </para> 7246 <para> 7247 <literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not 7248 </para></entry> 7249 </row> 7250 </tbody> 7251 </tgroup> 7252 </table> 7253 </sect1> 7254 7255 <sect1 id="infoschema-usage-privileges"> 7256 <title><literal>usage_privileges</literal></title> 7257 7258 <para> 7259 The view <literal>usage_privileges</literal> identifies 7260 <literal>USAGE</literal> privileges granted on various kinds of 7261 objects to a currently enabled role or by a currently enabled role. 7262 In <productname>PostgreSQL</productname>, this currently applies to 7263 collations, domains, foreign-data wrappers, foreign servers, and sequences. There is one 7264 row for each combination of object, grantor, and grantee. 7265 </para> 7266 7267 <para> 7268 Since collations do not have real privileges 7269 in <productname>PostgreSQL</productname>, this view shows implicit 7270 non-grantable <literal>USAGE</literal> privileges granted by the 7271 owner to <literal>PUBLIC</literal> for all collations. The other 7272 object types, however, show real privileges. 7273 </para> 7274 7275 <para> 7276 In PostgreSQL, sequences also support <literal>SELECT</literal> 7277 and <literal>UPDATE</literal> privileges in addition to 7278 the <literal>USAGE</literal> privilege. These are nonstandard and therefore 7279 not visible in the information schema. 7280 </para> 7281 7282 <table> 7283 <title><structname>usage_privileges</structname> Columns</title> 7284 <tgroup cols="1"> 7285 <thead> 7286 <row> 7287 <entry role="catalog_table_entry"><para role="column_definition"> 7288 Column Type 7289 </para> 7290 <para> 7291 Description 7292 </para></entry> 7293 </row> 7294 </thead> 7295 7296 <tbody> 7297 <row> 7298 <entry role="catalog_table_entry"><para role="column_definition"> 7299 <structfield>grantor</structfield> <type>sql_identifier</type> 7300 </para> 7301 <para> 7302 Name of the role that granted the privilege 7303 </para></entry> 7304 </row> 7305 7306 <row> 7307 <entry role="catalog_table_entry"><para role="column_definition"> 7308 <structfield>grantee</structfield> <type>sql_identifier</type> 7309 </para> 7310 <para> 7311 Name of the role that the privilege was granted to 7312 </para></entry> 7313 </row> 7314 7315 <row> 7316 <entry role="catalog_table_entry"><para role="column_definition"> 7317 <structfield>object_catalog</structfield> <type>sql_identifier</type> 7318 </para> 7319 <para> 7320 Name of the database containing the object (always the current database) 7321 </para></entry> 7322 </row> 7323 7324 <row> 7325 <entry role="catalog_table_entry"><para role="column_definition"> 7326 <structfield>object_schema</structfield> <type>sql_identifier</type> 7327 </para> 7328 <para> 7329 Name of the schema containing the object, if applicable, 7330 else an empty string 7331 </para></entry> 7332 </row> 7333 7334 <row> 7335 <entry role="catalog_table_entry"><para role="column_definition"> 7336 <structfield>object_name</structfield> <type>sql_identifier</type> 7337 </para> 7338 <para> 7339 Name of the object 7340 </para></entry> 7341 </row> 7342 7343 <row> 7344 <entry role="catalog_table_entry"><para role="column_definition"> 7345 <structfield>object_type</structfield> <type>character_data</type> 7346 </para> 7347 <para> 7348 <literal>COLLATION</literal> or <literal>DOMAIN</literal> or <literal>FOREIGN DATA WRAPPER</literal> or <literal>FOREIGN SERVER</literal> or <literal>SEQUENCE</literal> 7349 </para></entry> 7350 </row> 7351 7352 <row> 7353 <entry role="catalog_table_entry"><para role="column_definition"> 7354 <structfield>privilege_type</structfield> <type>character_data</type> 7355 </para> 7356 <para> 7357 Always <literal>USAGE</literal> 7358 </para></entry> 7359 </row> 7360 7361 <row> 7362 <entry role="catalog_table_entry"><para role="column_definition"> 7363 <structfield>is_grantable</structfield> <type>yes_or_no</type> 7364 </para> 7365 <para> 7366 <literal>YES</literal> if the privilege is grantable, <literal>NO</literal> if not 7367 </para></entry> 7368 </row> 7369 </tbody> 7370 </tgroup> 7371 </table> 7372 </sect1> 7373 7374 <sect1 id="infoschema-user-defined-types"> 7375 <title><literal>user_defined_types</literal></title> 7376 7377 <para> 7378 The view <literal>user_defined_types</literal> currently contains 7379 all composite types defined in the current database. 7380 Only those types are shown that the current user has access to (by way 7381 of being the owner or having some privilege). 7382 </para> 7383 7384 <para> 7385 SQL knows about two kinds of user-defined types: structured types 7386 (also known as composite types 7387 in <productname>PostgreSQL</productname>) and distinct types (not 7388 implemented in <productname>PostgreSQL</productname>). To be 7389 future-proof, use the 7390 column <literal>user_defined_type_category</literal> to 7391 differentiate between these. Other user-defined types such as base 7392 types and enums, which are <productname>PostgreSQL</productname> 7393 extensions, are not shown here. For domains, 7394 see <xref linkend="infoschema-domains"/> instead. 7395 </para> 7396 7397 <table> 7398 <title><structname>user_defined_types</structname> Columns</title> 7399 <tgroup cols="1"> 7400 <thead> 7401 <row> 7402 <entry role="catalog_table_entry"><para role="column_definition"> 7403 Column Type 7404 </para> 7405 <para> 7406 Description 7407 </para></entry> 7408 </row> 7409 </thead> 7410 7411 <tbody> 7412 <row> 7413 <entry role="catalog_table_entry"><para role="column_definition"> 7414 <structfield>user_defined_type_catalog</structfield> <type>sql_identifier</type> 7415 </para> 7416 <para> 7417 Name of the database that contains the type (always the current database) 7418 </para></entry> 7419 </row> 7420 7421 <row> 7422 <entry role="catalog_table_entry"><para role="column_definition"> 7423 <structfield>user_defined_type_schema</structfield> <type>sql_identifier</type> 7424 </para> 7425 <para> 7426 Name of the schema that contains the type 7427 </para></entry> 7428 </row> 7429 7430 <row> 7431 <entry role="catalog_table_entry"><para role="column_definition"> 7432 <structfield>user_defined_type_name</structfield> <type>sql_identifier</type> 7433 </para> 7434 <para> 7435 Name of the type 7436 </para></entry> 7437 </row> 7438 7439 <row> 7440 <entry role="catalog_table_entry"><para role="column_definition"> 7441 <structfield>user_defined_type_category</structfield> <type>character_data</type> 7442 </para> 7443 <para> 7444 Currently always <literal>STRUCTURED</literal> 7445 </para></entry> 7446 </row> 7447 7448 <row> 7449 <entry role="catalog_table_entry"><para role="column_definition"> 7450 <structfield>is_instantiable</structfield> <type>yes_or_no</type> 7451 </para> 7452 <para> 7453 Applies to a feature not available in <productname>PostgreSQL</productname> 7454 </para></entry> 7455 </row> 7456 7457 <row> 7458 <entry role="catalog_table_entry"><para role="column_definition"> 7459 <structfield>is_final</structfield> <type>yes_or_no</type> 7460 </para> 7461 <para> 7462 Applies to a feature not available in <productname>PostgreSQL</productname> 7463 </para></entry> 7464 </row> 7465 7466 <row> 7467 <entry role="catalog_table_entry"><para role="column_definition"> 7468 <structfield>ordering_form</structfield> <type>character_data</type> 7469 </para> 7470 <para> 7471 Applies to a feature not available in <productname>PostgreSQL</productname> 7472 </para></entry> 7473 </row> 7474 7475 <row> 7476 <entry role="catalog_table_entry"><para role="column_definition"> 7477 <structfield>ordering_category</structfield> <type>character_data</type> 7478 </para> 7479 <para> 7480 Applies to a feature not available in <productname>PostgreSQL</productname> 7481 </para></entry> 7482 </row> 7483 7484 <row> 7485 <entry role="catalog_table_entry"><para role="column_definition"> 7486 <structfield>ordering_routine_catalog</structfield> <type>sql_identifier</type> 7487 </para> 7488 <para> 7489 Applies to a feature not available in <productname>PostgreSQL</productname> 7490 </para></entry> 7491 </row> 7492 7493 <row> 7494 <entry role="catalog_table_entry"><para role="column_definition"> 7495 <structfield>ordering_routine_schema</structfield> <type>sql_identifier</type> 7496 </para> 7497 <para> 7498 Applies to a feature not available in <productname>PostgreSQL</productname> 7499 </para></entry> 7500 </row> 7501 7502 <row> 7503 <entry role="catalog_table_entry"><para role="column_definition"> 7504 <structfield>ordering_routine_name</structfield> <type>sql_identifier</type> 7505 </para> 7506 <para> 7507 Applies to a feature not available in <productname>PostgreSQL</productname> 7508 </para></entry> 7509 </row> 7510 7511 <row> 7512 <entry role="catalog_table_entry"><para role="column_definition"> 7513 <structfield>reference_type</structfield> <type>character_data</type> 7514 </para> 7515 <para> 7516 Applies to a feature not available in <productname>PostgreSQL</productname> 7517 </para></entry> 7518 </row> 7519 7520 <row> 7521 <entry role="catalog_table_entry"><para role="column_definition"> 7522 <structfield>data_type</structfield> <type>character_data</type> 7523 </para> 7524 <para> 7525 Applies to a feature not available in <productname>PostgreSQL</productname> 7526 </para></entry> 7527 </row> 7528 7529 <row> 7530 <entry role="catalog_table_entry"><para role="column_definition"> 7531 <structfield>character_maximum_length</structfield> <type>cardinal_number</type> 7532 </para> 7533 <para> 7534 Applies to a feature not available in <productname>PostgreSQL</productname> 7535 </para></entry> 7536 </row> 7537 7538 <row> 7539 <entry role="catalog_table_entry"><para role="column_definition"> 7540 <structfield>character_octet_length</structfield> <type>cardinal_number</type> 7541 </para> 7542 <para> 7543 Applies to a feature not available in <productname>PostgreSQL</productname> 7544 </para></entry> 7545 </row> 7546 7547 <row> 7548 <entry role="catalog_table_entry"><para role="column_definition"> 7549 <structfield>character_set_catalog</structfield> <type>sql_identifier</type> 7550 </para> 7551 <para> 7552 Applies to a feature not available in <productname>PostgreSQL</productname> 7553 </para></entry> 7554 </row> 7555 7556 <row> 7557 <entry role="catalog_table_entry"><para role="column_definition"> 7558 <structfield>character_set_schema</structfield> <type>sql_identifier</type> 7559 </para> 7560 <para> 7561 Applies to a feature not available in <productname>PostgreSQL</productname> 7562 </para></entry> 7563 </row> 7564 7565 <row> 7566 <entry role="catalog_table_entry"><para role="column_definition"> 7567 <structfield>character_set_name</structfield> <type>sql_identifier</type> 7568 </para> 7569 <para> 7570 Applies to a feature not available in <productname>PostgreSQL</productname> 7571 </para></entry> 7572 </row> 7573 7574 <row> 7575 <entry role="catalog_table_entry"><para role="column_definition"> 7576 <structfield>collation_catalog</structfield> <type>sql_identifier</type> 7577 </para> 7578 <para> 7579 Applies to a feature not available in <productname>PostgreSQL</productname> 7580 </para></entry> 7581 </row> 7582 7583 <row> 7584 <entry role="catalog_table_entry"><para role="column_definition"> 7585 <structfield>collation_schema</structfield> <type>sql_identifier</type> 7586 </para> 7587 <para> 7588 Applies to a feature not available in <productname>PostgreSQL</productname> 7589 </para></entry> 7590 </row> 7591 7592 <row> 7593 <entry role="catalog_table_entry"><para role="column_definition"> 7594 <structfield>collation_name</structfield> <type>sql_identifier</type> 7595 </para> 7596 <para> 7597 Applies to a feature not available in <productname>PostgreSQL</productname> 7598 </para></entry> 7599 </row> 7600 7601 <row> 7602 <entry role="catalog_table_entry"><para role="column_definition"> 7603 <structfield>numeric_precision</structfield> <type>cardinal_number</type> 7604 </para> 7605 <para> 7606 Applies to a feature not available in <productname>PostgreSQL</productname> 7607 </para></entry> 7608 </row> 7609 7610 <row> 7611 <entry role="catalog_table_entry"><para role="column_definition"> 7612 <structfield>numeric_precision_radix</structfield> <type>cardinal_number</type> 7613 </para> 7614 <para> 7615 Applies to a feature not available in <productname>PostgreSQL</productname> 7616 </para></entry> 7617 </row> 7618 7619 <row> 7620 <entry role="catalog_table_entry"><para role="column_definition"> 7621 <structfield>numeric_scale</structfield> <type>cardinal_number</type> 7622 </para> 7623 <para> 7624 Applies to a feature not available in <productname>PostgreSQL</productname> 7625 </para></entry> 7626 </row> 7627 7628 <row> 7629 <entry role="catalog_table_entry"><para role="column_definition"> 7630 <structfield>datetime_precision</structfield> <type>cardinal_number</type> 7631 </para> 7632 <para> 7633 Applies to a feature not available in <productname>PostgreSQL</productname> 7634 </para></entry> 7635 </row> 7636 7637 <row> 7638 <entry role="catalog_table_entry"><para role="column_definition"> 7639 <structfield>interval_type</structfield> <type>character_data</type> 7640 </para> 7641 <para> 7642 Applies to a feature not available in <productname>PostgreSQL</productname> 7643 </para></entry> 7644 </row> 7645 7646 <row> 7647 <entry role="catalog_table_entry"><para role="column_definition"> 7648 <structfield>interval_precision</structfield> <type>cardinal_number</type> 7649 </para> 7650 <para> 7651 Applies to a feature not available in <productname>PostgreSQL</productname> 7652 </para></entry> 7653 </row> 7654 7655 <row> 7656 <entry role="catalog_table_entry"><para role="column_definition"> 7657 <structfield>source_dtd_identifier</structfield> <type>sql_identifier</type> 7658 </para> 7659 <para> 7660 Applies to a feature not available in <productname>PostgreSQL</productname> 7661 </para></entry> 7662 </row> 7663 7664 <row> 7665 <entry role="catalog_table_entry"><para role="column_definition"> 7666 <structfield>ref_dtd_identifier</structfield> <type>sql_identifier</type> 7667 </para> 7668 <para> 7669 Applies to a feature not available in <productname>PostgreSQL</productname> 7670 </para></entry> 7671 </row> 7672 </tbody> 7673 </tgroup> 7674 </table> 7675 </sect1> 7676 7677 <sect1 id="infoschema-user-mapping-options"> 7678 <title><literal>user_mapping_options</literal></title> 7679 7680 <para> 7681 The view <literal>user_mapping_options</literal> contains all the 7682 options defined for user mappings in the current database. Only 7683 those user mappings are shown where the current user has access to 7684 the corresponding foreign server (by way of being the owner or 7685 having some privilege). 7686 </para> 7687 7688 <table> 7689 <title><structname>user_mapping_options</structname> Columns</title> 7690 <tgroup cols="1"> 7691 <thead> 7692 <row> 7693 <entry role="catalog_table_entry"><para role="column_definition"> 7694 Column Type 7695 </para> 7696 <para> 7697 Description 7698 </para></entry> 7699 </row> 7700 </thead> 7701 7702 <tbody> 7703 <row> 7704 <entry role="catalog_table_entry"><para role="column_definition"> 7705 <structfield>authorization_identifier</structfield> <type>sql_identifier</type> 7706 </para> 7707 <para> 7708 Name of the user being mapped, 7709 or <literal>PUBLIC</literal> if the mapping is public 7710 </para></entry> 7711 </row> 7712 7713 <row> 7714 <entry role="catalog_table_entry"><para role="column_definition"> 7715 <structfield>foreign_server_catalog</structfield> <type>sql_identifier</type> 7716 </para> 7717 <para> 7718 Name of the database that the foreign server used by this 7719 mapping is defined in (always the current database) 7720 </para></entry> 7721 </row> 7722 7723 <row> 7724 <entry role="catalog_table_entry"><para role="column_definition"> 7725 <structfield>foreign_server_name</structfield> <type>sql_identifier</type> 7726 </para> 7727 <para> 7728 Name of the foreign server used by this mapping 7729 </para></entry> 7730 </row> 7731 7732 <row> 7733 <entry role="catalog_table_entry"><para role="column_definition"> 7734 <structfield>option_name</structfield> <type>sql_identifier</type> 7735 </para> 7736 <para> 7737 Name of an option 7738 </para></entry> 7739 </row> 7740 7741 <row> 7742 <entry role="catalog_table_entry"><para role="column_definition"> 7743 <structfield>option_value</structfield> <type>character_data</type> 7744 </para> 7745 <para> 7746 Value of the option. This column will show as null 7747 unless the current user is the user being mapped, or the mapping 7748 is for <literal>PUBLIC</literal> and the current user is the 7749 server owner, or the current user is a superuser. The intent is 7750 to protect password information stored as user mapping 7751 option. 7752 </para></entry> 7753 </row> 7754 </tbody> 7755 </tgroup> 7756 </table> 7757 </sect1> 7758 7759 <sect1 id="infoschema-user-mappings"> 7760 <title><literal>user_mappings</literal></title> 7761 7762 <para> 7763 The view <literal>user_mappings</literal> contains all user 7764 mappings defined in the current database. Only those user mappings 7765 are shown where the current user has access to the corresponding 7766 foreign server (by way of being the owner or having some 7767 privilege). 7768 </para> 7769 7770 <table> 7771 <title><structname>user_mappings</structname> Columns</title> 7772 <tgroup cols="1"> 7773 <thead> 7774 <row> 7775 <entry role="catalog_table_entry"><para role="column_definition"> 7776 Column Type 7777 </para> 7778 <para> 7779 Description 7780 </para></entry> 7781 </row> 7782 </thead> 7783 7784 <tbody> 7785 <row> 7786 <entry role="catalog_table_entry"><para role="column_definition"> 7787 <structfield>authorization_identifier</structfield> <type>sql_identifier</type> 7788 </para> 7789 <para> 7790 Name of the user being mapped, 7791 or <literal>PUBLIC</literal> if the mapping is public 7792 </para></entry> 7793 </row> 7794 7795 <row> 7796 <entry role="catalog_table_entry"><para role="column_definition"> 7797 <structfield>foreign_server_catalog</structfield> <type>sql_identifier</type> 7798 </para> 7799 <para> 7800 Name of the database that the foreign server used by this 7801 mapping is defined in (always the current database) 7802 </para></entry> 7803 </row> 7804 7805 <row> 7806 <entry role="catalog_table_entry"><para role="column_definition"> 7807 <structfield>foreign_server_name</structfield> <type>sql_identifier</type> 7808 </para> 7809 <para> 7810 Name of the foreign server used by this mapping 7811 </para></entry> 7812 </row> 7813 </tbody> 7814 </tgroup> 7815 </table> 7816 </sect1> 7817 7818 <sect1 id="infoschema-view-column-usage"> 7819 <title><literal>view_column_usage</literal></title> 7820 7821 <para> 7822 The view <literal>view_column_usage</literal> identifies all 7823 columns that are used in the query expression of a view (the 7824 <command>SELECT</command> statement that defines the view). A 7825 column is only included if the table that contains the column is 7826 owned by a currently enabled role. 7827 </para> 7828 7829 <note> 7830 <para> 7831 Columns of system tables are not included. This should be fixed 7832 sometime. 7833 </para> 7834 </note> 7835 7836 <table> 7837 <title><structname>view_column_usage</structname> Columns</title> 7838 <tgroup cols="1"> 7839 <thead> 7840 <row> 7841 <entry role="catalog_table_entry"><para role="column_definition"> 7842 Column Type 7843 </para> 7844 <para> 7845 Description 7846 </para></entry> 7847 </row> 7848 </thead> 7849 7850 <tbody> 7851 <row> 7852 <entry role="catalog_table_entry"><para role="column_definition"> 7853 <structfield>view_catalog</structfield> <type>sql_identifier</type> 7854 </para> 7855 <para> 7856 Name of the database that contains the view (always the current database) 7857 </para></entry> 7858 </row> 7859 7860 <row> 7861 <entry role="catalog_table_entry"><para role="column_definition"> 7862 <structfield>view_schema</structfield> <type>sql_identifier</type> 7863 </para> 7864 <para> 7865 Name of the schema that contains the view 7866 </para></entry> 7867 </row> 7868 7869 <row> 7870 <entry role="catalog_table_entry"><para role="column_definition"> 7871 <structfield>view_name</structfield> <type>sql_identifier</type> 7872 </para> 7873 <para> 7874 Name of the view 7875 </para></entry> 7876 </row> 7877 7878 <row> 7879 <entry role="catalog_table_entry"><para role="column_definition"> 7880 <structfield>table_catalog</structfield> <type>sql_identifier</type> 7881 </para> 7882 <para> 7883 Name of the database that contains the table that contains the 7884 column that is used by the view (always the current database) 7885 </para></entry> 7886 </row> 7887 7888 <row> 7889 <entry role="catalog_table_entry"><para role="column_definition"> 7890 <structfield>table_schema</structfield> <type>sql_identifier</type> 7891 </para> 7892 <para> 7893 Name of the schema that contains the table that contains the 7894 column that is used by the view 7895 </para></entry> 7896 </row> 7897 7898 <row> 7899 <entry role="catalog_table_entry"><para role="column_definition"> 7900 <structfield>table_name</structfield> <type>sql_identifier</type> 7901 </para> 7902 <para> 7903 Name of the table that contains the column that is used by the 7904 view 7905 </para></entry> 7906 </row> 7907 7908 <row> 7909 <entry role="catalog_table_entry"><para role="column_definition"> 7910 <structfield>column_name</structfield> <type>sql_identifier</type> 7911 </para> 7912 <para> 7913 Name of the column that is used by the view 7914 </para></entry> 7915 </row> 7916 </tbody> 7917 </tgroup> 7918 </table> 7919 </sect1> 7920 7921 <sect1 id="infoschema-view-routine-usage"> 7922 <title><literal>view_routine_usage</literal></title> 7923 7924 <para> 7925 The view <literal>view_routine_usage</literal> identifies all 7926 routines (functions and procedures) that are used in the query 7927 expression of a view (the <command>SELECT</command> statement that 7928 defines the view). A routine is only included if that routine is 7929 owned by a currently enabled role. 7930 </para> 7931 7932 <table> 7933 <title><structname>view_routine_usage</structname> Columns</title> 7934 <tgroup cols="1"> 7935 <thead> 7936 <row> 7937 <entry role="catalog_table_entry"><para role="column_definition"> 7938 Column Type 7939 </para> 7940 <para> 7941 Description 7942 </para></entry> 7943 </row> 7944 </thead> 7945 7946 <tbody> 7947 <row> 7948 <entry role="catalog_table_entry"><para role="column_definition"> 7949 <structfield>table_catalog</structfield> <type>sql_identifier</type> 7950 </para> 7951 <para> 7952 Name of the database containing the view (always the current database) 7953 </para></entry> 7954 </row> 7955 7956 <row> 7957 <entry role="catalog_table_entry"><para role="column_definition"> 7958 <structfield>table_schema</structfield> <type>sql_identifier</type> 7959 </para> 7960 <para> 7961 Name of the schema containing the view 7962 </para></entry> 7963 </row> 7964 7965 <row> 7966 <entry role="catalog_table_entry"><para role="column_definition"> 7967 <structfield>table_name</structfield> <type>sql_identifier</type> 7968 </para> 7969 <para> 7970 Name of the view 7971 </para></entry> 7972 </row> 7973 7974 <row> 7975 <entry role="catalog_table_entry"><para role="column_definition"> 7976 <structfield>specific_catalog</structfield> <type>sql_identifier</type> 7977 </para> 7978 <para> 7979 Name of the database containing the function (always the current database) 7980 </para></entry> 7981 </row> 7982 7983 <row> 7984 <entry role="catalog_table_entry"><para role="column_definition"> 7985 <structfield>specific_schema</structfield> <type>sql_identifier</type> 7986 </para> 7987 <para> 7988 Name of the schema containing the function 7989 </para></entry> 7990 </row> 7991 7992 <row> 7993 <entry role="catalog_table_entry"><para role="column_definition"> 7994 <structfield>specific_name</structfield> <type>sql_identifier</type> 7995 </para> 7996 <para> 7997 The <quote>specific name</quote> of the function. See <xref linkend="infoschema-routines"/> for more information. 7998 </para></entry> 7999 </row> 8000 </tbody> 8001 </tgroup> 8002 </table> 8003 </sect1> 8004 8005 <sect1 id="infoschema-view-table-usage"> 8006 <title><literal>view_table_usage</literal></title> 8007 8008 <para> 8009 The view <literal>view_table_usage</literal> identifies all tables 8010 that are used in the query expression of a view (the 8011 <command>SELECT</command> statement that defines the view). A 8012 table is only included if that table is owned by a currently 8013 enabled role. 8014 </para> 8015 8016 <note> 8017 <para> 8018 System tables are not included. This should be fixed sometime. 8019 </para> 8020 </note> 8021 8022 <table> 8023 <title><structname>view_table_usage</structname> Columns</title> 8024 <tgroup cols="1"> 8025 <thead> 8026 <row> 8027 <entry role="catalog_table_entry"><para role="column_definition"> 8028 Column Type 8029 </para> 8030 <para> 8031 Description 8032 </para></entry> 8033 </row> 8034 </thead> 8035 8036 <tbody> 8037 <row> 8038 <entry role="catalog_table_entry"><para role="column_definition"> 8039 <structfield>view_catalog</structfield> <type>sql_identifier</type> 8040 </para> 8041 <para> 8042 Name of the database that contains the view (always the current database) 8043 </para></entry> 8044 </row> 8045 8046 <row> 8047 <entry role="catalog_table_entry"><para role="column_definition"> 8048 <structfield>view_schema</structfield> <type>sql_identifier</type> 8049 </para> 8050 <para> 8051 Name of the schema that contains the view 8052 </para></entry> 8053 </row> 8054 8055 <row> 8056 <entry role="catalog_table_entry"><para role="column_definition"> 8057 <structfield>view_name</structfield> <type>sql_identifier</type> 8058 </para> 8059 <para> 8060 Name of the view 8061 </para></entry> 8062 </row> 8063 8064 <row> 8065 <entry role="catalog_table_entry"><para role="column_definition"> 8066 <structfield>table_catalog</structfield> <type>sql_identifier</type> 8067 </para> 8068 <para> 8069 Name of the database that contains the table that is 8070 used by the view (always the current database) 8071 </para></entry> 8072 </row> 8073 8074 <row> 8075 <entry role="catalog_table_entry"><para role="column_definition"> 8076 <structfield>table_schema</structfield> <type>sql_identifier</type> 8077 </para> 8078 <para> 8079 Name of the schema that contains the table that is used by the 8080 view 8081 </para></entry> 8082 </row> 8083 8084 <row> 8085 <entry role="catalog_table_entry"><para role="column_definition"> 8086 <structfield>table_name</structfield> <type>sql_identifier</type> 8087 </para> 8088 <para> 8089 Name of the table that is used by the view 8090 </para></entry> 8091 </row> 8092 </tbody> 8093 </tgroup> 8094 </table> 8095 </sect1> 8096 8097 <sect1 id="infoschema-views"> 8098 <title><literal>views</literal></title> 8099 8100 <para> 8101 The view <literal>views</literal> contains all views defined in the 8102 current database. Only those views are shown that the current user 8103 has access to (by way of being the owner or having some privilege). 8104 </para> 8105 8106 <table> 8107 <title><structname>views</structname> Columns</title> 8108 <tgroup cols="1"> 8109 <thead> 8110 <row> 8111 <entry role="catalog_table_entry"><para role="column_definition"> 8112 Column Type 8113 </para> 8114 <para> 8115 Description 8116 </para></entry> 8117 </row> 8118 </thead> 8119 8120 <tbody> 8121 <row> 8122 <entry role="catalog_table_entry"><para role="column_definition"> 8123 <structfield>table_catalog</structfield> <type>sql_identifier</type> 8124 </para> 8125 <para> 8126 Name of the database that contains the view (always the current database) 8127 </para></entry> 8128 </row> 8129 8130 <row> 8131 <entry role="catalog_table_entry"><para role="column_definition"> 8132 <structfield>table_schema</structfield> <type>sql_identifier</type> 8133 </para> 8134 <para> 8135 Name of the schema that contains the view 8136 </para></entry> 8137 </row> 8138 8139 <row> 8140 <entry role="catalog_table_entry"><para role="column_definition"> 8141 <structfield>table_name</structfield> <type>sql_identifier</type> 8142 </para> 8143 <para> 8144 Name of the view 8145 </para></entry> 8146 </row> 8147 8148 <row> 8149 <entry role="catalog_table_entry"><para role="column_definition"> 8150 <structfield>view_definition</structfield> <type>character_data</type> 8151 </para> 8152 <para> 8153 Query expression defining the view (null if the view is not 8154 owned by a currently enabled role) 8155 </para></entry> 8156 </row> 8157 8158 <row> 8159 <entry role="catalog_table_entry"><para role="column_definition"> 8160 <structfield>check_option</structfield> <type>character_data</type> 8161 </para> 8162 <para> 8163 <literal>CASCADED</literal> or <literal>LOCAL</literal> if the view 8164 has a <literal>CHECK OPTION</literal> defined on it, 8165 <literal>NONE</literal> if not 8166 </para></entry> 8167 </row> 8168 8169 <row> 8170 <entry role="catalog_table_entry"><para role="column_definition"> 8171 <structfield>is_updatable</structfield> <type>yes_or_no</type> 8172 </para> 8173 <para> 8174 <literal>YES</literal> if the view is updatable (allows 8175 <command>UPDATE</command> and <command>DELETE</command>), 8176 <literal>NO</literal> if not 8177 </para></entry> 8178 </row> 8179 8180 <row> 8181 <entry role="catalog_table_entry"><para role="column_definition"> 8182 <structfield>is_insertable_into</structfield> <type>yes_or_no</type> 8183 </para> 8184 <para> 8185 <literal>YES</literal> if the view is insertable into (allows 8186 <command>INSERT</command>), <literal>NO</literal> if not 8187 </para></entry> 8188 </row> 8189 8190 <row> 8191 <entry role="catalog_table_entry"><para role="column_definition"> 8192 <structfield>is_trigger_updatable</structfield> <type>yes_or_no</type> 8193 </para> 8194 <para> 8195 <literal>YES</literal> if the view has an <literal>INSTEAD OF</literal> 8196 <command>UPDATE</command> trigger defined on it, <literal>NO</literal> if not 8197 </para></entry> 8198 </row> 8199 8200 <row> 8201 <entry role="catalog_table_entry"><para role="column_definition"> 8202 <structfield>is_trigger_deletable</structfield> <type>yes_or_no</type> 8203 </para> 8204 <para> 8205 <literal>YES</literal> if the view has an <literal>INSTEAD OF</literal> 8206 <command>DELETE</command> trigger defined on it, <literal>NO</literal> if not 8207 </para></entry> 8208 </row> 8209 8210 <row> 8211 <entry role="catalog_table_entry"><para role="column_definition"> 8212 <structfield>is_trigger_insertable_into</structfield> <type>yes_or_no</type> 8213 </para> 8214 <para> 8215 <literal>YES</literal> if the view has an <literal>INSTEAD OF</literal> 8216 <command>INSERT</command> trigger defined on it, <literal>NO</literal> if not 8217 </para></entry> 8218 </row> 8219 </tbody> 8220 </tgroup> 8221 </table> 8222 </sect1> 8223 8224</chapter> 8225