Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4JJvUA41074; Sat, 19 May 2001 15:57:30 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f4JJUd137320; Sat, 19 May 2001 15:30:39 -0400 (EDT) (envelope-from news) From: Per-Olof Pettersson X-Newsgroups: comp.databases.postgresql.general,comp.databases.postgresql.sql Subject: Re: Create an empty record Date: Sat, 19 May 2001 19:32:16 GMT Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 57 Message-ID: <20010519.19321652@mis.configured.host> References: <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 f4JJvUA41084 X-Archive-Number: 200105/826 X-Sequence-Number: 9763 Oh I forgot Naturally it works with setting eg procuct in this case to null but it does not seem very clean. INSERT INTO product(product) VALUES(null); Does anybody have a clean way to do this? Best regards Per-Olof Pettersson >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 2001-05-19, 21:24:54, Per-Olof Pettersson wrote regarding Create an empty record: > 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