> For example, you could use XML to describe the > data (I'm no fan of XML, but it does suit a need here and allows > validation of the provided data), especially as Postgres has XML parsing > functionality. Would you go so far as to suggest making the entire parameter an XML statement, something like: CREATE FUNCTION create_transaction (txn xml) ... I don't know, it seems like with converting everything to and from XML, we really haven't made things any better, just added the complexity of adding an intermediate technology. Also, I'm not a fan of XML either, and for the most part have managed to steer relatively clear of it so far. Getting pulled into that black whole is something I'd rather avoid, if possible.... > Or you could use a more sophisticated procedural language (plpython or > plphp, for example) that's capable of marshalling and unmarshalling data > structures to strings and vice versa (eg. '{foo:1,bar:2}'). I haven't looked into the other procedural languages besides PGSQL, although I am familiar with Python in general. Perhaps that may be the way to go ... > You would still have a SELECT statement that INSERTs data, which is > semantically a bad thing to do IMHO. True, although others have suggested always returning something useful from the function. For example, it's more likely the transaction id would be assigned using a sequence inside the database. The function could then return that id after successfully creating the transaction. Karl Nack Futurity, Inc 5121 N Ravenswood Ave Chicago, IL 60640 773-506-2007 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general