diff --git a/src/test/regress/expected/inherit.out b/src/test/regress/expected/inherit.out
index 6e8e9ca18d9f8926fc96bcfe0540a7d797b591d4..9517c36baaf5e567307963431cc8737fd1382637 100644
--- a/src/test/regress/expected/inherit.out
+++ b/src/test/regress/expected/inherit.out
@@ -623,3 +623,31 @@ select * from d;
  32 | one | two | three
 (1 row)
 
+-- Tests for casting between the rowtypes of parent and child
+-- tables. See the pgsql-hackers thread beginning Dec. 4/04
+create table base (i integer);
+create table derived () inherits (base);
+insert into derived (i) values (0);
+select derived::base from derived;
+ derived 
+---------
+ (0)
+(1 row)
+
+drop table derived;
+drop table base;
+create table p1(ff1 int);
+create table p2(f1 text);
+create function p2text(p2) returns text as 'select $1.f1' language sql;
+create table c1(f3 int) inherits(p1,p2);
+insert into c1 values(123456789, 'hi', 42);
+select p2text(c1.*) from c1;
+ p2text 
+--------
+ hi
+(1 row)
+
+drop function p2text(p2);
+drop table c1;
+drop table p2;
+drop table p1;
diff --git a/src/test/regress/sql/inherit.sql b/src/test/regress/sql/inherit.sql
index 2329175796317a785377e72d74ad54e68d735708..daeabb2c9615b14f223de60820832b94c0e7a72a 100644
--- a/src/test/regress/sql/inherit.sql
+++ b/src/test/regress/sql/inherit.sql
@@ -146,7 +146,25 @@ SELECT * FROM inhf; /* Single entry with value 'text' */
 
 -- Test changing the type of inherited columns
 insert into d values('test','one','two','three');
-
 alter table a alter column aa type integer using bit_length(aa);
-
 select * from d;
+
+-- Tests for casting between the rowtypes of parent and child
+-- tables. See the pgsql-hackers thread beginning Dec. 4/04
+create table base (i integer);
+create table derived () inherits (base);
+insert into derived (i) values (0);
+select derived::base from derived;
+drop table derived;
+drop table base;
+
+create table p1(ff1 int);
+create table p2(f1 text);
+create function p2text(p2) returns text as 'select $1.f1' language sql;
+create table c1(f3 int) inherits(p1,p2);
+insert into c1 values(123456789, 'hi', 42);
+select p2text(c1.*) from c1;
+drop function p2text(p2);
+drop table c1;
+drop table p2;
+drop table p1;