postgresql 7.0.2
HPUX 10.20

configure --without-CXX --prefix=$HOME/pgsql --enable-cassert --enable-debug

create table a ( a integer, b integer );
create table b ( b integer, c integer );
create table c ( c integer, d integer );

-- core dumps
select * from a natural join b natural join c;
-- so does this
select * from a join b using (b) join c using (c);
-- this seems to work
select * from a join b on a.b = b.b join c on b.c = c.c;

back trace from the 'natural join' form shows:
#0  0xfef54 in parseFromClause (pstate=0x401caac8, frmList=0x401ca9e0) at parse_clause.c:505
#1  0xfe248 in makeRangeTable (pstate=0x401caac8, frmList=0x401ca9e0) at parse_clause.c:57
#2  0xf0958 in transformSelectStmt (pstate=0x401caac8, stmt=0x401ca9f8) at analyze.c:1417
#3  0xee208 in $0000001A () at analyze.c:238
#4  0xedbe8 in parse_analyze (pl=0x401caab0, parentParseState=0x0) at analyze.c:75
#5  0xfd9f4 in parser (str=0x40091628 "select * from a natural join b natural join c\n", typev=0x0, 
    nargs=0) at parser.c:64
#6  0x1724a8 in pg_parse_and_rewrite (
    query_string=0x40091628 "select * from a natural join b natural join c\n", typev=0x0, nargs=0, 
    aclOverride=0 '\000') at postgres.c:395
#7  0x172974 in pg_exec_query_dest (
    query_string=0x40091628 "select * from a natural join b natural join c\n", dest=Debug, 
    aclOverride=0 '\000') at postgres.c:580
#8  0x1728fc in pg_exec_query (
    query_string=0x40091628 "select * from a natural join b natural join c\n") at postgres.c:562
#9  0x1742d8 in $00000061 () at postgres.c:1590
#10 0xed150 in main (argc=3, argv=0x7b03ac00) at main.c:103


The debug output shows it doing the first join correctly. It seems
to flake when it is running the attributes of the join to find the
correct attribute for the second join.

-- 

Mark Hollomon
mhh@nortelnetworks.com
ESN 451-9008 (302)454-9008

Mon, 26 Jun 2000 16:22:19 -0400
"Mark Hollomon" <mhh@nortelnetworks.com>
'natural join' core dump
"Mark Hollomon" <mhh@nortelnetworks.com> writes:
> -- core dumps
> select * from a natural join b natural join c;
> -- so does this
> select * from a join b using (b) join c using (c);
> -- this seems to work
> select * from a join b on a.b = b.b join c on b.c = c.c;

This is a previously reported problem that's on Thomas' todo list.

			regards, tom lane

Mon, 26 Jun 2000 18:33:56 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: 'natural join' core dump 
> > -- core dumps
> > select * from a natural join b natural join c;
> > -- so does this
> > select * from a join b using (b) join c using (c);
> This is a previously reported problem that's on Thomas' todo list.

Yup. And I've just recently started getting a bit of time for
development again, so should be able to look at it soon.

                   - Thomas

Tue, 27 Jun 2000 01:58:22 +0000
Thomas Lockhart <lockhart@alumni.caltech.edu>
Re: 'natural join' core dump