Peter Eisentraut <[EMAIL PROTECTED]> writes:
> Am Montag, 19. Februar 2007 16:26 schrieb Tom Lane:
>> Peter Eisentraut <[EMAIL PROTECTED]> writes:
>>> Am Montag, 19. Februar 2007 10:16 schrieb Magnus Hagander:
>>>> This breaks the fmgrtab generator on msvc.
>>
>>> It's intentional.
>> 
>> Kindly change that intention.

> What is wrong?

Well, in the first place Gen_fmgrtab.sh is producing garbage:

#define F_CURSOR_TO_XML DATAINSERT
#define F_CURSOR_TO_XMLSCHEMA DATAINSERT
#define F_QUERY_TO_XML DATAINSERT
#define F_QUERY_TO_XML_AND_XMLSCHEMA DATAINSERT
#define F_QUERY_TO_XMLSCHEMA DATAINSERT
#define F_TABLE_TO_XML DATAINSERT
#define F_TABLE_TO_XML_AND_XMLSCHEMA DATAINSERT
#define F_TABLE_TO_XMLSCHEMA DATAINSERT
#define F_BYTEAOUT 31
#define F_CHAROUT 33

const FmgrBuiltin fmgr_builtins[] = {
  { 0, "cursor_to_xml", 5, true, false, cursor_to_xml },
  { 0, "cursor_to_xmlschema", 4, true, false, cursor_to_xmlschema },
  { 0, "query_to_xml", 4, true, false, query_to_xml },
  { 0, "query_to_xml_and_xmlschema", 4, true, false, query_to_xml_and_xmlschema 
},
  { 0, "query_to_xmlschema", 4, true, false, query_to_xmlschema },
  { 0, "table_to_xml", 4, true, false, table_to_xml },
  { 0, "table_to_xml_and_xmlschema", 4, true, false, table_to_xml_and_xmlschema 
},
  { 0, "table_to_xmlschema", 4, true, false, table_to_xmlschema },
  { 31, "byteaout", 1, true, false, byteaout },

The fact that that table is broken means you're incurring expensive
linear searches to invoke these functions.  It's only by chance that
it works at all...

In the second place, if you don't want to predetermine OIDs for your
functions then they shouldn't be in hardwired pg_proc.h rows at all.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to