01ae7b8c10
Roles are not created anymore, previously private functions for table information extraction (CDB_UserTables, CDB_TableIndexes, CDB_ColumnNames, CDB_ColumnType) will now be callable by anyone while only returning information about tables over which the calling user has SELECT privilege. Closes #36
14 lines
350 B
PL/PgSQL
14 lines
350 B
PL/PgSQL
-- Function returning the column names of a table
|
|
CREATE OR REPLACE FUNCTION CDB_ColumnNames(REGCLASS)
|
|
RETURNS SETOF information_schema.sql_identifier
|
|
AS $$
|
|
|
|
SELECT column_name
|
|
FROM information_schema.columns
|
|
WHERE
|
|
table_name IN (SELECT CDB_UserTables())
|
|
AND table_name = '' || $1 || '';
|
|
|
|
$$ LANGUAGE SQL;
|
|
|