Sunday, January 27. 2013How to bulk export tables from MS AccessPrinter FriendlyComments
Display comments as
(Linear | Threaded)
Might it be easier to use (or write, or fix, as needed) a foreign data wrapper for this?
David,
I haven't tried the ODBC foreign data wrapper on this. That is on the list of ones that no longer works in 9.2 and I've been trying to patch that up. But got side tracked with other things. That said -- for this particular use case, I don't think FDW fits the bill. Two reasons. 1) FDW forces you to predefine the FDW table structure. This I must say is pretty annoying -- and as much as I hate to point at SQL Server and say -- hey they can do this why can't we do something like SELECT * INTO my_local_table FROM fdwserver.my_table. Well that is one piece that needs improvement. 2) We are talking about 30 or 40 tables to export -- who wants all those FDWs dangling around -- unless of course we can do item 1. Which gets me back to item 1 :)
DBI-Link has it, so FDWs very well could. I believe there's something about this in the SQL standard, but haven't looked up just what it is.
The main problem with the DBLink approach is that it still requires you to itemize the columns you are returning back in your alias. So still not as trivial as
SELECT * INTO sometable FROM dblink('.....'); I fear that is a tougher problem to crack though and is a problem with all set returning functions that lack a well defined type.
With utmost respect, DBI-Link, which I wrote back in 2004, has the ability to look at the remote data store and infer DDL from it. It does so crudely, but it does do it. dblink is an entirely different beast, and I probably should have named DBI-Link something more different from it.
David,
Sorry I got confused which one you were talking about. Thanks for the clarification. I haven't used DBI-Link so can't easily compare. I was always under the impression though that the inference was a fundamental issue in PostgreSQL - not dblink or crosstab or anything else I have used that returns an unnamed setof. For example -- I can do dblink('..','SELECT * FROM ..'), but the issue is that it returns an untyped row set. Which results in: column definition list is required for functions returning "record" I have similar issue with crosstab and other extensions that return untyped record sets. I have others complain to me about it too. |
Entry's LinksQuicksearchCalendar
Categories
Blog Administration |
Tracked: Jan 27, 13:47
Tracked: Jan 28, 17:56