Alvaro Herrera <alvherre@commandprompt.com> writes:
> However I am also against what seems to be the flow. Normally, you
> don't write overloaded plpgsql functions such as "equal". Case in
> point, the equality functions in core have funny names like "int4eq" and
> so on. Instead, at least in my experience, the overloaded functions
> people seem to have in their databases are like do_stuff_to_foobars()
> and you have one version for foos and another one for bars.
+1
I too want to have my overloaded functions all in the same file, as much
as to have made that the only behavior in getddl.py:
https://github.com/dimitri/getddl
> If you're doing lots of equality functions, surely it would make more
> sense to package them up as an extension anyway along with all the other
> thingies you need for the type you're supposedly writing. So it's a
> completely different market than what we're aiming at here.
+1
Tom Lane <tgl@sss.pgh.pa.us> writes:
> FWIW, I'm attracted to the all-similarly-named-functions-together
> method, mainly because it dodges the problem of how to encode a
> function's argument list into a filename. However, we're being
> short-sighted to only think of functions here. What about operators?
> Or casts? Those don't have simple names either.
I would argue like Álvaro that when dealing with operators and casts
you're probably writing an extension already, and we're providing
another way to deal with that.
Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support