- Publicity: Public Only All
schema-browser-procs-postgresql.tcl
Took these defs out of the /www/doc/schema-browser/index.tcl file.
- Location:
- packages/schema-browser/tcl/schema-browser-procs-postgresql.tcl
Procedures in this file
- sb::get_child_tables (public)
- sb::get_foreign_keys (public)
- sb::get_indexes (public)
- sb::get_table_description (public)
- sb::get_table_size (public)
- sb::get_tables (public)
- sb::get_tables_list (public)
- sb::get_triggers (public)
Detailed information
sb::get_child_tables (public)
sb::get_child_tables table_name [ html_anchor_p ]
Build an HTML snippet listing all tables which have at least one foreign key referring to table_name.
- Parameters:
- table_name (required)
- html_anchor_p (optional, defaults to
"f"
)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
sb::get_foreign_keys (public)
sb::get_foreign_keys table_name
Build a list describing all foreign keys on table_name and their actions. We ignore MATCH conditions because Oracle doesn't support them, therefore, OpenACS doesn't use them. Same is true of SET NULL and SET DEFAULT actions hung on ON DELETE/ON UPDATE subclauses, but since Oracle *does* support CASCADE as an action I had figure out how to grab this info from the system catalog anyway. This code is *horribly* convoluted, mostly a result of the non-obvious way that the needed information is organized in the PG system catalogs. g Feel free to clean this up if you want!
- Parameters:
- table_name (required)
- Author:
- Don Baccus, though he hates to admit to writing such ugly code <dhogaza@pacifier.com>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
sb::get_indexes (public)
sb::get_indexes table_name [ html_anchors_p ] [ pki ]
Create statements for indexes on table_name.
- Parameters:
- table_name (required)
- html_anchors_p (optional, defaults to
"f"
)- pki (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
sb::get_table_description (public)
sb::get_table_description table_name
- Parameters:
- table_name (required)
- Returns:
- table description as HTML
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
sb::get_table_size (public)
sb::get_table_size -table_name table_name [ -namespace namespace ] \ [ -block_size block_size ]
Returns the size of the table on disk. This information is only updated by the commands VACUUM, ANALYZE, and CREATE INDEX. Thus, if you have been changing your table, run ANALYZE on the table before running this proc.
- Switches:
- -table_name (required)
- The table name
- -namespace (optional, defaults to
"public"
)- The database namespace that contains the table
- -block_size (optional, defaults to
"8192"
)- Size of BLCKSZ (in bytes) used by the database
- Returns:
- This procedure returns a list with 2 items:
- Size of the table on disk (in bytes), or -1 if the table was not found
- Number of rows in the table, or -1 if the table was not found
- Author:
- Gabriel Burca <gburca-openacs@ebixio.com>
- Created:
- 2004-06-27
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
sb::get_tables (public)
sb::get_tables selected_table_name
Build an HTML table of all PG tables belonging to the current user. Each PG table name is returned as a hyperlink to a page which displays the table's structure.
- Parameters:
- selected_table_name (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
sb::get_tables_list (public)
sb::get_tables_list
Get all tables that belong to the current user.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
sb::get_triggers (public)
sb::get_triggers table_name
Get all non-RI triggers on the table.
- Parameters:
- table_name (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.