[TYPO3-dev] Question about rev. 2186: TINYTEXT columns to VARCHAR(255)

Mathias Behrle expi311203 at gmx.de
Fri Mar 23 20:13:47 CET 2007


* Martin Kutschker am Fri, 23 Mar 2007 15:20:31 +0100:
>> My question is:
>> Does it explicitly have to be varchar(255) DEFAULT '' NOT NULL for the
>> new data type or could/should it also be TEXT ?
>> 
>> Background:
>> 1) I have already NULL values in some of these fields, that were until
>> now bytea in postgres. Since DBAL until now maps fields of type
>> text NOT NULL to just text, it should be possible to keep the NULL
>> values. 
>
> Why do you need those NULLs? 

I don't need them at all, they are just there, a reminiscence of earlier
times.

>> 2) more important:
>> the postgres manual says:
>>  There are no performance differences between these three types
>>  (the different character types), apart
>>  from the increased storage size when using the blank-padded type. While
>>  character(n) has performance advantages in some other database systems,
>>  it has no such advantages in PostgreSQL. In most situations text or
>>  character varying should be used instead.
>
> Well, it says that is a difference for other systems, so DEFAULT '' NOT 
> NULL makes sense.

Yes, but why are we using varchar at all? At other places TEXT columns
are used, so I don't understand yet, why we are undergoing the
limitation of VARCHAR(n) if we can have an unlimited type TEXT?

> I suggest you change all '' to NULL.

Isn't this a typo? Didn't you want to suggest the other way (=> change
all NULL values in my database to '')? Or did you speak from the table
definitions?

> TINYTEXT is Mysql specific and should work the same as VARCHAR(255) as 
> TYPO3 does not really work with NULL values and usually relies on DEFAULTs.
>
>> 2) text fields in postgres should have as well as varchar some default
>> ('') inserted, which is currently not the case
>
> See above.

So if TYPO3 usually depends on some value in TEXT or VARCHAR columns
I don't yet understand why VARCHAR columns are always i.e.
 file_mountpoints varchar(255) DEFAULT '' NOT NULL
but TEXT columns are always just i.e.
 non_exclude_fields text NOT NULL
without any default assigned to them?

Thank you!
Mathias




More information about the TYPO3-dev mailing list