System Catalog Information Functions
format_type(type_oid, typemod)
Description: Obtains the SQL name of a data type.
Return type: text.
Remarks:
format_type returns the SQL name based on the type OID of the data type and possible type modifiers. If the specific modifier is unknown, NULL is passed in the position of the type modifier. Generally, type modifiers are valid only for data types with length limitations. The SQL name returned by format_type contains the length value of the data type. The length value is the actual storage length len – sizeof (int32), in bytes. During data storage, 32-bit space is required to store the customized length information of the data type. That is, the actual storage length is four bytes longer than the customized length. In the following example, the SQL name returned by format_type is character varying (6), where 6 indicates that the length value of the varchar type is 6 bytes. Therefore, the actual storage length of this type is 10 bytes.
1 2 3 4 5 |
SELECT format_type((SELECT oid FROM pg_type WHERE typname='varchar'), 10); format_type ---------------------- character varying(6) (1 row) |
fabricsql_get_schemas(schemaPattern)
Description: Queries schemas in the current catalog. The schemaPattern parameter can be a schema name or a wildcard character represented by %. If schemaPattern is empty, all schemas are returned.
Return type: text.
fabricsql_get_tables(schemaPattern, tablePattern, tableTypes)
Description: Queries for information about tables that meet conditions in the current catalog. The schemaPattern parameter can be used to specify the schema name or the wildcard represented by %. The tablePattern parameter can be used to specify the table name or the wildcard represented by %. The tableTypes parameter can be used to specify the table type. The table types are MANAGED_TABLE, EXTERNAL_TABLE, VIRTUAL_VIEW, MATERIALIZED_VIEW, and DICTIONARY_TABLE. If the three parameters are null, the following information is displayed.
Return type: The row set consisting of the following fields is returned:
- catalog_name
- schema_name
- table_name
- table_type
- description
fabricsql_get_columns(schemaPattern, tableNamePattern, columnNamePattern)
Description: Queries the column information that meets the conditions in the current catalog. The schemaPattern parameter specifies the schema name or the wildcard character %. The tableNamePattern parameter specifies the table name or the wildcard character %. The columnNamePattern parameter specifies the column name or the wildcard character %.
Return type: The row set consisting of the following fields is returned:
- catalog_name
- schema_name
- table_name
- column_name
- origintype
- atttypid
- atttypmod
- typename
- typtype
- attnum
- description
- attnotnull
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot