If PostgreSQL failed to compile on your computer or you found a bug that
is likely to be specific to one platform then please fill out this form
and e-mail it to [EMAIL PROTECTED]

To report any other bug, fill out the form below and e-mail it to
[EMAIL PROTECTED]

If you not only found the problem but solved it and generated a patch
then e-mail it to [EMAIL PROTECTED] instead.  Please use the
command "diff -c" to generate the patch.

You may also enter a bug report at http://www.postgresql.org/ instead of
e-mail-ing this form.

============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               :       Bernie Huang
Your email address      :       [EMAIL PROTECTED]


System Configuration
---------------------
  Architecture (example: Intel Pentium)         :       Intel PIII

  Operating System (example: Linux 2.0.26 ELF)  :       RH Linux 6.2

  PostgreSQL version (example: PostgreSQL-6.5.1):       PostgreSQL-7.0

  Compiler used (example:  gcc 2.8.0)           :       Don't know


Please enter a FULL description of your problem:
------------------------------------------------
When you inherit table B from table A, the primary key in A won't be
inherited to B, but only the columns.

I was wondering how do you inherit a primary key or, even, a foreign
key?  If it's not possible, what are the ways going around it?  (not
null index or...???)

Thanks for your help!

- Bernie


Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible: 
----------------------------------------------------------------------
CREATE TABLE parent (
  col1 INT4 PRIMARY KEY,
  col2 text);

CREATE TABLE child (
  col3 text) inherits (parent);

CREATE TABLE foreign_to_child (
  col1 INT4,
  FOREIGN KEY (col1) REFERENCES child
    ON UPDATE CASCADE
    ON DELETE SET NULL);


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
I tried using not null index on the column that's supposed to be the
primary key in the child table, but failed to work.
begin:vcard 
n:Huang;Bernie
tel;fax:(604)664-9195
tel;work:(604)664-9172
x-mozilla-html:TRUE
org:Environment Canada;Standards and Technology Services
adr:;;700-1200 West 73 Ave.;Vancouver;BC;V6P 6H9;Canada
version:2.1
email;internet:[EMAIL PROTECTED]
title:Programmer
x-mozilla-cpt:;0
fn:Bernie Huang
end:vcard

Reply via email to