Re: [Pgsql-ayuda] Longitud de campos string

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Edwin Quijada <listas_quijada(at)hotmail(dot)com>
Cc: Pgsql <pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx>
Subject: Re: [Pgsql-ayuda] Longitud de campos string
Date: 2003-09-02 17:34:33
Message-ID: 20030902173433.GG21909@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

On Wed, Sep 03, 2003 at 01:01:22AM -0400, Edwin Quijada wrote:
> Es a char , varchar y bpchar.
> Lo que deseo es saber cual es la longitd del campo para luego truncarlo en
> caso de ser necesario mediante un trigger.

Lee el campo attypmod de la tabla pg_attribute y restale 4.

> A que te refieres con usar TEXT exactamente??

CREATE TABLE blah (
uno TEXT,
...
);

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The first of April is the day we remember what we are
the other 364 days of the year" (Mark Twain)

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2003-09-02 17:43:27 Re: [Pgsql-ayuda] ayuda :)
Previous Message Alvaro Herrera 2003-09-02 16:57:19 Re: [Pgsql-ayuda] Longitud de campos string