Re: Function parameter names
От | Peter Eisentraut |
---|---|
Тема | Re: Function parameter names |
Дата | |
Msg-id | Pine.LNX.4.44.0311231812080.4773-100000@peter.localdomain обсуждение исходный текст |
Ответ на | Function parameter names (Dennis Bjorklund <db@zigo.dhs.org>) |
Ответы |
Re: Function parameter names
Re: Function parameter names |
Список | pgsql-hackers |
Dennis Bjorklund writes: > I'm in the middle of implementing function parameter names. How will that work in arbitrary procedural languages? > Would it be a good idea to create a namevector in the same way as > oidvector? Would a normal array like name[] be better? > > What is the reason for the oidvector to be it's own type instead of a > oid[]? An oidvector is fixed length, so you can access it via a C struct, like pgprocval->proargtypes[2]. With a normal array, things get much more complicated, and that cost would be fairly large if you want to resolve the argument types of function calls. (This is the reason that the maximum number of function parameters is limited to some arbitrary number.) So these two reasons make a "namevector" impractical: First, it would probably not be in the performance critical path. Second, it would use up a fixed length of NAMEDATALEN * FUNC_MAX_ARGS (currently 1024 bytes) in every pg_proc row. In this case, a regular name[] would be more suitable. Just be sure to put it after all the fixed-length fields. -- Peter Eisentraut peter_e@gmx.net
В списке pgsql-hackers по дате отправления: