Consulta

From: felipe fernandez <ffdezrguez(at)gmail(dot)com>
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Consulta
Date: 2009-06-17 11:19:40
Message-ID: f50088cd0906170419s174f2455rc5373a194b5c0e32@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Estoy migrando un framework php que he desarrollado para mysql a postgresq
pero no logro averiguar como obtener los comentarios que se ponen a un campo
en una tabla. En mysql lo obtengo con "describe table". En postgresql he
conseguido esa informacion con una query que en encontrado en san google
SELECT
a.attname AS Field,
t.typname || '(' || a.atttypmod ||
')' AS Type,
CASE WHEN a.attnotnull='t' THEN
'YES' ELSE 'NO' END as Null,
CASE WHEN r.contype='p' THEN 'PRI'
ELSE '' END as Key,
(SELECT
substring(pg_catalog.pg_get_expr(d.adbin, d.adrelid), '\'(.*)\'')
FROM pg_catalog.pg_attrdef d
WHERE d.adrelid = a.attrelid AND
d.adnum = a.attnum AND a.atthasdef) AS Default,
'' as Extras,
'' as Comment,
'' as Collation,
'' as Privileges
FROM
pg_class c
JOIN pg_attribute a ON a.attrelid =
c.oid
JOIN pg_type t ON a.atttypid = t.oid
LEFT JOIN pg_catalog.pg_constraint r
ON c.oid=r.conrelid
AND r.conname = a.attname
WHERE
c.relname = '".$tabla."'
and a.attnum > 0

Pero no logro encontrar donde rayos están los comentarios.
--
Salu2

Felipe Fernández
"Linux is for people who hate Windows, Debian is for people who love
Linux,".

"Documentation is like sex: when it is good, it is very, very good; and when
it is bad, it is better than nothing."

--
Salu2

Felipe Fernández
"Linux is for people who hate Windows,
Debian is for people who love Linux,".

"Documentation is like sex: when it is good, it is very, very good; and when
it is bad, it is better than nothing."

In response to

  • Consulta at 2009-06-17 05:42:42 from felipe fernandez

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Gabriel Ferro 2009-06-17 11:30:19 Crear una coneccion a Postgres + Punto Net ¿es tan OFTOPIC?
Previous Message Gabriel Ferro 2009-06-17 11:15:19 Re: Re: [pgsql-es-ayuda] acentos y ñ