From: | "Jaime Casanova" <systemguards(at)gmail(dot)com> |
---|---|
To: | postgres <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Fwd: Newbie en PGSQL pregunta sobre COMMENTS ON |
Date: | 2006-06-15 06:03:24 |
Message-ID: | c2d9e70e0606142303m238949dcv99d4ca136197003b@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Sorry, no lo envie a la lista... mi excusa es la hora, tengo sueño...
---------- Forwarded message ----------
From: Jaime Casanova <systemguards(at)gmail(dot)com>
Date: Jun 15, 2006 1:02 AM
Subject: Re: [pgsql-es-ayuda] Newbie en PGSQL pregunta sobre COMMENTS ON
To: jtempo <jtempo(at)argentina(dot)com>
On 6/14/06, jtempo <jtempo(at)argentina(dot)com> wrote:
> hola, te agradezco tu respuesta, pero no me devuelve nada. pidiendo todo
> de la tabla pg_description me devuelve que el campo objoid es un numero.
> En realidad lo que quiero es obtener el nombre de campo y el comment que
> tenga este campo para generar un form dinamico.
>
Aqui te paso, un select mas completo que te muestra como obtener las
tablas y otras cosas asi como los comentarios creados sobre ellos...
SELECT n.nspname as "Schema", c.relname as "Nombre",
CASE c.relkind WHEN 'r' THEN 'tabla'
WHEN 'v' THEN 'vista'
WHEN 'i' THEN 'índice'
WHEN 'S' THEN 'secuencia'
WHEN 's' THEN 'especial'
END as "Tipo",
r.rolname as "Dueño", (select description from pg_description
where objoid = c.relname::text::regclass) as comment
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_roles r ON r.oid = c.relowner
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('r','v','S','')
AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
AND pg_catalog.pg_table_is_visible(c.oid)
ORDER BY 1,2;
--
Atentamente,
Jaime Casanova
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook
--
Atentamente,
Jaime Casanova
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook
From | Date | Subject | |
---|---|---|---|
Next Message | Blanca | 2006-06-15 08:31:45 | modelado de datos |
Previous Message | Leonardo Jiménez Quijano | 2006-06-15 04:54:26 | Compilando pgAdmin III |