[BUGS] Possible bug in inheritance/referential integrity -
11-07-2004
, 09:36 PM
--7ZAtKRhVyVSsbBD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
POSTGRESQL BUG REPORT TEMPLATE
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
Your name : Thomas Jacob
Your email address : jacob (AT) internet24 (DOT) de
System Configuration
---------------------
Architecture (example: Intel Pentium) : AMD Duron
Operating System (example: Linux 2.4.18) : Linux 2.6.7
PostgreSQL version (example: PostgreSQL-7.4.6): PostgreSQL-7.4.6
Compiler used (example: gcc 2.95.2) : gcc 3.3.4
Please enter a FULL description of your problem:
------------------------------------------------
Rows inserted into a table "sub" inherited from a table
"super" do not seem to exist in the super-table from the point of
view of the foreign key constraint checker in references to the
"super"-table, even though a SELECT query displays the rows that
were inserted into sub also in super, as should be (See example
provided).
But they should exist, shouldn't they? Or do I simply not
understand PostgreSQL's inheritance model correctly?
Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:=20
----------------------------------------------------------------------
CREATE TABLE super (id INT PRIMARY KEY);
CREATE TABLE super_ref (id INT REFERENCES super);
CREATE TABLE sub () INHERITS(super);
-- this works
INSERT INTO super VALUES(1); INSERT INTO super_ref VALUES(1);
-- clean up
DELETE FROM super_ref; DELETE FROM super;
-- this fails with: ERROR: insert or update on table "super_ref" violates =
foreign key constraint "$1"
INSERT INTO sub VALUES(1); INSERT INTO super_ref VALUES(1);
If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
--7ZAtKRhVyVSsbBD2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQFBi+GHgF9cFv867HwRAskZAKCtD8SQhMJfw+ieFNKk7r CCeiiMFwCggyJo
MfXU0zgnkNigZTKHN5fDO/Y=
=iKQN
-----END PGP SIGNATURE-----
--7ZAtKRhVyVSsbBD2-- |