Skip site navigation (1) Skip section navigation (2)

Should/does SQLForeignKeys work (8.03.02)?

From: "Joost Kraaijeveld" <J(dot)Kraaijeveld(at)Askesis(dot)nl>
To: <pgsql-odbc(at)postgresql(dot)org>
Subject: Should/does SQLForeignKeys work (8.03.02)?
Date: 2008-08-07 07:51:04
Message-ID: 1218095464.13123.247.camel@panoramix.askesis.nl (view raw or flat)
Thread:
Lists: pgsql-odbc
Hi,

I am trying to retrieve the foreign keys of/to a PostgreSQL table
(PostgreSQL ODBC 8.03.02, PostgreSQL 8.3.3, unixodbc 2.2.11) using ODBC.
But whatever I try I do not get any results.

I assume that if I do 

SQLForeignKeys(hstmt,
         NULL, 0,            /* Primary catalog */
         NULL, 0,            /* Primary schema */
         szTable, SQL_NTS,   /* Primary table */
         NULL, 0,            /* Foreign catalog */
         NULL, 0,            /* Foreign schema */
         NULL, 0);           /* Foreign table */

I should get all the foreign keys TO this table FROM another table.

Otherwise, doing

SQLForeignKeys(hstmt,
         NULL, 0,             /* Primary catalog */
         NULL, 0,             /* Primary schema */
         NULL, 0,             /* Primary table */
         NULL, 0,             /* Foreign catalog */
         NULL, 0,             /* Foreign schema */
         szTable, SQL_NTS);   /* Foreign table */

should get me all the foreign keys FROM this table TO another table.

BTW: I have tried it with non-null catalogs and schemas also.

Is that correct, and should it work?

TIA

Joost


Responses

pgsql-odbc by date

Next:From: Adam MDate: 2008-08-08 21:03:14
Subject: Re: resolution for bug 1010313
Previous:From: Hiroshi InoueDate: 2008-08-02 05:50:53
Subject: Re: compiling dlg_specific.c file on Sun Solaris 5.8

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group