Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4JJRUA33446; Sat, 19 May 2001 15:27:30 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f4JJNIF37224; Sat, 19 May 2001 15:23:18 -0400 (EDT) (envelope-from news) From: Per-Olof Pettersson X-Newsgroups: comp.databases.postgresql.general,comp.databases.postgresql.sql Subject: Create an empty record Date: Sat, 19 May 2001 19:24:54 GMT Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 35 Message-ID: <20010519.19245494@mis.configured.host> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Complaints-To: scrappy@hub.org X-Priority: 3 (Normal) X-Newsreader: Mozilla/3.0 (compatible; StarOffice/5.2;Win32) To: pgsql-general@postgresql.org.pgsql-sql@postgresql.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by postgresql.org id f4JJRUA33456 X-Archive-Number: 200105/824 X-Sequence-Number: 9761 Hi How would one goabout creating an empty record (for use in relations). Eg create table product( productid SERIAL NOT NULL, product TEXT, PRIMARY KEY(productid) ); create table product_billable( productid INT4 NOT NULL, billaddress TEXT, PRIMARY KEY (productid), FOREIGN KEY (productid) REFERENES product(productid) ON DELETE CASCADE ); All fields except for the primary key can be NULL. What if I wanted to add a new billable product but I have not got a name for it yet? So how could I insert a new record in product that can be used in product_billable? I have tried INSERT INTO product() VALUES(); but as expected it did not work. All help appreciated Best regards Per-Olof Pettersson