Re: Get TupleDesc for extension-defined types
От | Pavel Stehule |
---|---|
Тема | Re: Get TupleDesc for extension-defined types |
Дата | |
Msg-id | CAFj8pRBNxc41dPC3JkCQKZSAnOH7s7zCHHNb+YTRZ0dyUCzmxQ@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Get TupleDesc for extension-defined types
|
Список | pgsql-hackers |
Hi
st 18. 9. 2024 v 9:04 odesílatel Florents Tselai <florents.tselai@gmail.com> napsal:
Correct me if I'm wrong,but for an extension that defines composite types,there's currently no easy way to get a TupleDesc, even for its own types.Something likeTupleDesc get_extension_type_tupledesc(const char *extname, const char *typname)Here's a routine I'vestolenborrowed from pramsey's code and have been using ever since.Could this be exposed in extension.h ? (probably without the version check)
I don't think this functionality is generally useful. Wrapping TypeGetTupleDesc(typoid, NIL) is very specific, and probably this code should be inside the extension.
Different question is API for searching in system catalog and dependencies. I can imagine some functions like
Oid extid = get_extension_id(extname);
Oid objid = get_extension_object_id(extid, schema_can_be_null, name, TYPEOID); // can be used for routine, table, ...
tupdesc = TypeGetTupleDesc(objid, NIL);
Regards
Pavel
В списке pgsql-hackers по дате отправления: