Skip site navigation (1) Skip section navigation (2)

Re: [SQL] empty data

From: Stuart Rison <stuart(at)ludwig(dot)ucl(dot)ac(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Cc: serbr(at)tin(dot)it
Subject: Re: [SQL] empty data
Date: 1998-07-13 16:30:16
Message-ID: l03110703b1cfe57701a2@[128.40.242.190] (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-sql
>> serbr=> CREATE TABLE foo (mtdata date);
>> CREATE
>> serbr=> \dt
>>
>> Database    = serbr
>>  +------------------+----------------------------------+----------+
>>  |  Owner           |             Relation             |   Type   |
>>  +------------------+----------------------------------+----------+
>>  | serbr            | foo                              | table    |
>>  +------------------+----------------------------------+----------+
>> serbr=> INSERT INTO foo VALUES ('');
>> ERROR:  Bad date external representation
>> serbr=> INSERT INTO foo VALUES ('//');
>> ERROR:  Bad date external representation
>
> My problem arise in a more general context, where the date may not
> be available at the time of data insert/update, and the data must
> be empty.
>
> What can I do? (I would not like to define a my own date-type...)

Try insert into foo values (NULL);

Naturally, this is silly in the example you give since you are putting a
NULL in a single field table and therefore you might as well not put a
value in.

Hope this helps.

Stuart.


+-------------------------+--------------------------------------+
| Stuart Rison            | Ludwig Institute for Cancer Research |
+-------------------------+ University College London            |
| Tel. (0171) 878 4041    | 91 Riding House Street               |
| Fax. (0171) 878 4040    | London, W1P 8BT, UNITED KINGDOM.     |
+-------------------------+--------------------------------------+
| stuart(at)NOJUNK_ludwig(dot)ucl(dot)ac(dot)uk [Remove NOJUNK_ for it to work] |
+----------------------------------------------------------------+



pgsql-sql by date

Next:From: Guido PiazziDate: 1998-07-13 17:26:09
Subject: Re: [SQL] empty data
Previous:From: Sergio BrandanoDate: 1998-07-13 10:51:04
Subject: [SQL] empty data

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group