INFORMATION_SCHEMA.routine_column_usage - Mailing list pgsql-docs

From Erki Eessaar
Subject INFORMATION_SCHEMA.routine_column_usage
Date
Msg-id AM9PR01MB8268EC7B696F9FE346CA5B93FEB8A@AM9PR01MB8268.eurprd01.prod.exchangelabs.com
Whole thread Raw
Responses Re: INFORMATION_SCHEMA.routine_column_usage
List pgsql-docs
Hello

Here

it is stated that "The view routine_column_usage is meant to identify all columns that are used by a function or procedure. This information is currently not tracked by PostgreSQL."

However, this claim is incorrect because the view provides information about the column usage of SQL functions that have SQL-standard function body.

CREATE TABLE Person (person_id SERIAL,
given_name VARCHAR(50) NOT NULL,
reg_time TIMESTAMP(0) NOT NULL DEFAULT LOCALTIMESTAMP(0),
CONSTRAINT pk_person PRIMARY KEY (person_id));

CREATE FUNCTION f_reg_person(p_given_name Person.given_name%TYPE)
RETURNS Person.person_id%TYPE
LANGUAGE SQL SECURITY DEFINER
BEGIN ATOMIC
INSERT INTO Person (given_name) VALUES (p_given_name)
RETURNING person_id;
END;

SELECT * FROM Information_schema.routine_column_usage;
Returns information about two columns - person_id and given_name.

Perhaps the better wording is:

The view routine_column_usage is meant to identify all columns that are used by a function or procedure. This information is tracked by PostgreSQL in case of routines that have SQL-standard function body.

Best regards
Erki Eessaar

pgsql-docs by date:

Previous
From: PG Doc comments form
Date:
Subject: "name" vs "alias" in datatype table
Next
From: Bruce Momjian
Date:
Subject: Re: [DOCS] Add example about date ISO format