Skip to main content

Module table

Module table 

Source
Expand description

Table renderer.

render_table emits a CREATE TABLE statement with inline columns and non-FK constraints (PK, UK, CHECK). Foreign-key constraints are deliberately excluded from the inline form; callers should emit them separately via render_add_fk after all tables have been created. This avoids forward- reference failures when two tables have FKs to each other.

Column comments and the table comment are appended as separate COMMENT ON ... statements.

Functions§

render_add_fk
Render a foreign-key constraint as ALTER TABLE <table> ADD CONSTRAINT ...;.
render_table
Render a Table as SQL.