default values

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Vadim Mikheev <vadim(at)krs(dot)ru>
Cc: Postgres Hackers List <hackers(at)postgresql(dot)org>, Jose Soares Da Silva <sferac(at)bo(dot)nettuno(dot)it>
Subject: default values
Date: 1998-09-02 15:15:25
Message-ID: 35ED610D.CEC3ED9A@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In transcribing Jose's reference page docs, I've come across examples
where Jose has exposed deficiencies in Postgres' support of SQL92. I've
fixed several (easier than transcribing more words :) and I've run into
a bit of trouble on the latest one with the

CREATE TABLE tablename DEFAULT VALUES

statement. I changed the parser to allow this syntax and just use a nil
pointer for the column list. Everything works OK except that the first
column's default value is not assigned correctly.

Any ideas on where to look? I'll probably commit the changes to gram.y
anyway, since it almost works. Examples below...

- Tom

postgres=> create table t (x text default 'default',
postgres-> i int default 1);
CREATE
postgres=> insert into t default values;
INSERT 143693 1
postgres=> select * from t;
x|i
-+-
|1
(1 row)

postgres=> insert into t (i) values (2);
INSERT 143694 1
postgres=> select * from t;
x |i
-------+-
|1
default|2
(2 rows)

postgres=> create table t3 (x text default 'default',
postgres-> i int default 1, j int default 2);
CREATE
postgres=> insert into t3 default values;
INSERT 143709 1
postgres=> select * from t3;
x|i|j
-+-+-
|1|2
(1 row)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-09-02 15:36:36 Re: [HACKERS] default values
Previous Message Bruce Momjian 1998-09-02 14:58:11 Re: [HACKERS] Core dump in regression tests.