David Fetter wrote:
> DBI's DBD::Excel <http://search.cpan.org/~kwitknr/DBD-Excel-0.06/Excel.pm>
> is a more extreme example of this kind of thing.  You can get connect
> strings that look like this:
> 
> my $hDb = DBI->connect(
>     "DBI:Excel:file=dbdtest.xls",
>     undef,
>     undef,
>     {
>         xl_vtbl => {
>             TESTV => {
>                 sheetName => 'TEST_V',
>                 ttlRow => 5,
>                 startCol => 1,
>                 colCnt => 4,
>                 datRow => 6,
>                 datlmt => 4,
>             }
>         }
>     }
> );
> 
> That last bit with the hash of hashes of hashes is probably where we'd
> use CTEs to expand things out.

Or we could just leave the attribute dict as it is and use something like:

CREATE SERVER dbdtest FOREIGN DATA WRAPPER dbi
    OPTIONS (
        datasource 'DBI:Excel:file=dbdtest.xls',
        attributes '{xl_vtbl => {TESTV => { ... } }}'
    );

CREATE USER MAPPING FOR bob SERVER dbdtest
    OPTIONS (username NULL, password NULL);

The connection lookup for "dbtest" (user bob) would return:

key         value
----------- ------------------------------------------------------------
datasource  DBI:Excel:file=dbdtest.xls
attributes  {xl_vtbl => {TESTV => { ... } }}
username    NULL
password    NULL

Regards,
Martin


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to