Re: leyendo las estructuras del postgresql

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Ernesto Quiñones <ernestoq(at)gmail(dot)com>
Cc: postgres-pe(at)googlegroups(dot)com, Lista PostgreSQL <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: leyendo las estructuras del postgresql
Date: 2007-07-15 23:44:55
Message-ID: 20070715234454.GB5332@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Ernesto Quiñones escribió:
> A lo mejor a alguien le sirve este pequeño script que escribí
>
> http://eqsoft.net/blog/index.php?/archives/194-Desenmaranando-las-estructuras-en-PostgreSQL.html

Esta interesante ...

Con respecto a los numeric, la forma de sacar el (12,2) es

scale = attypmod << 16,
weight = atttypmod - scale - 4

o sea

select
attname,
atttypmod >> 16,
atttypmod - ((atttypmod >> 16) << 16) - 4
from pg_attribute
where attrelid = 'num'::regclass;

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Gabriel Hermes Colina Zambra 2007-07-16 00:48:16 Re: Convertir un Numero Entero en una Fecha
Previous Message Alvaro Herrera 2007-07-15 23:18:24 Re: Convertir un Numero Entero en una Fecha