dbTalk Databases Forums  

List foreign keys

comp.databases.ingres comp.databases.ingres


Discuss List foreign keys in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Lee
 
Posts: n/a

Default Re: List foreign keys - 07-29-2011 , 10:31 AM






On Jul 29, 2:47*pm, Roy Hann <specia... (AT) processed (DOT) almost.meat> wrote:
Quote:
Roy Hann wrote:
Lee wrote:

How can I get a list of a table's foreign keys, in Ingres 9.1?

Rather annoyingly you can't get that information in a convenient form.

In my eagerness to moan about how inconveniently encoded that
information is, I forgot to point out the (possibly obvious) limitation
that you will still only see the foreign keys that have been declared.
There may well be any number of other foreign keys that are not
identified as such; you just have to divine their existence or ask a
savant.

--
Roy

UK Ingres User Association Conference 2012 will be on Tuesday June 19 2012. *
*NOTE THE CHANGED DATE* *Seewww.uk-iua.org.uk
Roy - this is great news, thanks! I had almost given-up hope.

I shall give it a try on Monday.

Cheers
lee

Reply With Quote
  #12  
Old   
Joner Cyrre Worm
 
Posts: n/a

Default Re: List foreign keys - 07-31-2011 , 03:30 PM






On Jul 29, 10:47*am, Roy Hann <specia... (AT) processed (DOT) almost.meat> wrote:
Quote:
Roy Hann wrote:
Lee wrote:

How can I get a list of a table's foreign keys, in Ingres 9.1?

Rather annoyingly you can't get that information in a convenient form.

In my eagerness to moan about how inconveniently encoded that
information is, I forgot to point out the (possibly obvious) limitation
that you will still only see the foreign keys that have been declared.

There may well be any number of other foreign keys that are not
identified as such; ...
Would you mind to elaborate a bit on this, Roy, please...

Quote:
...you just have to divine their existence or ask a
savant.

--
Roy

UK Ingres User Association Conference 2012 will be on Tuesday June 19 2012. *
*NOTE THE CHANGED DATE* *Seewww.uk-iua.org.uk

Reply With Quote
  #13  
Old   
Roy Hann
 
Posts: n/a

Default Re: List foreign keys - 07-31-2011 , 05:33 PM



Joner Cyrre Worm wrote:

Quote:
There may well be any number of other foreign keys that are not
identified as such; ...

Would you mind to elaborate a bit on this, Roy, please...
A foreign key in the conceptual model exists whether it has been
declared as an SQL constraint or not. Programmers and users familiar
with a particular conceptual model (and therefore with its common keys)
will write joins just as well whether the foreign keys are declared or
not.

The query I suggested to identify foreign keys will report only the
foreign keys that have actually been declared. It can't report the
foreign keys that exist but haven't been declared.

As I said, if they're not declared you just have to "know" about them,
by divination or by asking someone else who knows. (Obviously word of
mouth is a very poor way to run a system....)

--
Roy

UK Ingres User Association Conference 2012 will be on Tuesday June 19 2012.
*NOTE THE CHANGED DATE* See www.uk-iua.org.uk

Reply With Quote
  #14  
Old   
DougI
 
Posts: n/a

Default Re: List foreign keys - 07-31-2011 , 09:00 PM



On Jul 29, 7:00*am, Lee <lee... (AT) gmail (DOT) com> wrote:
Quote:
How can I get a list of a table's foreign keys, in Ingres 9.1?

The documentation for 9.1 is no longer on line, and my client
apparently has none, either.

Thanks in anticipation
lee
FWIW, VectorWise introduces a new catalog that records all referential
relationships, 1 per row. The row contains the referenced table ID,
the referencing table ID, the constraint ID and the mapping of foreign
key columns to corresponding primary/unique columns. I expect it'll
soon be available for native Ingres as well (10.0 or later). It is
true that getting the info prior to this is a total PITA.

Doug.

Reply With Quote
  #15  
Old   
Ingres Forums
 
Posts: n/a

Default Re: List foreign keys - 08-01-2011 , 03:30 AM



This looks like something to be solved in the next sprint, does it, Roy?



--
dejan

Reply With Quote
  #16  
Old   
Roy Hann
 
Posts: n/a

Default Re: List foreign keys - 08-01-2011 , 05:14 AM



DougI wrote:

Quote:
On Jul 29, 7:00*am, Lee <lee... (AT) gmail (DOT) com> wrote:

FWIW, VectorWise introduces a new catalog that records all referential
relationships, 1 per row. The row contains the referenced table ID,
the referencing table ID, the constraint ID and the mapping of foreign
key columns to corresponding primary/unique columns. I expect it'll
soon be available for native Ingres as well (10.0 or later).
Ooh, I look forward to that.

Quote:
It is
true that getting the info prior to this is a total PITA.
--
Roy

UK Ingres User Association Conference 2012 will be on Tuesday June 19 2012.
*NOTE THE CHANGED DATE* See www.uk-iua.org.uk

Reply With Quote
  #17  
Old   
Lee
 
Posts: n/a

Default Re: List foreign keys - 08-01-2011 , 09:25 AM



On Jul 29, 2:43*pm, Roy Hann <specia... (AT) processed (DOT) almost.meat> wrote:
Quote:
Roy Hann wrote:
The best you can do AFAIK is:

* select schema_name, table_name, text_segment
* from iiconstraints
* where constraint_type = 'R'
...
*order by schema_name, table_name, constraint_name, text_sequence;
Thanks, Roy - I'll give a try.

Cheers
Lee

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.