Deduce parameter OIDS Though providing an OID type in PQprepare is necessary for queries like "SELECT $1;" (not "SELECT $1::int"), those are of minimal usage, as even single value functions have specific types. Using PQdescribePrepared one can ask postgresql to deduce the OID type of each parameter, based on what arguments a function takes, or what columns a table has. We cannot specify the OIDs ourselves, because we cannot predict what will be sent in the future to PQexecParams. If we see an integer and pick OID 21 in PQprepare, but then later pass the integer 65537 for that column, it will fail since that integer cannot fit in an int2 value of OID 21, and we can't change the OID value after we've prepared the statement. Maybe in the future a good idea would be to allow some interface for specifying the OIDs to cast to explicitly, if you're inserting a million integers all less than 256 to a numeric column for some odd reason it'll be a big performance savings to use int2 instead of numeric. Also if you do select without a definite type aka "SELECT 42", instead of choosing something intelligent, the database will error out and the query will fail, so probably should do something about that too. # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Author: Mongoose # Committer: synx # # On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # modified: converters/engine.ss # modified: converters/general.ss # modified: ffi.ss # modified: main.ss # modified: test-bytea.ss # modified: test-wrapper.ss # # Untracked files: # (use "git add ..." to include in what will be committed) # # compiled/ # doc.scrbl # info.ss # libpq.plt # planet-docs/