| From: | Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> |
|---|---|
| To: | Mario Soto Cordones <msotocl(at)gmail(dot)com> |
| Cc: | pgsql-es-ayuda(at)postgresql(dot)org |
| Subject: | Re: Fwd: Problema con ltree |
| Date: | 2005-04-21 21:07:29 |
| Message-ID: | 20050421210729.GG19744@dcc.uchile.cl |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-es-ayuda |
On Thu, Apr 21, 2005 at 11:39:38AM -0400, Mario Soto Cordones wrote:
Hola,
> CREATE OR REPLACE FUNCTION public.find_refpahi (public.ltree,
> public.lquery) RETURNS SETOF public.ty_refpahi AS'
> select set_curcfg(''default'');
> select activo, path, nlevel(path) - nlevel($1) as level,
> (select count(*)-1 from test where path <@ p.path) as hijos from test
> p where path ~ $2 order by path asc
> 'LANGUAGE 'sql' STABLE CALLED ON NULL INPUT SECURITY INVOKER;
La version nueva es mucho mejor para reportar estos errores. Aca me da
ERROR: el tipo de retorno de función declarada para retornar ty_refpahi no concuerda
DETALLE: El SELECT final retorna bigint en lugar de integer en la columna 4.
CONTEXTO: función SQL «find_refpahi»
Si cambio el ultimo argumento del tipo a "int8", funciona.
--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
"Los dioses no protegen a los insensatos. Éstos reciben protección de
otros insensatos mejor dotados" (Luis Wu, Mundo Anillo)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Fernando Aguada | 2005-04-21 22:00:12 | Re: Una Consulta sobre valores por defecto en una tabla |
| Previous Message | Alvaro Herrera | 2005-04-21 20:52:25 | Re: Una Consulta sobre valores por defecto en una tabla |