This doesn't seem right: CREATE VIEW inci AS SELECT date, inci_id, protocol, a.ip_addr, b.ip_addr, spt, dpt FROM (SELECT addr_id, ip_addr FROM addrs) AS a JOIN incident ON incident.source_addr_id = a.addr_id JOIN (SELECT addr_id, ip_addr FROM addrs) AS b ON incident.destination_addr_id = b.addr_id JOIN protocols USING( protocol_id );
Produces: ERROR: column "ip_addr" duplicated Yet the select on it's own works just fine... I've attached the database definition. version ------------------------------------------------------------------------------- -------------------------- PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk) Thanks, Rob -- 12:31:42 up 24 days, 14:10, 6 users, load average: 3.08, 2.63, 2.63 Linux 2.6.5-02 #8 SMP Mon Jul 12 21:34:44 MDT 2004
test.sql
Description: Binary data
pgplqDYerWTQO.pgp
Description: PGP signature