Re: Table name lengths...

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Chris Bowlby <excalibur(at)hub(dot)org>
Cc: Richard Huxton <dev(at)archonet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Table name lengths...
Date: 2003-09-02 17:46:15
Message-ID: 20030902174615.GJ21909@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 02, 2003 at 02:33:00PM -0300, Chris Bowlby wrote:
> On Tue, 2003-09-02 at 14:24, Richard Huxton wrote:
>
> I'm working with an application that needs to be able to determine this
> depending on the version of PostgreSQL that is running. I know what
> anything less then 7.3 was 32 characters and anything newer is currently
> 64, but I'm hoping to be able to check the lengths from my application
> before creating a table/sequence/index, etc..

Cast a long string to the name type and measure its length:

test=> SELECT length(repeat('xyzzy', 100)::name);
length
--------
63
(1 row)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Voy a acabar con todos los humanos / con los humanos yo acabaré
voy a acabar con todos / con todos los humanos acabaré (Bender)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-09-02 17:47:20 Re: Table name lengths...
Previous Message Greg Stark 2003-09-02 17:46:13 Re: Any way to Convince postgres to push join clause inside subquery aggregate?