Re: Problemas with gram.y

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: tmorelli(at)tmorelli(dot)com(dot)br
Cc: pgsql-hackers(at)postgresql(dot)org, etmorelli(at)superig(dot)com(dot)br
Subject: Re: Problemas with gram.y
Date: 2006-03-03 21:27:23
Message-ID: 4408B4BB.1050102@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

tmorelli(at)tmorelli(dot)com(dot)br wrote:

>Hi,
>
>I'm trying to extend the CREATE INDEX statement with a fillfactor clause. In
>Gram.y, I did this:
>
>IndexStmt: CREATE index_opt_unique INDEX index_name ON qualified_name
>access_method_clause '(' index_params ')' fillfactor_clause where_clause
> {
> IndexStmt *n = makeNode(IndexStmt);
> n->unique = $2;
> n->idxname = $4;
> n->relation = $6;
> n->accessMethod = $7;
> n->indexParams = $9;
> n->fillfactor = $11;
> n->whereClause = $12;
> $$ = (Node *)n;
> }
>
>And the clause:
>
>fillfactor_clause:
>FILLFACTOR IntegerOnly { $$ = makeInteger($2); }
> { $$ = 0; };
>
>I had to add a new field into IndexStmt (unsigned int fillfactor). Everything
>is fine after parsing except that I can't see the integer value. For example,
>in transformIndexStmt (analyze.c), I've inspected stmt->fillfactor and I've got
> a strange, obviously wrong, value (137616352) after issuing this statement:
>
>create index ix_desc on products(description) fillfactor 7;
>
>Is thre any statement with numeric clauses? The only one that I found was
>Alter/Create Sequence, but there is an ugly list there.
>
>Could anyone help me, please?
>
>Thanks a lot!
>
>
>
>

did you change nodes/copyfuncs.c and nodes/equalfuncs.c as you have to
do when you add new node fields?

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-03-03 21:32:59 Re: Problemas with gram.y
Previous Message tmorelli 2006-03-03 21:14:45 Problemas with gram.y