Re: Ayuda con inclusión de palabras claves

From: "Werner Echezuria" <wercool(at)gmail(dot)com>
To: alvherre(at)commandprompt(dot)com
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Ayuda con inclusión de palabras claves
Date: 2007-03-07 12:42:34
Message-ID: 2485a25e0703070442k323f1d9sf2c610a82047ee26@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Saludos,

Pues bien el error que me generaba era que no estaban declaradas en ningún
lado las palabras o constantes "FUZZY" y "PREDICATE" :P, luego de incluirlas
en parse.h (dentro de "enum yytokentype{}" y como #define al final del
archivo) si compiló correctamente (aunque no están en orden alfabético, como
es un requerimiento en Keywords.c, espero que aquí no sea un problema).

Ahora bien, creo que mi mayor problema y lo ha sido desde que me di cuenta
es incluir el "CREATE FUZZY PREDICATE <nombre> ON <dominio> AS <conjunto
difuso>" dentro de gram.y.

He leído alguna información sobre Bison, pero me es difícil determinar para
que sirve cada instrucción en por ejemplo "CREATE ROLE".

Creo que para esto si voy a necesitar ayuda.

Gracias.

CreateRoleStmt:
CREATE ROLE RoleId opt_with OptRoleList
{
CreateRoleStmt *n = makeNode(CreateRoleStmt);
n->stmt_type = ROLESTMT_ROLE;
n->role = $3;
n->options = $5;
$$ = (Node *)n;
}
;

opt_with: WITH {}
| /*EMPTY*/ {}
;

/*
* Options for CREATE ROLE and ALTER ROLE (also used by CREATE/ALTER USER
* for backwards compatibility). Note: the only option required by SQL99
* is "WITH ADMIN name".
*/
OptRoleList:
OptRoleList OptRoleElem { $$ = lappend($1,
$2); }
| /* EMPTY */ { $$ = NIL; }
;

OptRoleElem:
PASSWORD Sconst
{
$$ = makeDefElem("password",
(Node *)makeString($2));
}
| PASSWORD NULL_P
{
$$ = makeDefElem("password", NULL);
}
| ENCRYPTED PASSWORD Sconst
{
$$ = makeDefElem("encryptedPassword",
(Node *)makeString($3));
}
| UNENCRYPTED PASSWORD Sconst
{
$$ = makeDefElem("unencryptedPassword",
(Node *)makeString($3));
}
| SUPERUSER_P
{
$$ = makeDefElem("superuser", (Node
*)makeInteger(TRUE));
}
| NOSUPERUSER
{
$$ = makeDefElem("superuser", (Node
*)makeInteger(FALSE));
}
| INHERIT
{
$$ = makeDefElem("inherit", (Node *)makeInteger(TRUE));
}
| NOINHERIT
{
$$ = makeDefElem("inherit", (Node *)makeInteger(FALSE));
}
| CREATEDB
{
$$ = makeDefElem("createdb", (Node *)makeInteger(TRUE));
}
| NOCREATEDB
{
$$ = makeDefElem("createdb", (Node
*)makeInteger(FALSE));
}
| CREATEROLE
{
$$ = makeDefElem("createrole", (Node
*)makeInteger(TRUE));
}
| NOCREATEROLE
{
$$ = makeDefElem("createrole", (Node
*)makeInteger(FALSE));
}
| CREATEUSER
{
/* For backwards compatibility, synonym for SUPERUSER */
$$ = makeDefElem("superuser", (Node
*)makeInteger(TRUE));
}
| NOCREATEUSER
{
$$ = makeDefElem("superuser", (Node
*)makeInteger(FALSE));
}
| LOGIN_P
{
$$ = makeDefElem("canlogin", (Node *)makeInteger(TRUE));
}
| NOLOGIN_P
{
$$ = makeDefElem("canlogin", (Node
*)makeInteger(FALSE));
}
| CONNECTION LIMIT SignedIconst
{
$$ = makeDefElem("connectionlimit", (Node
*)makeInteger($3));
}
| VALID UNTIL Sconst
{
$$ = makeDefElem("validUntil", (Node *)makeString($3));
}
/* Supported but not documented for roles, for use by ALTER
GROUP. */
| USER name_list
{
$$ = makeDefElem("rolemembers", (Node *)$2);
}
/* The following are not supported by ALTER ROLE/USER/GROUP */
| SYSID Iconst
{
$$ = makeDefElem("sysid", (Node *)makeInteger($2));
}
| ADMIN name_list
{
$$ = makeDefElem("adminmembers", (Node *)$2);
}
| ROLE name_list
{
$$ = makeDefElem("rolemembers", (Node *)$2);
}
| IN_P ROLE name_list
{
$$ = makeDefElem("addroleto", (Node *)$3);
}
| IN_P GROUP_P name_list
{
$$ = makeDefElem("addroleto", (Node *)$3);
}
;

El día 6/03/07, Alvaro Herrera <alvherre(at)commandprompt(dot)com> escribió:
>
> Werner Echezuria escribió:
>
> > Creo que lo primero que se debe hacer es incluir las palabras "FUZZY" y
> > "PREDICATE" como palabras claves de PostgreSQL, modifique el archivo
> > Keywords.c, sin embargo al compilar me genera un error.
>
> Que error?
>
> --
> Alvaro Herrera
> http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2007-03-07 13:27:18 Re: Ayuda con inclusión de palabras claves
Previous Message Alvaro Herrera 2007-03-07 01:49:09 Re: Problemas con tablas temporales y tiempo de respuesta...