Re: describe objects, as in pg_depend

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: describe objects, as in pg_depend
Дата
Msg-id 1290107402-sup-9116@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: describe objects, as in pg_depend  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: describe objects, as in pg_depend  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Excerpts from Tom Lane's message of jue nov 18 14:49:21 -0300 2010:

> Please do not do this:
> 
> +/* this doesn't really need to appear in any header file */
> +Datum    pg_describe_object(PG_FUNCTION_ARGS);
> 
> Put the extern declaration in a header file, don't be cute.

Oh, I forgot to comment on this.  I had initially put the declaration in
builtins.h, but then I noticed that namespace.c contains a bunch of
declarations -- I even copied the comment almost verbatim:

/* These don't really need to appear in any header file */
Datum       pg_table_is_visible(PG_FUNCTION_ARGS);
Datum       pg_type_is_visible(PG_FUNCTION_ARGS);
Datum       pg_function_is_visible(PG_FUNCTION_ARGS);
Datum       pg_operator_is_visible(PG_FUNCTION_ARGS);
Datum       pg_opclass_is_visible(PG_FUNCTION_ARGS);
Datum       pg_conversion_is_visible(PG_FUNCTION_ARGS);
Datum       pg_ts_parser_is_visible(PG_FUNCTION_ARGS);
Datum       pg_ts_dict_is_visible(PG_FUNCTION_ARGS);
Datum       pg_ts_template_is_visible(PG_FUNCTION_ARGS);
Datum       pg_ts_config_is_visible(PG_FUNCTION_ARGS);
Datum       pg_my_temp_schema(PG_FUNCTION_ARGS);
Datum       pg_is_other_temp_schema(PG_FUNCTION_ARGS);


This seems to have originated in this commit:

commit 4ab8e69094452286a5894f1b2b237304808f4391
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date:   Fri Aug 9 16:45:16 2002 +0000
   has_table_privilege spawns scions has_database_privilege, has_function_privilege,   has_language_privilege,
has_schema_privilegeto let SQL queries test   all the new privilege types in 7.3.  Also, add functions
pg_table_is_visible,  pg_type_is_visible, pg_function_is_visible, pg_operator_is_visible,   pg_opclass_is_visible to
testwhether objects contained in schemas are   visible in the current search path.  Do some minor cleanup to centralize
 accesses to pg_database, as well.
 


I have to say that I'm baffled as to why has_database_privilege et al
were declared in builtins.h but pg_table_is_visible et al in dependency.c.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Indent authentication overloading
Следующее
От: Tom Lane
Дата:
Сообщение: Re: final patch - plpgsql: for-in-array