Re: Referencia cruzada

From: Dan <danstreet(at)gmail(dot)com>
To: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Referencia cruzada
Date: 2010-05-21 05:27:38
Message-ID: AANLkTilDF70jfibjZ28wRUwp3Pusj9zj5jW4kH0XA9PP@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola Jaime, busque acerca de crosstab y encontre la sgt pagina:
http://www.postgresonline.com/journal/index.php?/archives/14-guid.html

<http://www.postgresonline.com/journal/index.php?/archives/14-guid.html>el
paso que indica: path\to\postgresql\bin\psql -h localhost -U someuser -d
somedb -f "path\to\postgresql\share\contrib\tablefunc.sql"
en el postgresql 8.3 funciono perfecto, pero en el 8.2.4 me sale el sgt
mensaje:

*HINT: No function matches the given name and argument types. You may need
to add explicit type casts.*
*-- recursion detection*
*INSERT INTO connectby_int VALUES(10,9);*
*INSERT 0 1*
*INSERT INTO connectby_int VALUES(11,10);*
*INSERT 0 1*
*INSERT INTO connectby_int VALUES(9,11);*
*INSERT 0 1*
*-- should fail due to infinite recursion*
*SELECT * FROM connectby('connectby_int', 'keyid', 'parent_keyid', '2', 0,
'~') AS t(keyid int, parent_keyid int, level int, branch text);*
*psql:/usr/src/postgresql-8.2.4/contrib/tablefunc/sql/tablefunc.sql:178:
ERROR: function connectby("unknown", "unknown", "unknown", "unknown",
integer, "unknown") does not exist*
*LINE 1: SELECT * FROM connectby('connectby_int', 'keyid', 'parent_ke...*
* ^*
*HINT: No function matches the given name and argument types. You may need
to add explicit type casts.*
*-- infinite recursion failure avoided by depth limit*
*SELECT * FROM connectby('connectby_int', 'keyid', 'parent_keyid', '2', 4,
'~') AS t(keyid int, parent_keyid int, level int, branch text);*
*psql:/usr/src/postgresql-8.2.4/contrib/tablefunc/sql/tablefunc.sql:181:
ERROR: function connectby("unknown", "unknown", "unknown", "unknown",
integer, "unknown") does not exist*
*LINE 1: SELECT * FROM connectby('connectby_int', 'keyid', 'parent_ke...*
* ^*
*HINT: No function matches the given name and argument types. You may need
to add explicit type casts.*
*-- test for falsely detected recursion*
*DROP TABLE connectby_int;*
*DROP TABLE*
*CREATE TABLE connectby_int(keyid int, parent_keyid int);*
*CREATE TABLE*
*INSERT INTO connectby_int VALUES(11,NULL);*
*INSERT 0 1*
*INSERT INTO connectby_int VALUES(10,11);*
*INSERT 0 1*
*INSERT INTO connectby_int VALUES(111,11);*
*INSERT 0 1*
*INSERT INTO connectby_int VALUES(1,111);*
*INSERT 0 1*
*-- this should not fail due to recursion detection*
*SELECT * FROM connectby('connectby_int', 'keyid', 'parent_keyid', '11', 0,
'-') AS t(keyid int, parent_keyid int, level int, branch text);*
*psql:/usr/src/postgresql-8.2.4/contrib/tablefunc/sql/tablefunc.sql:191:
ERROR: function connectby("unknown", "unknown", "unknown", "unknown",
integer, "unknown") does not exist*
*LINE 1: SELECT * FROM connectby('connectby_int', 'keyid', 'parent_ke...*
* ^*
*HINT: No function matches the given name and argument types. You may need
to add explicit type casts.*

2010/5/20 Jaime Casanova <jaime(at)2ndquadrant(dot)com>

> 2010/5/20 Dan <danstreet(at)gmail(dot)com>:
> >
> > dias 19/05/2010 20/05/2010
> > -------------------------------------------------------------------
> > 1 | Juan Perez | 08:00-16:00 | 08:02-16:45
> > 2 | Luis Rodriguez | 08:05-16:30 | 08:05-18:00
> > 3 | Damian Diaz | 08:06-16:00 | 08:00-17:00
> >
> >
>
> para hacerlo tal como esta en tu ejemplo necesitaras usar crosstab
>
> --
> Jaime Casanova www.2ndQuadrant.com
> Soporte y capacitación de PostgreSQL
>

--
-----------------
[) /-\ |\|

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Ernesto Herrera 2010-05-21 09:37:05 trabajo con cadenas
Previous Message Jaime Casanova 2010-05-21 02:09:54 Re: Referencia cruzada