Martijn van Oosterhout <kleptog@svana.org> writes:
> On Sat, Nov 12, 2005 at 11:18:51AM -0500, Tom Lane wrote:
>> How so? All we care about is being able to (1) compare for equality,
>> and (2) print out something useful in error messages. I claim that
>> PG_VERSION does #1 equally well and #2 better.
> I was thinking of compile time. The compiler can compare
> CATALOG_VERSION in #if statements, but it can't compare strings.
We aren't asking the compiler to compare anything, though. I'm
imagining just that the PG_FUNCTION_INFO_V1 macro will insert the value
into the Pg_finfo_record struct, and the comparison will happen at run
time in dfmgr.c.
> Another way that doesn't require code changes would be to make a dummy symbol
> containing the version and referring to it in pg_finfo. Then you'd get
> error messages like: Couldn't find symbol 'PG_version_verify_8_1'. i.e.
> let the dynamic linker do the work.
That would be attractive if we could get it to happen without the
assumption that the library uses PG_FUNCTION_INFO_V1 ... but if it still
needs that assumption, it doesn't seem like much of an improvement.
It's not always easy for people to see dynamic-linker error messages,
so I'd rather the message were issued under our control when possible.
regards, tom lane