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() ????? > ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match