Bruce Momjian írta:
> There are roughly three weeks left until the feature freeze on August 1.
> If people are working on items, they should be announced before August
> 1, and the patches submitted by August 1. If the patch is large, it
> should be discussed now and an intermediate patch posted to the lists
> FYI, we don't have many major features ready for 8.2.
> Bruce Momjian bruce(at)momjian(dot)us
> EnterpriseDB http://www.enterprisedb.com
I am working on adding a new column contraint,
namely the GENERATED [ALWAYS | BY DEFAULT ] AS
[ IDENTITY ( sequence_options ) | ( expression )]
I surely won't be ready by August 1 as I am going
on a holiday this weekend for two weeks.
Anyway, I submit what I have in my hands now and
describe what it does and what lacks. Maybe someone
can fill the missing gaps, I didn't have too much time
to dig deeper in the PostgreSQL code.
- proper sgml documentation
- pg_dump support
- GENERATED ALWAYS doesn't work (yet[*])
- ALTER TABLE support
- GENERATED ... AS IDENTITY creates the sequence
with the given parameters
- any data types that has an implicit cast from int8 can be
defined as GENERATED ... AS IDENTITY
DEFAULT and GENERATED are mutually exclusive
and I tweaked gram.y to make it so and GENERATED ...
is now parsed as a column constraint.
Unfortunately I introduced one shift/reduce conflict and
I don't see a way to solve it.
SQL2003 says that only one IDENTITY column may
exist in a table, I didn't make a check for that, it may be
useful to allow more than one.
Also, the parsing is very simplistic, it allows
GENERATED BY DEFAULT AS ( expr )
and I made it to behave exactly like DEFAULT.
It can be eliminated in the parser, though.
Tom Lane was unhappy with my previous attempt
as it introduced SERIAL, SERIAL4, SERIAL8 and
BIGSERIAL as keywords. This time I kept it the way
PostgreSQL always had.
[*] I introduced a new column attribute (attforceddef)
and it could be used in rewriteHandler.c to override
given data with the default for GENERATED ALWAYS
column. I must have missed some places where I have to
assign ColumnDef->force_default to
FormData_pg_attribute->attforceddef or vice-versa
but I am certain that not too many left.
Needless to say it passes "make check".
Please, review and point out my mistakes again. :-)
In response to
pgsql-hackers by date
|Next:||From: Andrew Dunstan||Date: 2006-07-14 20:37:43|
|Subject: Re: src/tools/pginclude considered harmful (was Re: [PATCHES]|
|Previous:||From: Tom Lane||Date: 2006-07-14 20:24:59|
|Subject: Re: src/tools/pginclude considered harmful (was Re: [PATCHES] |