Routines

Routines

Name Type Language Deterministic Return Type Security Restriction Comments
export_datasets_as_flat_table FUNCTION PLPGSQL false SETOF record INVOKER

Generate a flat representation of the datasets for a given locale.

generate_html_from_json FUNCTION PLPGSQL false text INVOKER

Generate HTML content for the given JSON representation of a record and a given section, based on the template stored in the pgmetadata.html_template table. Template section controlled values are “main”, “contact” and “link”. If the corresponding line is not found in the pgmetadata.html_template table, NULL is returned.

get_dataset_item_html_content FUNCTION PLPGSQL false text INVOKER

Generate the metadata HTML content for the given table and given language or NULL if no templates are stored in the pgmetadata.html_template table.

update_postgresql_table_comment FUNCTION PLPGSQL false boolean INVOKER

Update the PostgreSQL comment of a table by giving table schema, name and comment
Example: if you need to update the comments for all the items listed by pgmetadata.v_table_comment_from_metadata:

SELECT
v.table_schema,
v.table_name,
pgmetadata.update_postgresql_table_comment(
    v.table_schema,
    v.table_name,
    v.table_comment,
    v.table_type
) AS comment_updated
FROM pgmetadata.v_table_comment_from_metadata AS v
get_datasets_as_dcat_xml FUNCTION PLPGSQL false SETOF record INVOKER

Get the datasets records as XML DCAT datasets for the given locale. Datasets are filtered by the given array of uids. IF uids is NULL, no filter is used and all datasets are returned

refresh_dataset_calculated_fields FUNCTION PLPGSQL false void INVOKER

Force the calculation of spatial related fields in dataset table by updating all lines, which will trigger the function calculate_fields_from_data

calculate_fields_from_data FUNCTION PLPGSQL false trigger INVOKER

Update some fields content when updating or inserting a line in pgmetadata.dataset table.

update_table_comment_from_dataset FUNCTION PLPGSQL false trigger INVOKER

Update the PostgreSQL table comment when updating or inserting a line in pgmetadata.dataset table. Comment is taken from the view pgmetadata.v_table_comment_from_metadata.