From: Per-Olof Pettersson <pgsql@peope.net>
To: pgsql-general@postgresql.org.pgsql-sql
Subject: Create an empty record
Date: Sat, 19 May 2001 19:24:54 GMT
Message-ID: <20010519.19245494@mis.configured.host> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: pgsql@peope.net, pgsql-general@postgresql.org.pgsql-sql
Subject: Re: Create an empty record
In-Reply-To: <20010519.19245494@mis.configured.host>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox