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

Re: Three weeks left until feature freeze

From: Zoltan Boszormenyi <zboszor(at)dunaweb(dot)hu>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>,Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Three weeks left until feature freeze
Date: 2006-07-14 20:30:41
Message-ID: 44B7FEF1.1050606@dunaweb.hu (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

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
> soon.
>
> 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.

Lacks:
- proper sgml documentation
- pg_dump support
- GENERATED ALWAYS doesn't work (yet[*])
- ALTER TABLE support

What works:
- 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. :-)

Best regards,
Zoltán Böszörményi


Attachment: psql-serial-8.diff.gz
Description: application/x-tar (9.8 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2006-07-14 20:37:43
Subject: Re: src/tools/pginclude considered harmful (was Re: [PATCHES]
Previous:From: Tom LaneDate: 2006-07-14 20:24:59
Subject: Re: src/tools/pginclude considered harmful (was Re: [PATCHES]

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