Re: Table name lengths... - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Table name lengths...
Date
Msg-id 20030902174615.GJ21909@dcc.uchile.cl
Whole thread Raw
In response to Re: Table name lengths...  (Chris Bowlby <excalibur@hub.org>)
Responses Re: Table name lengths...  (Chris Bowlby <excalibur@hub.org>)
List 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)

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Table name lengths...
Next
From: Greg Stark
Date:
Subject: Re: Any way to Convince postgres to push join clause inside subquery aggregate?