Re: Chante domain type - Postgres 9.2

Поиск
Список
Период
Сортировка
От Rob Sargent
Тема Re: Chante domain type - Postgres 9.2
Дата
Msg-id 936c9fbf-94e0-e57b-a71e-260c166d944f@gmail.com
обсуждение исходный текст
Ответ на Re: Chante domain type - Postgres 9.2  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: Chante domain type - Postgres 9.2  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: Chante domain type - Postgres 9.2  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: Chante domain type - Postgres 9.2  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general

On 09/26/2016 08:14 AM, Adrian Klaver wrote:
> On 09/26/2016 06:54 AM, Thomas Kellerer wrote:
>> Rakesh Kumar schrieb am 26.09.2016 um 15:08:
>>>> You sound like you think that varchar(50) is somehow cheaper than
>>>> text.
>>>
>>> The biggest impediment to text cols in other RDBMS  is no index
>>> allowed.
>>> If PG has an elegant solution to that, then yes I see the point made
>>> by the
>>> original poster.
>>
>> Don't confuse Postgres' "text" data type with "text" in other DBMS.
>
> Just be aware that layers above the database often do not understand
> that and will see text as a memo field. For instance in Django a text
> field will get rendered as a Textarea widget whereas a varchar field
> will be rendered as an TextInput widget. You can override that, but it
> is extra work. Luckily Postgres has the notion of an unbounded varchar:
>
> https://www.postgresql.org/docs/9.5/static/datatype-character.html
>
> ".. If character varying is used without length specifier, the type
> accepts strings of any size. The latter is a PostgreSQL extension."
>
> This allows you to have 'text' without it being called text, as stated
> below.
>
>>
>> There is no difference whatsoever between varchar and text in Postgres.
>>
>>
>>
>>
>>
>>
>>
>
>
Does that trick remove the overhead (length check) Tom mentioned upstream?




В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Chante domain type - Postgres 9.2
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Chante domain type - Postgres 9.2