Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.236.160]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0F6TjV65655 for ; Tue, 15 Jan 2002 01:29:45 -0500 (EST) (envelope-from roberto@brasileiro.net) Received: from roberto by brasileiro.net with local (Exim 3.33 #1 (Debian)) id 16QN6D-0007EB-00; Mon, 14 Jan 2002 23:29:33 -0700 Date: Mon, 14 Jan 2002 23:29:33 -0700 From: Roberto Mello To: "Paulo J. Matos" Cc: pgsql-sql@postgresql.org Subject: Re: On delete cascade! Message-ID: <20020115062933.GA27415@cc.usu.edu> References: <87zo3gfzdj.fsf@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zo3gfzdj.fsf@localhost.localdomain> User-Agent: Mutt/1.3.25i X-Archive-Number: 200201/160 X-Sequence-Number: 6246 On Mon, Jan 14, 2002 at 08:31:36PM +0000, Paulo J. Matos wrote: > Hi all, > > On weak entities I've used ON DELETE CASCADE as mentioned in > "Databases Management Systems" by Raghu Ramakrishnan. But I get: > psql:tables.sql:43: ERROR: parser: parse error at or near "ON" > > on tables like the following: > > CREATE TABLE socio_ilumindado ( > cognome varchar, > id integer, > nome varchar, > alcunha varchar, > data_filiacao date, > PRIMARY KEY(id), > FOREIGN KEY(id, nome, alcunha, data_filiacao) REFERENCES socio, > ON DELETE CASCADE); Ola Paulo, You need to take a look at the PostgreSQL documentation as well. Just reading your college databases book won't cut it most of the time. PostgreSQL has excellent documentation, especially the reference manual. Take a look at it. So far both of your questions could have been answered by taking a quick glance at the docs. http://www.postgresql.org/idocs/ -Roberto -- +----| http://fslc.usu.edu/ USU Free Software & GNU/Linux Club |------+ Roberto Mello - Computer Science, USU - http://www.brasileiro.net/ http://www.sdl.usu.edu/ - Space Dynamics Lab, Developer Information is the greatest weapon of power to the modern wizard.