pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
getProcedureColumns
21+ messages / 3 participants
[nested] [flat]

* getProcedureColumns
@ 2007-01-31 08:29  Jeffrey Cox <namredips@gmail.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Jeffrey Cox @ 2007-01-31 08:29 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,
    I been working with metadata on stored procedures and discovered  
that I can't get parameter names via getProcedureColumns. So i  
checked out the source and took a look at the method. Seems that for  
column names, a $ is appended to the arg type count. I guess I don't  
know if there is a reason that the actual parameter names are not  
used, or its just low on the TODO list. I went ahead and updated the  
method return column names as stored in procargnames of  
pg_catalog.pg_proc. I have attached a patch.

I honestly don't know if this is the correct mechanism to handle this  
(I poped into #postgres and was told to attach a patch to an email to  
this list), so just point me in the right direction if need be  
(either on how to submit the patch, or why making this change is  
stupid).


Jeff

Attachments:

postgres-jdbc-patch.rtf (text/rtf, 2.8K) download Index: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java,v retrieving revision 1.33 diff -u -r1.33 AbstractJdbc2DatabaseMetaData.java --- org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java 1 Dec 2006 08:53:45 -0000 1.33 +++ org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java 31 Jan 2007 08:15:35 -0000 @@ -1724,9 +1724,15 @@ String sql; if (connection.haveMinimumServerVersion("7.3")) { - sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid " + + sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, "; + + if(connection.haveMinimumCompatibleVersion("8.0")) + sql += "p.proargnames,"; + + sql += "t.typtype,t.typrelid " + " FROM pg_catalog.pg_proc p,pg_catalog.pg_namespace n, pg_catalog.pg_type t " + " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid "; + if (schemaPattern != null && !"".equals(schemaPattern)) { sql += " AND n.nspname LIKE '" + escapeQuotes(schemaPattern) + "' "; @@ -1758,13 +1764,18 @@ String returnTypeType = rs.getString("typtype"); int returnTypeRelid = rs.getInt("typrelid"); String strArgTypes = rs.getString("proargtypes"); + String strArgNames[] = null; + Array argNamesArray = rs.getArray("proargnames"); + if(argNamesArray != null) + strArgNames = (String[])argNamesArray.getArray(); StringTokenizer st = new StringTokenizer(strArgTypes); Vector argTypes = new Vector(); while (st.hasMoreTokens()) { argTypes.addElement(new Integer(st.nextToken())); } - + + // decide if we are returning a single column result. if (!returnTypeType.equals("c")) { @@ -1793,7 +1804,14 @@ tuple[0] = null; tuple[1] = schema; tuple[2] = procedureName; - tuple[3] = connection.encodeString("$" + (i + 1)); + if(strArgNames != null) + { + tuple[3] = connection.encodeString(strArgNames[i]); + } + else + { + tuple[3] = connection.encodeString("$" + (i + 1)); + } tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnIn)); tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); tuple[6] = connection.encodeString(connection.getPGType(argOid));
^ permalink raw reply [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-01-31 21:20  Kris Jurka <books@ejurka.com>
  parent: Jeffrey Cox <namredips@gmail.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Kris Jurka @ 2007-01-31 21:20 UTC (permalink / raw)
  To: Jeffrey Cox <namredips@gmail.com>; +Cc: pgsql-jdbc



On Wed, 31 Jan 2007, Jeffrey Cox wrote:

>  I been working with metadata on stored procedures and discovered that I 
> can't get parameter names via getProcedureColumns. So i checked out the 
> source and took a look at the method. Seems that for column names, a $ is 
> appended to the arg type count. I guess I don't know if there is a reason 
> that the actual parameter names are not used, or its just low on the TODO 
> list. I went ahead and updated the method return column names as stored in 
> procargnames of pg_catalog.pg_proc. I have attached a patch.

It just hasn't been updated in a while.

> I honestly don't know if this is the correct mechanism to handle this (I 
> poped into #postgres and was told to attach a patch to an email to this 
> list), so just point me in the right direction if need be (either on how to 
> submit the patch, or why making this change is stupid).
>

This is exactly the place to send it.  Any chance we can also convince you 
to add a test case and fix COLUMN_TYPE for out parameters?

Kris Jurka



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-01-31 23:20  Jeffrey Cox <namredips@gmail.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Jeffrey Cox @ 2007-01-31 23:20 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc

Yea sure... I will look into the COLUM_TYPE issue and write a test  
case for column names. On that note, when I ran the test suit all the  
jdbc2 test would run fine, however, most of the others failed due to  
"to many connections".  I of course tried to up my max connections  
beyond 20, but looks like will need to up shared memory maximums.  
(which might be interesting given I am on os X. Just never done that  
since switching). So before I go about figuring all that out, are  
failures expected? and if not, any thoughts on the number of  
connections I should configure for?

Jeff
On Jan 31, 2007, at 4:20 PM, Kris Jurka wrote:

>
>
> On Wed, 31 Jan 2007, Jeffrey Cox wrote:
>
>>  I been working with metadata on stored procedures and discovered  
>> that I can't get parameter names via getProcedureColumns. So i  
>> checked out the source and took a look at the method. Seems that  
>> for column names, a $ is appended to the arg type count. I guess I  
>> don't know if there is a reason that the actual parameter names  
>> are not used, or its just low on the TODO list. I went ahead and  
>> updated the method return column names as stored in procargnames  
>> of pg_catalog.pg_proc. I have attached a patch.
>
> It just hasn't been updated in a while.
>
>> I honestly don't know if this is the correct mechanism to handle  
>> this (I poped into #postgres and was told to attach a patch to an  
>> email to this list), so just point me in the right direction if  
>> need be (either on how to submit the patch, or why making this  
>> change is stupid).
>>
>
> This is exactly the place to send it.  Any chance we can also  
> convince you to add a test case and fix COLUMN_TYPE for out  
> parameters?
>
> Kris Jurka




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-01-31 23:49  Kris Jurka <books@ejurka.com>
  parent: Jeffrey Cox <namredips@gmail.com>
  0 siblings, 2 replies; 21+ messages in thread

From: Kris Jurka @ 2007-01-31 23:49 UTC (permalink / raw)
  To: Jeffrey Cox <namredips@gmail.com>; +Cc: pgsql-jdbc



On Wed, 31 Jan 2007, Jeffrey Cox wrote:

> Yea sure... I will look into the COLUM_TYPE issue and write a test case 
> for column names. On that note, when I ran the test suit all the jdbc2 
> test would run fine, however, most of the others failed due to "to many 
> connections".  I of course tried to up my max connections beyond 20, but 
> looks like will need to up shared memory maximums. (which might be 
> interesting given I am on os X. Just never done that since switching). 
> So before I go about figuring all that out, are failures expected? and 
> if not, any thoughts on the number of connections I should configure 
> for?
>

No failures are expected, but it's not surprising for things to go bad 
after completing the jdbc2 tests because that's when it starts testing 
connection pooling stuff that will open a fair number of connections.  I 
don't think it uses more than 20 simultaneous connections so it's likely 
that there are just some that aren't closed or are in the process of 
closing as new ones are opened.

If you can't get these tests straightened out I wouldn't worry about it 
because the changes you are making shouldn't affect any tests beyond the 
jdbc2 ones.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-02-01 06:19  Jeffrey Cox <namredips@gmail.com>
  parent: Kris Jurka <books@ejurka.com>
  1 sibling, 0 replies; 21+ messages in thread

From: Jeffrey Cox @ 2007-02-01 06:19 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc


On Jan 31, 2007, at 6:49 PM, Kris Jurka wrote:

>
>
> On Wed, 31 Jan 2007, Jeffrey Cox wrote:
>
>> Yea sure... I will look into the COLUM_TYPE issue and write a test  
>> case for column names. On that note, when I ran the test suit all  
>> the jdbc2 test would run fine, however, most of the others failed  
>> due to "to many connections".  I of course tried to up my max  
>> connections beyond 20, but looks like will need to up shared  
>> memory maximums. (which might be interesting given I am on os X.  
>> Just never done that since switching). So before I go about  
>> figuring all that out, are failures expected? and if not, any  
>> thoughts on the number of connections I should configure for?
>>
>
> No failures are expected, but it's not surprising for things to go  
> bad after completing the jdbc2 tests because that's when it starts  
> testing connection pooling stuff that will open a fair number of  
> connections.  I don't think it uses more than 20 simultaneous  
> connections so it's likely that there are just some that aren't  
> closed or are in the process of closing as new ones are opened.
>
> If you can't get these tests straightened out I wouldn't worry  
> about it because the changes you are making shouldn't affect any  
> tests beyond the jdbc2 ones.
>

Yes I assumed as much.

I took a look at the the code to night regarding COLUMN_TYPE, and it  
doesn't look to bad. Given other project work this week, it will  
probably be the weekend before I churn it out.

Jeff


> Kris Jurka




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-02-06 09:36  Jeffrey Cox <namredips@gmail.com>
  parent: Kris Jurka <books@ejurka.com>
  1 sibling, 1 reply; 21+ messages in thread

From: Jeffrey Cox @ 2007-02-06 09:36 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc

Finally got these patches finished up. Sorry for the delay ( had a  
machine learning program fighting me all weekend). Please let me know  
if this is not what you need, or more it turns out there is something  
not working. All seems to be working, and am actually using the  
resulting jar in a external app. Though the tests get the job done,  
they are a bit 'brute force'. i figure they can be re-factored later.  
probably goes for the other code as well I suppose.

Jeff

On Jan 31, 2007, at 6:49 PM, Kris Jurka wrote:

>
>
> On Wed, 31 Jan 2007, Jeffrey Cox wrote:
>
>> Yea sure... I will look into the COLUM_TYPE issue and write a test  
>> case for column names. On that note, when I ran the test suit all  
>> the jdbc2 test would run fine, however, most of the others failed  
>> due to "to many connections".  I of course tried to up my max  
>> connections beyond 20, but looks like will need to up shared  
>> memory maximums. (which might be interesting given I am on os X.  
>> Just never done that since switching). So before I go about  
>> figuring all that out, are failures expected? and if not, any  
>> thoughts on the number of connections I should configure for?
>>
>
> No failures are expected, but it's not surprising for things to go  
> bad after completing the jdbc2 tests because that's when it starts  
> testing connection pooling stuff that will open a fair number of  
> connections.  I don't think it uses more than 20 simultaneous  
> connections so it's likely that there are just some that aren't  
> closed or are in the process of closing as new ones are opened.
>
> If you can't get these tests straightened out I wouldn't worry  
> about it because the changes you are making shouldn't affect any  
> tests beyond the jdbc2 ones.
>
> Kris Jurka

Attachments:

patch_Abstractjdbc2Array.txt (text/plain, 967B) download ### Eclipse Workspace Patch 1.0 #P postgres jdbc Index: org/postgresql/jdbc2/AbstractJdbc2Array.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Array.java,v retrieving revision 1.18 diff -u -r1.18 AbstractJdbc2Array.java --- org/postgresql/jdbc2/AbstractJdbc2Array.java 4 Dec 2005 21:40:33 -0000 1.18 +++ org/postgresql/jdbc2/AbstractJdbc2Array.java 6 Feb 2007 09:24:40 -0000 @@ -199,6 +199,10 @@ ((double[])retVal)[i++] = AbstractJdbc2ResultSet.toDouble( arrayContents[(int)index++] ); break; case Types.CHAR: +// retVal = new Character[ count ]; +// for ( ; count > 0; count-- ) +// ((Character[])retVal)[i++] = arrayContents[(int)index++].charAt(0) ; +// break; case Types.VARCHAR: retVal = new String[ count ]; for ( ; count > 0; count-- )
patch_Abstractjdbc2DatabasemetaData.txt (text/plain, 5.9K) download ### Eclipse Workspace Patch 1.0 #P postgres jdbc Index: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java,v retrieving revision 1.33 diff -u -r1.33 AbstractJdbc2DatabaseMetaData.java --- org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java 1 Dec 2006 08:53:45 -0000 1.33 +++ org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java 6 Feb 2007 09:25:52 -0000 @@ -1724,9 +1724,18 @@ String sql; if (connection.haveMinimumServerVersion("7.3")) { - sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid " + + sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, "; + + if(connection.haveMinimumCompatibleVersion("8.0")) + sql += "p.proargnames,"; + + if(connection.haveMinimumCompatibleVersion("8.1")) + sql += "p.proargmodes,"; + + sql += "t.typtype,t.typrelid " + " FROM pg_catalog.pg_proc p,pg_catalog.pg_namespace n, pg_catalog.pg_type t " + " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid "; + if (schemaPattern != null && !"".equals(schemaPattern)) { sql += " AND n.nspname LIKE '" + escapeQuotes(schemaPattern) + "' "; @@ -1758,13 +1767,23 @@ String returnTypeType = rs.getString("typtype"); int returnTypeRelid = rs.getInt("typrelid"); String strArgTypes = rs.getString("proargtypes"); - StringTokenizer st = new StringTokenizer(strArgTypes); + + String strArgNames[] = null; + Array argNamesArray = rs.getArray("proargnames"); + if(argNamesArray != null) + strArgNames = (String[])argNamesArray.getArray(); + String strArgModes[] = null; + Array argModesArray = rs.getArray("proargmodes"); + if(argModesArray != null) + strArgModes = (String[])argModesArray.getArray(); + StringTokenizer st = new StringTokenizer(strArgTypes); Vector argTypes = new Vector(); while (st.hasMoreTokens()) { argTypes.addElement(new Integer(st.nextToken())); } - + + // decide if we are returning a single column result. if (!returnTypeType.equals("c")) { @@ -1786,17 +1805,65 @@ } // Add a row for each argument. - for (int i = 0; i < argTypes.size(); i++) + + int numRows = 0; + if(strArgNames != null) + numRows = strArgNames.length; + else + numRows = argTypes.size(); + int j = 0; //argType counter + for (int i = 0; i < numRows; i++) { - int argOid = ((Integer)argTypes.elementAt(i)).intValue(); byte[][] tuple = new byte[13][]; tuple[0] = null; tuple[1] = schema; tuple[2] = procedureName; - tuple[3] = connection.encodeString("$" + (i + 1)); - tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnIn)); - tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); - tuple[6] = connection.encodeString(connection.getPGType(argOid)); + + if(strArgNames != null) + { + tuple[3] = connection.encodeString(strArgNames[i]); + } + else + { + tuple[3] = connection.encodeString("$" + (i + 1)); + } + + if(strArgModes != null) + { + + tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnUnknown)); + if(strArgModes[i].equals("i")) + { + int argOid = ((Integer)argTypes.elementAt(j)).intValue(); + tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnIn)); + tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); + tuple[6] = connection.encodeString(connection.getPGType(argOid)); + j++; + } + if(strArgModes[i].equals("o")) + { + tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnOut)); + tuple[5] = null; + tuple[6] = null; + } + if(strArgModes[i].equals("b")) + { + int argOid = ((Integer)argTypes.elementAt(j)).intValue(); + tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnInOut)); + tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); + tuple[6] = connection.encodeString(connection.getPGType(argOid)); + j++; + } + } + else + { + int argOid = ((Integer)argTypes.elementAt(j)).intValue(); + tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnIn)); + tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); + tuple[6] = connection.encodeString(connection.getPGType(argOid)); + j++; + } + tuple[7] = null; tuple[8] = null; tuple[9] = null;
patch_DatabaseMetaDataTest.txt (text/plain, 9.1K) download ### Eclipse Workspace Patch 1.0 #P postgres jdbc Index: org/postgresql/test/jdbc2/DatabaseMetaDataTest.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java,v retrieving revision 1.36 diff -u -r1.36 DatabaseMetaDataTest.java --- org/postgresql/test/jdbc2/DatabaseMetaDataTest.java 3 Feb 2006 21:10:15 -0000 1.36 +++ org/postgresql/test/jdbc2/DatabaseMetaDataTest.java 6 Feb 2007 09:27:39 -0000 @@ -39,7 +39,10 @@ TestUtil.createTable( con, "sercoltest", "a int, b serial, c bigserial"); TestUtil.createTable( con, "\"a\\\"", "a int4"); TestUtil.createTable( con, "\"a'\"", "a int4"); - + TestUtil.createFunction(con, "inargtest", "arg1 int, arg2 varchar", "integer" , "select * from pg_proc;"); + TestUtil.createFunction(con, "outargtest", "arg1 int, arg2 varchar, out arg3 int4, out arg4 char", "record" , "select * from pg_proc;"); + TestUtil.createFunction(con, "inoutargtest", "arg1 int, arg2 varchar, out arg3 int4, out arg4 char, inout arg5 int4, inout arg6 varchar", "record" , "select * from pg_proc;"); + Statement stmt = con.createStatement(); //we add the following comments to ensure the joins to the comments //are done correctly. This ensures we correctly test that case. @@ -54,6 +57,9 @@ TestUtil.dropSequence( con, "sercoltest_c_seq"); TestUtil.dropTable( con, "\"a\\\""); TestUtil.dropTable( con, "\"a'\""); + TestUtil.dropFunction(con, "inargtest (int, varchar)"); +// TestUtil.dropFunction(con, "outargtest (IN int,IN varchar,OUT int4,OUT char)"); +// TestUtil.dropFunction(con, "inoutargtest (IN int,IN varchar,OUT int4,OUT char,INOUT int4,INOUT varchar)"); TestUtil.closeDB( con ); } @@ -420,15 +426,201 @@ rs.close(); } - public void testProcedureColumns() throws SQLException + public void testProcedureColumnsIN() throws SQLException { - // At the moment just test that no exceptions are thrown KJ DatabaseMetaData dbmd = con.getMetaData(); assertNotNull(dbmd); - ResultSet rs = dbmd.getProcedureColumns(null, null, null, null); + ResultSet rs = dbmd.getProcedureColumns(null, null, "inargtest", "%"); + + assertTrue(rs.next()); + assertEquals("inargtest",rs.getString(3)); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("returnValue",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("5",rs.getString(5)); + + assertEquals("4",rs.getString(6)); + assertEquals("int4",rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg1",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("1",rs.getString(5)); + + assertEquals("4",rs.getString(6)); + assertEquals("int4",rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg2",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("1",rs.getString(5)); + + assertEquals("12",rs.getString(6)); + assertEquals("varchar",rs.getString(7)); + assertEquals("2",rs.getString(12)); rs.close(); + } + public void testProcedureColumnsOUT() throws SQLException + { + DatabaseMetaData dbmd = con.getMetaData(); + assertNotNull(dbmd); + ResultSet rs = dbmd.getProcedureColumns(null, null, "outargtest", "%"); + + assertTrue(rs.next()); + assertEquals("outargtest",rs.getString(3)); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("returnValue",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("5",rs.getString(5)); + + assertEquals("1111",rs.getString(6)); + assertEquals("record",rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg1",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("1",rs.getString(5)); + + assertEquals("4",rs.getString(6)); + assertEquals("int4",rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg2",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("1",rs.getString(5)); + + assertEquals("12",rs.getString(6)); + assertEquals("varchar",rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg3",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("4",rs.getString(5)); + + assertNull(rs.getString(6)); + assertNull(rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg4",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("4",rs.getString(5)); + + assertNull(rs.getString(6)); + assertNull(rs.getString(7)); + assertEquals("2",rs.getString(12)); + rs.close(); + + } + + public void testProcedureColumnsINOUT() throws SQLException + { + DatabaseMetaData dbmd = con.getMetaData(); + assertNotNull(dbmd); + ResultSet rs = dbmd.getProcedureColumns(null, null, "inoutargtest", "%"); + + assertTrue(rs.next()); + assertEquals("inoutargtest",rs.getString(3)); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("returnValue",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("5",rs.getString(5)); + + assertEquals("1111",rs.getString(6)); + assertEquals("record",rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg1",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("1",rs.getString(5)); + + assertEquals("4",rs.getString(6)); + assertEquals("int4",rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg2",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("1",rs.getString(5)); + + assertEquals("12",rs.getString(6)); + assertEquals("varchar",rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg3",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("4",rs.getString(5)); + + assertNull(rs.getString(6)); + assertNull(rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg4",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("4",rs.getString(5)); + + assertNull(rs.getString(6)); + assertNull(rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg5",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("2",rs.getString(5)); + + assertEquals("4",rs.getString(6)); + assertEquals("int4",rs.getString(7)); + assertEquals("2",rs.getString(12)); + + assertTrue(rs.next()); + if (TestUtil.haveMinimumServerVersion(con, "8.0")) + assertEquals("arg6",rs.getString(4)); + + if (TestUtil.haveMinimumServerVersion(con, "8.1")) + assertEquals("2",rs.getString(5)); + + assertEquals("12",rs.getString(6)); + assertEquals("varchar",rs.getString(7)); + assertEquals("2",rs.getString(12)); + rs.close(); + + } + public void testVersionColumns() throws SQLException { // At the moment just test that no exceptions are thrown KJ
patch_TestUtil.txt (text/plain, 2.1K) download ### Eclipse Workspace Patch 1.0 #P postgres jdbc Index: org/postgresql/test/TestUtil.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/TestUtil.java,v retrieving revision 1.22 diff -u -r1.22 TestUtil.java --- org/postgresql/test/TestUtil.java 1 Dec 2006 08:53:46 -0000 1.22 +++ org/postgresql/test/TestUtil.java 6 Feb 2007 09:27:07 -0000 @@ -218,6 +218,29 @@ } /* + * Helper - creates a test function for use by a test + */ + public static void createFunction(Connection con, + String function, + String args, + String returnType, + String body) throws SQLException + { + Statement st = con.createStatement(); + try + { + String sql = "CREATE OR REPLACE FUNCTION " + function + "(" + args + ") "; + sql += "RETURNS " + returnType + " AS "; + sql += "$BODY$ BEGIN " + body + " END; $BODY$ LANGUAGE 'plpgsql' VOLATILE"; + st.executeUpdate(sql); + } + finally + { + st.close(); + } + } + + /* * drop a sequence because older versions don't have dependency * information for serials */ @@ -262,6 +285,29 @@ } } + public static void dropFunction(Connection con, String function) throws SQLException + { + Statement stmt = con.createStatement(); + try + { + String sql = "DROP FUNCTION " + function +";"; + stmt.executeUpdate(sql); + } + finally + { + stmt.close(); + } +// catch (SQLException ex) +// { + // Since every create table issues a drop table + // it's easy to get a table doesn't exist error. + // we want to ignore these, but if we're in a + // transaction then we've got trouble +// if (!con.getAutoCommit()) +// throw ex; +// } + } + /* * Helper - generates INSERT SQL - very simple */
patch_TypeInfoCache.txt (text/plain, 1.1K) download ### Eclipse Workspace Patch 1.0 #P postgres jdbc Index: org/postgresql/jdbc2/TypeInfoCache.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/TypeInfoCache.java,v retrieving revision 1.6 diff -u -r1.6 TypeInfoCache.java --- org/postgresql/jdbc2/TypeInfoCache.java 3 Nov 2006 07:15:16 -0000 1.6 +++ org/postgresql/jdbc2/TypeInfoCache.java 6 Feb 2007 09:26:26 -0000 @@ -58,6 +58,7 @@ {"float4", new Integer(Oid.FLOAT4), new Integer(Types.REAL), "java.lang.Float"}, {"float8", new Integer(Oid.FLOAT8), new Integer(Types.DOUBLE), "java.lang.Double"}, {"bpchar", new Integer(Oid.BPCHAR), new Integer(Types.CHAR), "java.lang.String"}, + {"char", new Integer(Oid.CHAR), new Integer(Types.CHAR), "java.lang.String"}, {"varchar", new Integer(Oid.VARCHAR), new Integer(Types.VARCHAR), "java.lang.String"}, {"text", new Integer(Oid.TEXT), new Integer(Types.VARCHAR), "java.lang.String"}, {"name", new Integer(Oid.NAME), new Integer(Types.VARCHAR), "java.lang.String"},
^ permalink raw reply [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-02-14 06:37  Kris Jurka <books@ejurka.com>
  parent: Jeffrey Cox <namredips@gmail.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Kris Jurka @ 2007-02-14 06:37 UTC (permalink / raw)
  To: Jeffrey Cox <namredips@gmail.com>; +Cc: pgsql-jdbc



On Tue, 6 Feb 2007, Jeffrey Cox wrote:

> Finally got these patches finished up. Sorry for the delay ( had a machine 
> learning program fighting me all weekend). Please let me know if this is not 
> what you need, or more it turns out there is something not working. All seems 
> to be working, and am actually using the resulting jar in a external app. 
> Though the tests get the job done, they are a bit 'brute force'. i figure 
> they can be re-factored later. probably goes for the other code as well I 
> suppose.
>

This doesn't work on an 8.0 server so they're unlikely to work on 7.4 or 
7.3 servers either all of which the driver must support.  Right now I 
don't have all of these handy to test with, so if you don't either we'll 
have to wait for me to return to my normal dev machine.

Some other notes:

1) It's better to send all your changes as one patch instead of one per 
file.  It makes it easier to apply.

2) You've sent a patch for AbstractJdbc2Array that only adds something 
that's commented out.

3) When doing version comparisons you want 
connection.haveMinimumServerVersion, not MinimumCompatibleVersion.  The 
Compatible idea is supposed to indicate what version of the driver the 
current driver should imitate (although it's rarely used).

Kris Jurka




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-02-14 07:38  Jeffrey Cox <namredips@gmail.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Jeffrey Cox @ 2007-02-14 07:38 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc


On Feb 14, 2007, at 1:37 AM, Kris Jurka wrote:

>
>
> On Tue, 6 Feb 2007, Jeffrey Cox wrote:
>
>> Finally got these patches finished up. Sorry for the delay ( had a  
>> machine learning program fighting me all weekend). Please let me  
>> know if this is not what you need, or more it turns out there is  
>> something not working. All seems to be working, and am actually  
>> using the resulting jar in a external app. Though the tests get  
>> the job done, they are a bit 'brute force'. i figure they can be  
>> re-factored later. probably goes for the other code as well I  
>> suppose.
>>
>
> This doesn't work on an 8.0 server so they're unlikely to work on  
> 7.4 or 7.3 servers either all of which the driver must support.   
> Right now I don't have all of these handy to test with, so if you  
> don't either we'll have to wait for me to return to my normal dev  
> machine.

I can make them handy, but when you say they don't work do you mean  
it crashes, or what exactly. I ask only because the DBMS seems to  
have varying support for the method overall. below 7.3 not being able  
to support the call at all, below 8.0 not supporting argument names  
and below 8.1 not supporting argument modes. when I say not  
supporting, I mean there is not column for the data in 'pg_proc'. I  
didn't actually try this against those over servers, but looked it up  
in the respective documentation of each server version. I suppose  
that information might reside in another table, I will have to  
install the other versions and find out.

>
> Some other notes:
>
> 1) It's better to send all your changes as one patch instead of one  
> per file.  It makes it easier to apply.

good to know, would you like me to resend them?


>
> 2) You've sent a patch for AbstractJdbc2Array that only adds  
> something that's commented out.

My bad... I had made a number of changes in that file originally,  
then after some discussion, changed direction. I must have missed the  
comments.

>
> 3) When doing version comparisons you want  
> connection.haveMinimumServerVersion, not MinimumCompatibleVersion.   
> The Compatible idea is supposed to indicate what version of the  
> driver the current driver should imitate (although it's rarely used).

Also good to know, changed and the patch is attached.


Jeff



>
> Kris Jurka
>

Attachments:

patch.txt (text/plain, 5.8K) download ### Eclipse Workspace Patch 1.0 #P postgres jdbc Index: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java,v retrieving revision 1.33 diff -u -r1.33 AbstractJdbc2DatabaseMetaData.java --- org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java 1 Dec 2006 08:53:45 -0000 1.33 +++ org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java 14 Feb 2007 07:37:19 -0000 @@ -1724,9 +1724,18 @@ String sql; if (connection.haveMinimumServerVersion("7.3")) { - sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid " + + sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, "; + + if(connection.haveMinimumServerVersion("8.0")) + sql += "p.proargnames,"; + + if(connection.haveMinimumServerVersion("8.1")) + sql += "p.proargmodes,"; + + sql += "t.typtype,t.typrelid " + " FROM pg_catalog.pg_proc p,pg_catalog.pg_namespace n, pg_catalog.pg_type t " + " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid "; + if (schemaPattern != null && !"".equals(schemaPattern)) { sql += " AND n.nspname LIKE '" + escapeQuotes(schemaPattern) + "' "; @@ -1758,13 +1767,23 @@ String returnTypeType = rs.getString("typtype"); int returnTypeRelid = rs.getInt("typrelid"); String strArgTypes = rs.getString("proargtypes"); - StringTokenizer st = new StringTokenizer(strArgTypes); + + String strArgNames[] = null; + Array argNamesArray = rs.getArray("proargnames"); + if(argNamesArray != null) + strArgNames = (String[])argNamesArray.getArray(); + String strArgModes[] = null; + Array argModesArray = rs.getArray("proargmodes"); + if(argModesArray != null) + strArgModes = (String[])argModesArray.getArray(); + StringTokenizer st = new StringTokenizer(strArgTypes); Vector argTypes = new Vector(); while (st.hasMoreTokens()) { argTypes.addElement(new Integer(st.nextToken())); } - + + // decide if we are returning a single column result. if (!returnTypeType.equals("c")) { @@ -1786,17 +1805,65 @@ } // Add a row for each argument. - for (int i = 0; i < argTypes.size(); i++) + + int numRows = 0; + if(strArgNames != null) + numRows = strArgNames.length; + else + numRows = argTypes.size(); + int j = 0; //argType counter + for (int i = 0; i < numRows; i++) { - int argOid = ((Integer)argTypes.elementAt(i)).intValue(); byte[][] tuple = new byte[13][]; tuple[0] = null; tuple[1] = schema; tuple[2] = procedureName; - tuple[3] = connection.encodeString("$" + (i + 1)); - tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnIn)); - tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); - tuple[6] = connection.encodeString(connection.getPGType(argOid)); + + if(strArgNames != null) + { + tuple[3] = connection.encodeString(strArgNames[i]); + } + else + { + tuple[3] = connection.encodeString("$" + (i + 1)); + } + + if(strArgModes != null) + { + + tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnUnknown)); + if(strArgModes[i].equals("i")) + { + int argOid = ((Integer)argTypes.elementAt(j)).intValue(); + tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnIn)); + tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); + tuple[6] = connection.encodeString(connection.getPGType(argOid)); + j++; + } + if(strArgModes[i].equals("o")) + { + tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnOut)); + tuple[5] = null; + tuple[6] = null; + } + if(strArgModes[i].equals("b")) + { + int argOid = ((Integer)argTypes.elementAt(j)).intValue(); + tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnInOut)); + tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); + tuple[6] = connection.encodeString(connection.getPGType(argOid)); + j++; + } + } + else + { + int argOid = ((Integer)argTypes.elementAt(j)).intValue(); + tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnIn)); + tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); + tuple[6] = connection.encodeString(connection.getPGType(argOid)); + j++; + } + tuple[7] = null; tuple[8] = null; tuple[9] = null;
^ permalink raw reply [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-02-14 15:32  Kris Jurka <books@ejurka.com>
  parent: Jeffrey Cox <namredips@gmail.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Kris Jurka @ 2007-02-14 15:32 UTC (permalink / raw)
  To: Jeffrey Cox <namredips@gmail.com>; +Cc: pgsql-jdbc



On Wed, 14 Feb 2007, Jeffrey Cox wrote:

> I can make them handy, but when you say they don't work do you mean it 
> crashes, or what exactly. I ask only because the DBMS seems to have varying 
> support for the method overall. below 7.3 not being able to support the call 
> at all, below 8.0 not supporting argument names and below 8.1 not supporting 
> argument modes. when I say not supporting, I mean there is not column for the 
> data in 'pg_proc'. I didn't actually try this against those over servers, but 
> looked it up in the respective documentation of each server version. I 
> suppose that information might reside in another table, I will have to 
> install the other versions and find out.

1) Your tests try to create functions with named and output parameters 
unconditionally.  These can't be created on older servers.

2) The code you've added to TestUtil uses dollar quoting which isn't available on all 
servers.

3) The code in getProcedureColumns fails with a "couldn't find a column 
named ..." for older server versions.  You need to either add ", NULL as 
colname" to the sql for older versions or not fetch these columns 
unconditionally.

>> 1) It's better to send all your changes as one patch instead of one per 
>> file.  It makes it easier to apply.
>
> good to know, would you like me to resend them?
>

No, that's just a minor inconvenience, not an actual problem.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-02-14 17:31  Jeffrey Cox <namredips@gmail.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Jeffrey Cox @ 2007-02-14 17:31 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc


On Feb 14, 2007, at 10:32 AM, Kris Jurka wrote:

>
>
> On Wed, 14 Feb 2007, Jeffrey Cox wrote:
>
>> I can make them handy, but when you say they don't work do you  
>> mean it crashes, or what exactly. I ask only because the DBMS  
>> seems to have varying support for the method overall. below 7.3  
>> not being able to support the call at all, below 8.0 not  
>> supporting argument names and below 8.1 not supporting argument  
>> modes. when I say not supporting, I mean there is not column for  
>> the data in 'pg_proc'. I didn't actually try this against those  
>> over servers, but looked it up in the respective documentation of  
>> each server version. I suppose that information might reside in  
>> another table, I will have to install the other versions and find  
>> out.
>
> 1) Your tests try to create functions with named and output  
> parameters unconditionally.  These can't be created on older servers.
>
ok will change

> 2) The code you've added to TestUtil uses dollar quoting which  
> isn't available on all servers.
>
ok will change it.

> 3) The code in getProcedureColumns fails with a "couldn't find a  
> column named ..." for older server versions.  You need to either  
> add ", NULL as colname" to the sql for older versions or not fetch  
> these columns unconditionally.
>

yea.. I see that now.


So in the end, what you are saying is stop being a ninny and  fire up  
more versions of the DBMS and properly test this... sorry about that.  
Do you all have a recommended test setup. (i.e. do you have every  
version up and running?)

Jeff

>>> 1) It's better to send all your changes as one patch instead of  
>>> one per file.  It makes it easier to apply.
>>
>> good to know, would you like me to resend them?
>>
>
> No, that's just a minor inconvenience, not an actual problem.
>
> Kris Jurka




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-02-14 17:47  Kris Jurka <books@ejurka.com>
  parent: Jeffrey Cox <namredips@gmail.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Kris Jurka @ 2007-02-14 17:47 UTC (permalink / raw)
  To: Jeffrey Cox <namredips@gmail.com>; +Cc: pgsql-jdbc



On Wed, 14 Feb 2007, Jeffrey Cox wrote:

> So in the end, what you are saying is stop being a ninny and  fire up more 
> versions of the DBMS and properly test this... sorry about that. Do you all 
> have a recommended test setup. (i.e. do you have every version up and 
> running?)
>

I'm saying, I know how much of a pain this is to test on all versions, so 
if you're not up to it, I'll do it.  I'm just not currently at a machine 
that has all of them installed.  And yes, I do have 7.2 - 8.3dev all 
available (and sometimes even multiple versions of them for things like 
--enable-integer-datetimes) and the regression tests should pass against 
all of them.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-02-14 19:40  Jeffrey Cox <namredips@gmail.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Jeffrey Cox @ 2007-02-14 19:40 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc


On Feb 14, 2007, at 12:47 PM, Kris Jurka wrote:

>
>
> On Wed, 14 Feb 2007, Jeffrey Cox wrote:
>
>> So in the end, what you are saying is stop being a ninny and  fire  
>> up more versions of the DBMS and properly test this... sorry about  
>> that. Do you all have a recommended test setup. (i.e. do you have  
>> every version up and running?)
>>
>
> I'm saying, I know how much of a pain this is to test on all  
> versions, so if you're not up to it, I'll do it.  I'm just not  
> currently at a machine that has all of them installed.  And yes, I  
> do have 7.2 - 8.3dev all available (and sometimes even multiple  
> versions of them for things like --enable-integer-datetimes) and  
> the regression tests should pass against all of them.
>

I know it's a pain, but I will test it... I just need to get the all  
the servers up and running. It might take me some time to get them up  
and going, but shouldn't be to troubling. I was just making light of  
me being sloppy and not fully testing the patches I submitted. I hope  
you didn't take offense... Anyhow, I will send you a new patch soon  
as I test across all version.

Jeff


> Kris Jurka




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-02-28 07:44  Kris Jurka <books@ejurka.com>
  parent: Jeffrey Cox <namredips@gmail.com>
  0 siblings, 2 replies; 21+ messages in thread

From: Kris Jurka @ 2007-02-28 07:44 UTC (permalink / raw)
  To: Jeffrey Cox <namredips@gmail.com>; +Cc: pgsql-jdbc



On Wed, 14 Feb 2007, Jeffrey Cox wrote:

> I know it's a pain, but I will test it... I just need to get the all the 
> servers up and running. It might take me some time to get them up and going, 
> but shouldn't be to troubling.

Here's a patch that I based off of yours.  For 8.1 code we need to look at 
proallargtypes instead of just proargtypes to get the correct output 
types.  I haven't really tested it, but it looks correct.  Any progress on 
setting up test cases for different server versions?

Kris Jurka

Attachments:

getproccol.patch (text/plain, 8.8K) download ? .build.local.properties.swp ? build.local.properties ? getproccol.patch Index: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java,v retrieving revision 1.33 diff -c -r1.33 AbstractJdbc2DatabaseMetaData.java *** org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java 1 Dec 2006 08:53:45 -0000 1.33 --- org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java 28 Feb 2007 07:39:43 -0000 *************** *** 1724,1731 **** String sql; if (connection.haveMinimumServerVersion("7.3")) { ! sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid " + ! " FROM pg_catalog.pg_proc p,pg_catalog.pg_namespace n, pg_catalog.pg_type t " + " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid "; if (schemaPattern != null && !"".equals(schemaPattern)) { --- 1724,1739 ---- String sql; if (connection.haveMinimumServerVersion("7.3")) { ! sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid "; ! ! if (connection.haveMinimumServerVersion("8.1")) ! sql += ", p.proargnames, p.proargmodes, p.proallargtypes "; ! else if (connection.haveMinimumServerVersion("8.0")) ! sql += ", p.proargnames, NULL AS proargmodes, NULL AS proallargtypes "; ! else ! sql += ", NULL AS proargnames, NULL AS proargmodes, NULL AS proallargtypes "; ! ! sql += " FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n, pg_catalog.pg_type t " + " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid "; if (schemaPattern != null && !"".equals(schemaPattern)) { *************** *** 1739,1745 **** } else { ! sql = "SELECT NULL AS nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid " + " FROM pg_proc p,pg_type t " + " WHERE p.prorettype=t.oid "; if (procedureNamePattern != null) --- 1747,1753 ---- } else { ! sql = "SELECT NULL AS nspname,p.proname,p.prorettype,p.proargtypes,t.typtype,t.typrelid, NULL AS proargnames, NULL AS proargmodes, NULL AS proallargtypes " + " FROM pg_proc p,pg_type t " + " WHERE p.prorettype=t.oid "; if (procedureNamePattern != null) *************** *** 1757,1768 **** int returnType = rs.getInt("prorettype"); String returnTypeType = rs.getString("typtype"); int returnTypeRelid = rs.getInt("typrelid"); String strArgTypes = rs.getString("proargtypes"); StringTokenizer st = new StringTokenizer(strArgTypes); Vector argTypes = new Vector(); while (st.hasMoreTokens()) { ! argTypes.addElement(new Integer(st.nextToken())); } // decide if we are returning a single column result. --- 1765,1796 ---- int returnType = rs.getInt("prorettype"); String returnTypeType = rs.getString("typtype"); int returnTypeRelid = rs.getInt("typrelid"); + String strArgTypes = rs.getString("proargtypes"); StringTokenizer st = new StringTokenizer(strArgTypes); Vector argTypes = new Vector(); while (st.hasMoreTokens()) { ! argTypes.addElement(new Long(st.nextToken())); ! } ! ! String argNames[] = null; ! Array argNamesArray = rs.getArray("proargnames"); ! if (argNamesArray != null) ! argNames = (String[])argNamesArray.getArray(); ! ! String argModes[] = null; ! Array argModesArray = rs.getArray("proargmodes"); ! if (argModesArray != null) ! argModes = (String[])argModesArray.getArray(); ! ! int numArgs = argTypes.size(); ! ! long allArgTypes[] = null; ! Array allArgTypesArray = rs.getArray("proallargtypes"); ! if (allArgTypesArray != null) { ! allArgTypes = (long[])allArgTypesArray.getArray(); ! numArgs = allArgTypes.length; } // decide if we are returning a single column result. *************** *** 1786,1807 **** } // Add a row for each argument. ! for (int i = 0; i < argTypes.size(); i++) { - int argOid = ((Integer)argTypes.elementAt(i)).intValue(); byte[][] tuple = new byte[13][]; tuple[0] = null; tuple[1] = schema; tuple[2] = procedureName; ! tuple[3] = connection.encodeString("$" + (i + 1)); ! tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnIn)); tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); tuple[6] = connection.encodeString(connection.getPGType(argOid)); tuple[7] = null; tuple[8] = null; tuple[9] = null; tuple[10] = null; ! tuple[11] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureNullableUnknown)); tuple[12] = null; v.addElement(tuple); } --- 1814,1852 ---- } // Add a row for each argument. ! for (int i = 0; i < numArgs; i++) { byte[][] tuple = new byte[13][]; tuple[0] = null; tuple[1] = schema; tuple[2] = procedureName; ! ! if (argNames != null) ! tuple[3] = connection.encodeString(argNames[i]); ! else ! tuple[3] = connection.encodeString("$" + (i + 1)); ! ! int columnMode = DatabaseMetaData.procedureColumnIn; ! if (argModes != null && argModes[i].equals("o")) ! columnMode = DatabaseMetaData.procedureColumnOut; ! else if (argModes != null && argModes[i].equals("b")) ! columnMode = DatabaseMetaData.procedureColumnInOut; ! ! tuple[4] = connection.encodeString(Integer.toString(columnMode)); ! ! int argOid; ! if (allArgTypes != null) ! argOid = (int)allArgTypes[i]; ! else ! argOid = ((Long)argTypes.elementAt(i)).intValue(); ! tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); tuple[6] = connection.encodeString(connection.getPGType(argOid)); tuple[7] = null; tuple[8] = null; tuple[9] = null; tuple[10] = null; ! tuple[11] = connection.encodeString(Integer.toString(DatabaseMetaData.procedureNullableUnknown)); tuple[12] = null; v.addElement(tuple); } *************** *** 1830,1835 **** --- 1875,1881 ---- tuple[12] = null; v.addElement(tuple); } + columnrs.close(); } } rs.close(); Index: org/postgresql/jdbc2/TypeInfoCache.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/TypeInfoCache.java,v retrieving revision 1.7 diff -c -r1.7 TypeInfoCache.java *** org/postgresql/jdbc2/TypeInfoCache.java 19 Feb 2007 05:57:53 -0000 1.7 --- org/postgresql/jdbc2/TypeInfoCache.java 28 Feb 2007 07:39:43 -0000 *************** *** 57,62 **** --- 57,63 ---- {"numeric", new Integer(Oid.NUMERIC), new Integer(Types.NUMERIC), "java.math.BigDecimal"}, {"float4", new Integer(Oid.FLOAT4), new Integer(Types.REAL), "java.lang.Float"}, {"float8", new Integer(Oid.FLOAT8), new Integer(Types.DOUBLE), "java.lang.Double"}, + {"char", new Integer(Oid.CHAR), new Integer(Types.CHAR), "java.lang.String"}, {"bpchar", new Integer(Oid.BPCHAR), new Integer(Types.CHAR), "java.lang.String"}, {"varchar", new Integer(Oid.VARCHAR), new Integer(Types.VARCHAR), "java.lang.String"}, {"text", new Integer(Oid.TEXT), new Integer(Types.VARCHAR), "java.lang.String"},
^ permalink raw reply [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-07-02 17:29  thomas.risberg <thomas.risberg@tridb.com>
  parent: Kris Jurka <books@ejurka.com>
  1 sibling, 1 reply; 21+ messages in thread

From: thomas.risberg @ 2007-07-02 17:29 UTC (permalink / raw)
  To: pgsql-jdbc


Hi,

Did this patch ever make it into the codebase?  I'm interested in getting
the actual names declared when the function was declared rather than the $x
placeholders.  Currently testing with postgresql-8.2-505.jdbc3.jar and this
change doesn't seem to be in there.

Thanks,
Thomas Risberg



Kris Jurka wrote:
> 
> 
> 
> On Wed, 14 Feb 2007, Jeffrey Cox wrote:
> 
>> I know it's a pain, but I will test it... I just need to get the all the 
>> servers up and running. It might take me some time to get them up and
>> going, 
>> but shouldn't be to troubling.
> 
> Here's a patch that I based off of yours.  For 8.1 code we need to look at 
> proallargtypes instead of just proargtypes to get the correct output 
> types.  I haven't really tested it, but it looks correct.  Any progress on 
> setting up test cases for different server versions?
> 
> Kris Jurka
> ? .build.local.properties.swp
> ? build.local.properties
> ? getproccol.patch
> Index: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java
> ===================================================================
> RCS file:
> /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java,v
> retrieving revision 1.33
> diff -c -r1.33 AbstractJdbc2DatabaseMetaData.java
> *** org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java	1 Dec 2006
> 08:53:45 -0000	1.33
> --- org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java	28 Feb 2007
> 07:39:43 -0000
> ***************
> *** 1724,1731 ****
>           String sql;
>           if (connection.haveMinimumServerVersion("7.3"))
>           {
> !             sql = "SELECT
> n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid " +
> !                   " FROM pg_catalog.pg_proc p,pg_catalog.pg_namespace n,
> pg_catalog.pg_type t " +
>                     " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid ";
>               if (schemaPattern != null && !"".equals(schemaPattern))
>               {
> --- 1724,1739 ----
>           String sql;
>           if (connection.haveMinimumServerVersion("7.3"))
>           {
> !             sql = "SELECT
> n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid ";
> ! 
> !             if (connection.haveMinimumServerVersion("8.1"))
> !                 sql += ", p.proargnames, p.proargmodes, p.proallargtypes 
> ";
> !             else if (connection.haveMinimumServerVersion("8.0"))
> !                 sql += ", p.proargnames, NULL AS proargmodes, NULL AS
> proallargtypes ";
> !             else
> !                 sql += ", NULL AS proargnames, NULL AS proargmodes, NULL
> AS proallargtypes ";
> ! 
> !             sql += " FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace
> n, pg_catalog.pg_type t " +
>                     " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid ";
>               if (schemaPattern != null && !"".equals(schemaPattern))
>               {
> ***************
> *** 1739,1745 ****
>           }
>           else
>           {
> !             sql = "SELECT NULL AS
> nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid " +
>                     " FROM pg_proc p,pg_type t " +
>                     " WHERE p.prorettype=t.oid ";
>               if (procedureNamePattern != null)
> --- 1747,1753 ----
>           }
>           else
>           {
> !             sql = "SELECT NULL AS
> nspname,p.proname,p.prorettype,p.proargtypes,t.typtype,t.typrelid, NULL AS
> proargnames, NULL AS proargmodes, NULL AS proallargtypes " +
>                     " FROM pg_proc p,pg_type t " +
>                     " WHERE p.prorettype=t.oid ";
>               if (procedureNamePattern != null)
> ***************
> *** 1757,1768 ****
>               int returnType = rs.getInt("prorettype");
>               String returnTypeType = rs.getString("typtype");
>               int returnTypeRelid = rs.getInt("typrelid");
>               String strArgTypes = rs.getString("proargtypes");
>               StringTokenizer st = new StringTokenizer(strArgTypes);
>               Vector argTypes = new Vector();
>               while (st.hasMoreTokens())
>               {
> !                 argTypes.addElement(new Integer(st.nextToken()));
>               }
>   
>               // decide if we are returning a single column result.
> --- 1765,1796 ----
>               int returnType = rs.getInt("prorettype");
>               String returnTypeType = rs.getString("typtype");
>               int returnTypeRelid = rs.getInt("typrelid");
> + 
>               String strArgTypes = rs.getString("proargtypes");
>               StringTokenizer st = new StringTokenizer(strArgTypes);
>               Vector argTypes = new Vector();
>               while (st.hasMoreTokens())
>               {
> !                 argTypes.addElement(new Long(st.nextToken()));
> !             }
> ! 
> !             String argNames[] = null;
> !             Array argNamesArray = rs.getArray("proargnames");
> !             if (argNamesArray != null)
> !                 argNames = (String[])argNamesArray.getArray();
> ! 
> !             String argModes[] = null;
> !             Array argModesArray = rs.getArray("proargmodes");
> !             if (argModesArray != null)
> !                 argModes = (String[])argModesArray.getArray();
> ! 
> !             int numArgs = argTypes.size();
> ! 
> !             long allArgTypes[] = null;
> !             Array allArgTypesArray = rs.getArray("proallargtypes");
> !             if (allArgTypesArray != null) {
> !                 allArgTypes = (long[])allArgTypesArray.getArray();
> !                 numArgs = allArgTypes.length;
>               }
>   
>               // decide if we are returning a single column result.
> ***************
> *** 1786,1807 ****
>               }
>   
>               // Add a row for each argument.
> !             for (int i = 0; i < argTypes.size(); i++)
>               {
> -                 int argOid =
> ((Integer)argTypes.elementAt(i)).intValue();
>                   byte[][] tuple = new byte[13][];
>                   tuple[0] = null;
>                   tuple[1] = schema;
>                   tuple[2] = procedureName;
> !                 tuple[3] = connection.encodeString("$" + (i + 1));
> !                 tuple[4] =
> connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnIn));
>                   tuple[5] =
> connection.encodeString(Integer.toString(connection.getSQLType(argOid)));
>                   tuple[6] =
> connection.encodeString(connection.getPGType(argOid));
>                   tuple[7] = null;
>                   tuple[8] = null;
>                   tuple[9] = null;
>                   tuple[10] = null;
> !                 tuple[11] =
> connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureNullableUnknown));
>                   tuple[12] = null;
>                   v.addElement(tuple);
>               }
> --- 1814,1852 ----
>               }
>   
>               // Add a row for each argument.
> !             for (int i = 0; i < numArgs; i++)
>               {
>                   byte[][] tuple = new byte[13][];
>                   tuple[0] = null;
>                   tuple[1] = schema;
>                   tuple[2] = procedureName;
> ! 
> !                 if (argNames != null)
> !                     tuple[3] = connection.encodeString(argNames[i]);
> !                 else
> !                     tuple[3] = connection.encodeString("$" + (i + 1));
> ! 
> !                 int columnMode = DatabaseMetaData.procedureColumnIn;
> !                 if (argModes != null && argModes[i].equals("o"))
> !                     columnMode = DatabaseMetaData.procedureColumnOut;
> !                 else if (argModes != null && argModes[i].equals("b"))
> !                     columnMode = DatabaseMetaData.procedureColumnInOut;
> ! 
> !                 tuple[4] =
> connection.encodeString(Integer.toString(columnMode));
> ! 
> !                 int argOid;
> !                 if (allArgTypes != null)
> !                     argOid = (int)allArgTypes[i];
> !                 else
> !                     argOid = ((Long)argTypes.elementAt(i)).intValue();
> ! 
>                   tuple[5] =
> connection.encodeString(Integer.toString(connection.getSQLType(argOid)));
>                   tuple[6] =
> connection.encodeString(connection.getPGType(argOid));
>                   tuple[7] = null;
>                   tuple[8] = null;
>                   tuple[9] = null;
>                   tuple[10] = null;
> !                 tuple[11] =
> connection.encodeString(Integer.toString(DatabaseMetaData.procedureNullableUnknown));
>                   tuple[12] = null;
>                   v.addElement(tuple);
>               }
> ***************
> *** 1830,1835 ****
> --- 1875,1881 ----
>                       tuple[12] = null;
>                       v.addElement(tuple);
>                   }
> +                 columnrs.close();
>               }
>           }
>           rs.close();
> Index: org/postgresql/jdbc2/TypeInfoCache.java
> ===================================================================
> RCS file:
> /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/TypeInfoCache.java,v
> retrieving revision 1.7
> diff -c -r1.7 TypeInfoCache.java
> *** org/postgresql/jdbc2/TypeInfoCache.java	19 Feb 2007 05:57:53 -0000	1.7
> --- org/postgresql/jdbc2/TypeInfoCache.java	28 Feb 2007 07:39:43 -0000
> ***************
> *** 57,62 ****
> --- 57,63 ----
>           {"numeric", new Integer(Oid.NUMERIC), new
> Integer(Types.NUMERIC), "java.math.BigDecimal"},
>           {"float4", new Integer(Oid.FLOAT4), new Integer(Types.REAL),
> "java.lang.Float"},
>           {"float8", new Integer(Oid.FLOAT8), new Integer(Types.DOUBLE),
> "java.lang.Double"},
> + 	{"char", new Integer(Oid.CHAR), new Integer(Types.CHAR),
> "java.lang.String"},
>           {"bpchar", new Integer(Oid.BPCHAR), new Integer(Types.CHAR),
> "java.lang.String"},
>           {"varchar", new Integer(Oid.VARCHAR), new
> Integer(Types.VARCHAR), "java.lang.String"},
>           {"text", new Integer(Oid.TEXT), new Integer(Types.VARCHAR),
> "java.lang.String"},
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 
> 

-- 
View this message in context: http://www.nabble.com/getProcedureColumns-tf3147414.html#a11398134
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-07-02 17:36  Kris Jurka <books@ejurka.com>
  parent: thomas.risberg <thomas.risberg@tridb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Kris Jurka @ 2007-07-02 17:36 UTC (permalink / raw)
  To: thomas.risberg <thomas.risberg@tridb.com>; +Cc: pgsql-jdbc



On Mon, 2 Jul 2007, thomas.risberg wrote:

> Did this patch ever make it into the codebase?  I'm interested in getting
> the actual names declared when the function was declared rather than the $x
> placeholders.  Currently testing with postgresql-8.2-505.jdbc3.jar and this
> change doesn't seem to be in there.
>

It has not made it into the driver yet because I haven't done the testing 
against all our supported server versions yet.  In any case it will not 
appear in the 8.2 series release because it is a new feature and will 
instead appear in the 8.3 release.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-07-02 18:31  thomas.risberg <thomas.risberg@tridb.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 21+ messages in thread

From: thomas.risberg @ 2007-07-02 18:31 UTC (permalink / raw)
  To: pgsql-jdbc


Thanks Kris.  I'll keep an eye on the 8.3dev drivers.

A related question - I have the following proc declaration:

create function my_proc(in_text in varchar, in_number in numeric, out_result
out varchar, out_text out varchar) RETURNS record

Since there are multiple out parameters it seemed as if I was forced to
declare the return as a record. Is this assumption correct?

Looking at the metadata for this proc I see:
- my_proc 5 1111 record 
- my_proc 1 12 varchar 
- my_proc 1 2 numeric 

but this doesn't seem to be enough tp actually build the call statement and
executing the proc.  Using con.prepareCall("{? = call my_proc(?, ?)}") - I
get org.postgresql.util.PSQLException: A CallableStatement was excecuted
with an invalid number of parameters.

Switching to con.prepareCall("{? = call my_proc(?, ?, ?)}") I can get it to
work but only by registering two  out parameters of Types.VARCHAR.  So it
seems that it is not possible to construct the appropriate call sequence
just based on the metadata when there are multiple out parameters.

Any insights are appreciated.

Thanks,
Thomas Risberg 




Kris Jurka wrote:
> 
> 
> 
> On Mon, 2 Jul 2007, thomas.risberg wrote:
> 
>> Did this patch ever make it into the codebase?  I'm interested in getting
>> the actual names declared when the function was declared rather than the
>> $x
>> placeholders.  Currently testing with postgresql-8.2-505.jdbc3.jar and
>> this
>> change doesn't seem to be in there.
>>
> 
> It has not made it into the driver yet because I haven't done the testing 
> against all our supported server versions yet.  In any case it will not 
> appear in the 8.2 series release because it is a new feature and will 
> instead appear in the 8.3 release.
> 
> Kris Jurka
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
> 
> 

-- 
View this message in context: http://www.nabble.com/getProcedureColumns-tf3147414.html#a11399288
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-07-02 18:52  Kris Jurka <books@ejurka.com>
  parent: thomas.risberg <thomas.risberg@tridb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Kris Jurka @ 2007-07-02 18:52 UTC (permalink / raw)
  To: thomas.risberg <thomas.risberg@tridb.com>; +Cc: pgsql-jdbc



On Mon, 2 Jul 2007, thomas.risberg wrote:

> So it seems that it is not possible to construct the appropriate call 
> sequence just based on the metadata when there are multiple out 
> parameters.
>

Right, the current metadata returned is based on the pg_proc.argtypes 
field which only contains the in and in/out parameters to a function.  A 
new column pg_proc.allargtypes was added in support of out functions and 
the driver was never updated to use it.  So that should be part of the 
fixes that the patch under discussion covers.  If your willing to do some 
testing I've built a driver version with the patch included and put it up 
here:

http://www.ejurka.com/pgsql/jars/tr/

Kris Jurka



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-07-02 19:12  thomas.risberg <thomas.risberg@tridb.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 21+ messages in thread

From: thomas.risberg @ 2007-07-02 19:12 UTC (permalink / raw)
  To: pgsql-jdbc


Kris,

Thanks for the patched driver.  It worked great for my simple test case. 
Any idea when this will be released or in beta?

Thanks,
Thomas Risberg



Kris Jurka wrote:
> 
> 
> 
> On Mon, 2 Jul 2007, thomas.risberg wrote:
> 
>> So it seems that it is not possible to construct the appropriate call 
>> sequence just based on the metadata when there are multiple out 
>> parameters.
>>
> 
> Right, the current metadata returned is based on the pg_proc.argtypes 
> field which only contains the in and in/out parameters to a function.  A 
> new column pg_proc.allargtypes was added in support of out functions and 
> the driver was never updated to use it.  So that should be part of the 
> fixes that the patch under discussion covers.  If your willing to do some 
> testing I've built a driver version with the patch included and put it up 
> here:
> 
> http://www.ejurka.com/pgsql/jars/tr/
> 
> Kris Jurka
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
> 
>                 http://www.postgresql.org/about/donate
> 
> 

-- 
View this message in context: http://www.nabble.com/getProcedureColumns-tf3147414.html#a11399776
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-07-02 19:23  Kris Jurka <books@ejurka.com>
  parent: thomas.risberg <thomas.risberg@tridb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Kris Jurka @ 2007-07-02 19:23 UTC (permalink / raw)
  To: thomas.risberg <thomas.risberg@tridb.com>; +Cc: pgsql-jdbc



On Mon, 2 Jul 2007, thomas.risberg wrote:

> Thanks for the patched driver.  It worked great for my simple test case.
> Any idea when this will be released or in beta?
>

My goal is to integrate it into the 8.3dev series sometime around 
7/10-7/15.  The official release of the 8.3 driver series will coincide 
with the release of the 8.3 server whose release date is a little up in 
the air at the moment.  October?

Kris Jurka



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-07-02 19:33  thomas.risberg <thomas.risberg@tridb.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 21+ messages in thread

From: thomas.risberg @ 2007-07-02 19:33 UTC (permalink / raw)
  To: pgsql-jdbc


Thanks for the dates, looks good to me.  Now an unrelated question -- when
will you include support for Statement.getGeneratedKeys()?  I've seen some
discussions on the list but no recent status for this feature.

Thanks,
Thomas



Kris Jurka wrote:
> 
> 
> 
> On Mon, 2 Jul 2007, thomas.risberg wrote:
> 
>> Thanks for the patched driver.  It worked great for my simple test case.
>> Any idea when this will be released or in beta?
>>
> 
> My goal is to integrate it into the 8.3dev series sometime around 
> 7/10-7/15.  The official release of the 8.3 driver series will coincide 
> with the release of the 8.3 server whose release date is a little up in 
> the air at the moment.  October?
> 
> Kris Jurka
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
> 
> 

-- 
View this message in context: http://www.nabble.com/getProcedureColumns-tf3147414.html#a11400237
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.




^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: getProcedureColumns
@ 2007-07-15 15:35  Kris Jurka <books@ejurka.com>
  parent: Kris Jurka <books@ejurka.com>
  1 sibling, 0 replies; 21+ messages in thread

From: Kris Jurka @ 2007-07-15 15:35 UTC (permalink / raw)
  To: Jeffrey Cox <namredips@gmail.com>; +Cc: pgsql-jdbc; thomas.risberg <thomas.risberg@tridb.com>



On Wed, 28 Feb 2007, Kris Jurka wrote:

> Here's a patch that I based off of yours.  For 8.1 code we need to look at 
> proallargtypes instead of just proargtypes to get the correct output types. 
> I haven't really tested it, but it looks correct.  Any progress on setting up 
> test cases for different server versions?
>

I've committed this to 8.3dev.

Kris Jurka




^ permalink  raw  reply  [nested|flat] 21+ messages in thread


end of thread, other threads:[~2007-07-15 15:35 UTC | newest]

Thread overview: 21+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-01-31 08:29 getProcedureColumns Jeffrey Cox <namredips@gmail.com>
2007-01-31 21:20 ` Kris Jurka <books@ejurka.com>
2007-01-31 23:20   ` Jeffrey Cox <namredips@gmail.com>
2007-01-31 23:49     ` Kris Jurka <books@ejurka.com>
2007-02-01 06:19       ` Jeffrey Cox <namredips@gmail.com>
2007-02-06 09:36       ` Jeffrey Cox <namredips@gmail.com>
2007-02-14 06:37         ` Kris Jurka <books@ejurka.com>
2007-02-14 07:38           ` Jeffrey Cox <namredips@gmail.com>
2007-02-14 15:32             ` Kris Jurka <books@ejurka.com>
2007-02-14 17:31               ` Jeffrey Cox <namredips@gmail.com>
2007-02-14 17:47                 ` Kris Jurka <books@ejurka.com>
2007-02-14 19:40                   ` Jeffrey Cox <namredips@gmail.com>
2007-02-28 07:44                     ` Kris Jurka <books@ejurka.com>
2007-07-02 17:29                       ` thomas.risberg <thomas.risberg@tridb.com>
2007-07-02 17:36                         ` Kris Jurka <books@ejurka.com>
2007-07-02 18:31                           ` thomas.risberg <thomas.risberg@tridb.com>
2007-07-02 18:52                             ` Kris Jurka <books@ejurka.com>
2007-07-02 19:12                               ` thomas.risberg <thomas.risberg@tridb.com>
2007-07-02 19:23                                 ` Kris Jurka <books@ejurka.com>
2007-07-02 19:33                                   ` thomas.risberg <thomas.risberg@tridb.com>
2007-07-15 15:35                       ` Kris Jurka <books@ejurka.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox