1. You need 2 schema with a table of the same name 2. You need a stored proc that has the same name in each schema and takes the table from step 1 as an INPUT parameter. 3. From here I created a custom type in Java essentially an object that extends PGobject and Overrode the getValue() method and sets the Type when constructed. 4. I am using "set search_path TO myschema" when i get a connection but the Driver/PG gets confussed and will not call the right procedure because it tries to call schema2.myproc(schema1.mytable) Even when I set the type to the schema it doesn't work.
I tailed the query log and the query the the Driver runs to find the OID of the composite type is based on table name and ignores the scehma even when I use set search_path.
My only solution was to keep the table names unique even in different schemas when using Composite Types and IN Params in Stored Procs.