Create an empty record

From: Per-Olof Pettersson <pgsql(at)peope(dot)net>
To: pgsql-general(at)postgresql(dot)org(dot)pgsql-sql(at)postgresql(dot)org
Subject: Create an empty record
Date: 2001-05-19 19:24:54
Message-ID: 20010519.19245494@mis.configured.host
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Per-Olof Pettersson 2001-05-19 19:32:16 Re: Create an empty record
Previous Message Peter Eisentraut 2001-05-19 17:41:12 Re: Inheritance and reference integrity

Browse pgsql-sql by date

  From Date Subject
Next Message Per-Olof Pettersson 2001-05-19 19:32:16 Re: Create an empty record
Previous Message Tom Lane 2001-05-19 14:58:48 Re: HELP: what's wrong with my PL/PSQL function??