Re: Create an empty record - Mailing list pgsql-sql

From Per-Olof Pettersson
Subject Re: Create an empty record
Date
Msg-id 20010519.19321652@mis.configured.host
Whole thread Raw
In response to Create an empty record  (Per-Olof Pettersson <pgsql@peope.net>)
List pgsql-sql
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 <pgsql@peope.net> 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

pgsql-sql by date:

Previous
From: Per-Olof Pettersson
Date:
Subject: Create an empty record
Next
From: Stephan Szabo
Date:
Subject: Re: [GENERAL] Create an empty record