• 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

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):
%3 sb::get_table_description sb::get_table_description (public) sb::get_child_tables sb::get_child_tables sb::get_table_description->sb::get_child_tables db_foreach db_foreach (public) sb::get_child_tables->db_foreach

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):
%3 sb::get_table_description sb::get_table_description (public) sb::get_foreign_keys sb::get_foreign_keys sb::get_table_description->sb::get_foreign_keys db_foreach db_foreach (public) sb::get_foreign_keys->db_foreach

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):
%3 sb::get_table_description sb::get_table_description (public) sb::get_indexes sb::get_indexes sb::get_table_description->sb::get_indexes db_foreach db_foreach (public) sb::get_indexes->db_foreach db_list_of_lists db_list_of_lists (public) sb::get_indexes->db_list_of_lists

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):
%3 packages/schema-browser/www/index.tcl packages/schema-browser/ www/index.tcl sb::get_table_description sb::get_table_description packages/schema-browser/www/index.tcl->sb::get_table_description ad_text_to_html ad_text_to_html (public) sb::get_table_description->ad_text_to_html db_0or1row db_0or1row (public) sb::get_table_description->db_0or1row db_foreach db_foreach (public) sb::get_table_description->db_foreach db_list db_list (public) sb::get_table_description->db_list lc_numeric lc_numeric (public) sb::get_table_description->lc_numeric

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:
  1. Size of the table on disk (in bytes), or -1 if the table was not found
  2. 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):
%3 sb::get_table_description sb::get_table_description (public) sb::get_table_size sb::get_table_size sb::get_table_description->sb::get_table_size db_0or1row db_0or1row (public) sb::get_table_size->db_0or1row

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):
%3 packages/schema-browser/www/index.tcl packages/schema-browser/ www/index.tcl sb::get_tables sb::get_tables packages/schema-browser/www/index.tcl->sb::get_tables export_vars export_vars (public) sb::get_tables->export_vars sb::get_tables_list sb::get_tables_list (public) sb::get_tables->sb::get_tables_list

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):
%3 sb::get_tables sb::get_tables (public) sb::get_tables_list sb::get_tables_list sb::get_tables->sb::get_tables_list db_list db_list (public) sb::get_tables_list->db_list

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):
%3 sb::get_table_description sb::get_table_description (public) sb::get_triggers sb::get_triggers sb::get_table_description->sb::get_triggers db_foreach db_foreach (public) sb::get_triggers->db_foreach

Testcases:
No testcase defined.
[ show source ]