INFORMATION_SCHEMA.routine_column_usage
От | Erki Eessaar |
---|---|
Тема | INFORMATION_SCHEMA.routine_column_usage |
Дата | |
Msg-id | AM9PR01MB8268EC7B696F9FE346CA5B93FEB8A@AM9PR01MB8268.eurprd01.prod.exchangelabs.com обсуждение исходный текст |
Ответы |
Re: INFORMATION_SCHEMA.routine_column_usage
|
Список | 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 по дате отправления: