Thread: Support for 9.1 foreign tables

Support for 9.1 foreign tables

From
Thomas Kellerer
Date:
Hi,

I just tried out the 9.1 driver (build 900) and noticed that it does not yet return the correct type for foreign
tables.

I have created a foreign table using the wrapper for text files (using the example here:
http://www.depesz.com/index.php/2011/03/14/waiting-for-9-1-foreign-data-wrapper/comment-page-1/#comment-33414),and when
usingDatabaseMetaData.getTables() the returned type for that table is null. I assume that should contain "foreign
table"to be inline with psql's display. 

The same is true for DatabaseMetaData.getTableTypes()

I just wanted to mention it, to make sure that it's not forgotten ;)

Regards
Thomas

Re: Support for 9.1 foreign tables

From
Kris Jurka
Date:

On Sat, 7 May 2011, Thomas Kellerer wrote:

> I just tried out the 9.1 driver (build 900) and noticed that it does not yet
> return the correct type for foreign tables.

I've checked in a fix for this to CVS.

Thanks for the report.

Kris Jurka

Re: Support for 9.1 foreign tables

From
Thomas Kellerer
Date:
Thomas Kellerer wrote on 07.05.2011 13:40:
> Hi,
>
> I just tried out the 9.1 driver (build 900) and noticed that it does
> not yet return the correct type for foreign tables.
>
> I have created a foreign table using the wrapper for text files
> (using the example here:
> http://www.depesz.com/index.php/2011/03/14/waiting-for-9-1-foreign-data-wrapper/comment-page-1/#comment-33414),
> and when using DatabaseMetaData.getTables() the returned type for
> that table is null. I assume that should contain "foreign table" to
> be inline with psql's display.
>
> The same is true for DatabaseMetaData.getTableTypes()
>
> I just wanted to mention it, to make sure that it's not forgotten ;)
>

After a quick look into the sources, this seems simple enough.

I have attached a path to implement these two missing things in case this has not yet been tackled.
(I hope the patch is OK, I haven't really done this before)


Regards
Thomas

Attachment

Re: Support for 9.1 foreign tables

From
"Johann 'Myrkraverk' Oskarsson"
Date:
On Sat, 07 May 2011 12:52:31 -0000, Thomas Kellerer <spam_eater@gmx.net>
wrote:

> After a quick look into the sources, this seems simple enough.

Seems you just have to checkout the repository.

 From a few minutes ago on the commit list:

Log Message:
-----------
Correctly report the table type for FOREIGN TABLEs.

Reported by Thomas Kellerer.

Modified Files:
--------------
     pgjdbc/org/postgresql/jdbc2:
         AbstractJdbc2DatabaseMetaData.java (r1.66 -> r1.67)

(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java?r1=1.66&r2=1.67)


--
   Johann Oskarsson                http://www.2ndquadrant.com/    |[]
   PostgreSQL Development, 24x7 Support, Training and Services  --+--
                                                                  |
   Blog: http://my.opera.com/myrkraverk/blog/