]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Replace hardcoded switch in object_exists() with a lookup table.
authorRobert Haas <rhaas@postgresql.org>
Tue, 11 Oct 2011 13:14:30 +0000 (09:14 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 11 Oct 2011 13:14:30 +0000 (09:14 -0400)
commitfa351d5a0db0672b6f586315720302e493116f27
treecf4611779971e4253a2b5b450e76c2ec446acc7e
parente76bcaba9cb330b32e9a80dfe9cd510d802121c4
Replace hardcoded switch in object_exists() with a lookup table.

There's no particular advantage to this change on its face; indeed,
it's possible that this might be slightly slower than the old way.
But it makes this information more easily accessible to other
functions, and therefore paves the way for future code consolidation.
Performance isn't critical here, so there's no need to be smart about
how we do the search.

This is a heavily cut-down version of a patch from KaiGai Kohei,
with several fixes by me.  Additional review from Dimitri Fontaine.
src/backend/catalog/objectaddress.c