当我执行时:
CREATE VIEW foreign_keys AS
SELECT
tc.table_name, kcu.column_name, ccu.table_name AS foreign_table_name,
ccu.column_name AS foreign_column_name
FROM
information_schema.table_constraints AS tc, information_schema.key_column_usage AS kcu,
information_schema.constraint_column_usage AS ccu
WHERE
tc.constraint_type = 'FOREIGN KEY' AND tc.constraint_name = kcu.constraint_name AND
ccu.constraint_name = tc.constraint_name;
CREATE FUNCTION GetPermissionColumns() RETURNS TABLE(column_name foreign_keys.column_name%TYPE)
AS $$
BEGIN
RETURN QUERY SELECT column_name FROM foreign_keys WHERE table_name = tg_table_name AND
foreign_table_name = 'permission';
END;
$$ LANGUAGE plpgsql;
在 Postgresql 9.3 下,我收到以下警告消息:
type reference foreign_keys.column_name%TYPE converted to information_schema.sql_identifier (SQL State: 00000 - Error Code: 0)
我做错了什么,我该如何纠正?
回答我自己的问题...
事实证明这是无害的信息级日志记录:https ://stackoverflow.com/a/3531274/14731