From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | Juan Romero <jgromero(at)gmail(dot)com> |
Cc: | Lista Postgres ES <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: parámetro para utilizar con new |
Date: | 2008-10-23 21:02:11 |
Message-ID: | 20081023210211.GK4845@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
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)
From | Date | Subject | |
---|---|---|---|
Next Message | Javier Chávez B. | 2008-10-23 21:36:02 | Re: PGDay Rio de La Plata |
Previous Message | Jaime Casanova | 2008-10-23 20:57:29 | Re: parámetro para utilizar con new |