Juan Romero escribió:

>       SELECT substring(pg_catalog.pg_get_indexdef(i.indexrelid, 0, true)
>               from position('btree (' IN 
> pg_catalog.pg_get_indexdef(i.indexrelid,
> 0, true)) + 7
>                       for position(')' IN 
> pg_catalog.pg_get_indexdef(i.indexrelid, 0, true)) -
>                               (position('btree (' IN 
> pg_catalog.pg_get_indexdef(i.indexrelid, 0,
> true)) + 7))
>       FROM pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_index 
> i
>       WHERE c.oid = TG_RELID AND c.oid = i.indrelid AND i.indexrelid = c2.oid
>       AND i.indisprimary = true INTO pk;

Huh ... ¿puedes por favor repetir en castellano qué se supone que hace
eso de arriba?  Yo creo que hay alguna manera mucho mejor de hacerlo.

> --Quiero hacer algo como lo siguiente, pero evidentemente no se puede
> 
>       INSERT INTO t3 (tabla, t_campo) VALUES (TG_TABLE_NAME, NEW.pk);
>       RETURN NEW;

hmm .. quizás con EXECUTE.

-- 
Alvaro Herrera                 http://www.amazon.com/gp/registry/CTMLCN8V17R4
"Doing what he did amounts to sticking his fingers under the hood of the
implementation; if he gets his fingers burnt, it's his problem."  (Tom Lane)
--
TIP 2: puedes desuscribirte de todas las listas simultáneamente
    (envía "unregister TuDirecciónDeCorreo" a [EMAIL PROTECTED])

Responder a