Thread

  1. inheritance question 2/ref integrity

    alex@pilosoft.com — 2000-10-07T23:55:06Z

    Can I do  following?
    
    create table foo (
    x int4 references bar*
    )
    
    Or, since 7.1 will have bar* as default for bar, will using 'references
    bar' do what I want?
    
    -alex
    
    
    
  2. Re: inheritance question 2/ref integrity

    Stephan Szabo <sszabo@megazone23.bigpanda.com> — 2000-10-08T00:43:20Z

    On Sat, 7 Oct 2000, Alex Pilosov wrote:
    
    > Can I do  following?
    > 
    > create table foo (
    > x int4 references bar*
    > )
    > 
    > Or, since 7.1 will have bar* as default for bar, will using 'references
    > bar' do what I want?
    
    No, and not really.  Parts of it may sort of work, but referential
    actions will definately fail (this includes the default no action)
    because I don't believe triggers inherit in an automatic fashion.
    
    Also, at least under 7.0 and earlier, constraints don't inherit and
    they would have to for the above to be meaningful (the values in bar*'s
    primary key have to be unique through all of the inheritance tree or
    most of the references stuff simply doesn't work right).
    
    
    
  3. Re: inheritance question 2/ref integrity

    Chris Bitmead <chris@bitmead.com> — 2000-10-08T10:56:40Z

    The referential integrity doesn't work properly with inheritance I
    think. It would be nice if it was fixed to work with inheritance but
    that would probably also need inheritable indexes to work (?? I don't
    know how much ref integrity relies on having an index in place).
    
    Alex Pilosov wrote:
    > 
    > Can I do  following?
    > 
    > create table foo (
    > x int4 references bar*
    > )
    > 
    > Or, since 7.1 will have bar* as default for bar, will using 'references
    > bar' do what I want?
    > 
    > -alex
    
    -- 
    Chris Bitmead
    mailto:chris@bitmead.com
    http://www.techphoto.org - Photography News, Stuff that Matters