Para esta funciona:
CREATE TABLE categoria
(
id serial NOT NULL,
nombre char(50),
descripcion char(200),
CONSTRAINT categoria_pkey PRIMARY KEY (id)
)
WITH OIDS;
ALTER TABLE categoria OWNER TO postgres;
SELECT a.attname FROM pg_attribute a, pg_class b WHERE a.attrelid=b.relfilenode and a.attnum > 0 and b.relname='categoria';
Resultado:
attname
---------
id
nombre
descripcion
(3 filas)
Pero esta No funcionó:
SELECT a.attname FROM pg_attribute a, pg_class b WHERE a.attrelid=b.relfilenode and a.attnum > 0 and b.relname='material';
Resultado:
attname
---------
(0 filas)
CREATE TABLE material
(
id serial NOT NULL,
autor serial NOT NULL,
titulo char(50),
palabra_clave char(30),
descripcion char(200),
fecha_creacion date,
version date,
tipo char(10),
idioma char(10),
formato char(10),
tamano float8,
localizacion char(50),
actividad serial,
CONSTRAINT material_pkey PRIMARY KEY (id),
CONSTRAINT actividad FOREIGN KEY (actividad) REFERENCES actividad (id) ON UPDATE RESTRICT ON DELETE RESTRICT,
CONSTRAINT material_autor_fkey FOREIGN KEY (autor) REFERENCES autor (id) ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH OIDS;
ALTER TABLE material OWNER TO postgres;
Lina Marcela Velásquez Hernández