On Sun, Oct 16, 2005 at 11:03:52AM +0200, Sim Zacks wrote: > I tried to create a new type with input and output functions in plpgsql and > it didn't work. > The error I got is there is no type uint2. > Is this because plpgsql does not allow you to create input/output fuctions? > It is a very simple function, so I didn't want to do it in C. > Is there a reason that it only works in C and not plpgsql? Unfortunatly, I don't think type input/output functions can be written in anything other than C. IIRC, no other PL understands the cstring type. As for why, well, because nobody has done the legwork yet. Oh yes, type input/output functions are also called at various points, including during parsing where there is no current snapshot. Whether the PLs are affected by this I don't know, but you cannot do SPI at that point. Hope this helps, -- Martijn van Oosterhout <kleptog@xxxxxxxxx> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
Attachment:
pgpWhPf621VyJ.pgp
Description: PGP signature