Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

241
Vistas
Adding standard metadata to a table - Postgresql

I worked with the ESRI geodb where you can insert (into the "property" of a table) some metadata (also compliant to some International standard), like creation date, organization, source, copyright info etc.

Is there something similar in Postgres, for metadata of a table as a whole? I know only COMMENT but it seems too poor for my purposes.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Here is a very naive example of how you can save your wanted "metadata"

lest assume you have two tables you want to have data about:

t=# create table so66(i int, t text);
CREATE TABLE
Time: 5.431 ms
t=# create table so67(i int, t text);
CREATE TABLE
Time: 4.797 ms

and a "metadata" holder table:

t=# create table metadata(tname text, created timestamptz, details json);
CREATE TABLE
Time: 6.814 ms
t=# insert into metadata select 'so66',now(),'{"organization":"n/a","source":"manual","catalog":false}';
INSERT 0 1
Time: 3.144 ms
t=# insert into metadata select 'so76',now(),'{"organization":"home","source":"manual","catalog":true}';
INSERT 0 1
Time: 0.907 ms

t=# select * from metadata ;
 tname |            created            |                         details
-------+-------------------------------+----------------------------------------------------------
 so66  | 2017-04-21 09:24:08.233346+00 | {"organization":"n/a","source":"manual","catalog":false}
 so76  | 2017-04-21 09:24:26.641526+00 | {"organization":"home","source":"manual","catalog":true}
(2 rows)

Time: 0.253 ms

I used json to save arbitrary details. Of course you can add columns with special data types for your needs. Also you might want to use oids instead of table names or do some logic on insert/update of it.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda