Re: varchar length... PHP - Mailing list pgsql-general

From mike g
Subject Re: varchar length... PHP
Date
Msg-id 1090038964.14010.42.camel@localhost.localdomain
Whole thread Raw
In response to varchar length... PHP  (Constantin Khatsckevich <c@const.ru>)
List pgsql-general
Hello,

Varchar by default will truncate extra space at the end.  If the table
column is defined as char or you cast the varchar to a char data type it
will have a fixed size of 40 characters.

Mike

On Tue, 2004-07-13 at 06:29, Constantin Khatsckevich wrote:
> Hello!
>
> Can I get ordered length of the varchar field? I need it in PHP script.
>
> For example,
> CREATE TABLE t1
> (
>    id int,
>    str varchar(40)
> );
>
> PHP function pg_FieldSize() returns me -1 for field str, because this is
> variable length field, but I need got 40 (in the my example). May be
> like sizeof() ?????
>

pgsql-general by date:

Previous
From: mike g
Date:
Subject: Re: Problem Report
Next
From: mike g
Date:
Subject: Re: server closed the connection unexpectedly