Обсуждение: Large Objects

Поиск
Список
Период
Сортировка

Large Objects

От
Jürgen Purtz
Дата:
a) What is the distinction between our data type TEXT and the SQL:2011 
data type CLOB which we do not support (T041)?

b) Is there a distinction between the two Postgres data types TEXT and 
"CHARACTER VARYING without specifying a length" - or are they only 
synonym terms without different functionalities and capabilities?

Kind regards, Jürgen





Re: Large Objects

От
Thomas Kellerer
Дата:
> a) What is the distinction between our data type TEXT and the SQL:2011 data type CLOB which we do not support
(T041)?

I'd say there is no difference. 
> b) Is there a distinction between the two Postgres data types TEXT and "CHARACTER VARYING without specifying a
length"
 
> or are they only synonym terms without different functionalities and capabilities?

No there is no difference.

Quote from the manual [1]

> Tip: There is no performance difference among these three types, 
> apart from increased storage space when using the blank-padded type

Thomas


[1] https://www.postgresql.org/docs/current/static/datatype-character.html




Re: Large Objects

От
Pavel Stehule
Дата:
Hi

2016-10-07 9:10 GMT+02:00 Jürgen Purtz <juergen@purtz.de>:
a) What is the distinction between our data type TEXT and the SQL:2011 data type CLOB which we do not support (T041)?

TEXT type is classic type - you can do any available operation directly there. You don't need special conversions.
 

b) Is there a distinction between the two Postgres data types TEXT and "CHARACTER VARYING without specifying a length" - or are they only synonym terms without different functionalities and capabilities?

TEXT and varchar are pretty same types - you cannot to set limit over TEXT type - only this is visible difference

Regards

Pavel
 

Kind regards, Jürgen




--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Re: Large Objects

От
Adrian Klaver
Дата:
On 10/07/2016 12:25 AM, Pavel Stehule wrote:
> Hi
>
> 2016-10-07 9:10 GMT+02:00 Jürgen Purtz <juergen@purtz.de
> <mailto:juergen@purtz.de>>:
>
>     a) What is the distinction between our data type TEXT and the
>     SQL:2011 data type CLOB which we do not support (T041)?
>
>
> TEXT type is classic type - you can do any available operation directly
> there. You don't need special conversions.
>
>
>
>     b) Is there a distinction between the two Postgres data types TEXT
>     and "CHARACTER VARYING without specifying a length" - or are they
>     only synonym terms without different functionalities and capabilities?
>
>
> TEXT and varchar are pretty same types - you cannot to set limit over
> TEXT type - only this is visible difference

See also:

https://www.postgresql.org/message-id/998.1474901921%40sss.pgh.pa.us

>
> Regards
>
> Pavel
>
>
>
>     Kind regards, Jürgen
>
>
>
>
>     --
>     Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org
>     <mailto:pgsql-sql@postgresql.org>)
>     To make changes to your subscription:
>     http://www.postgresql.org/mailpref/pgsql-sql
>     <http://www.postgresql.org/mailpref/pgsql-sql>
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: Large Objects

От
Jürgen Purtz
Дата:
My first concern is compatibility with the SQL standard - not the 
performance issues. Summarising the actual thread and mail 
https://www.postgresql.org/message-id/CAJNY3ivGORG1JSjZmop6k_OCJiLop5UCrWkm6NtwEVZhZpFRUw%40mail.gmail.com 
(ff.) I want to state:

- There are 3 (main) character data types: a) character with fixed 
length b) character with variable size and a fix upper length limit and 
c) character with variable size and undeclared (but implementation 
dependent) upper length limit.

- Types a) and b) are named identical in the standard and in Postgres 
(CHAR/VARCHAR). Data type c) is named CLOB in the standard and TEXT in 
Postgres. Why this different wording, if there is no real difference 
between the terms?

- Our documentation says that Postgres does not support feature T041 of 
the standard. But functions like LENGTH, LOWER, TRIM, UPPER, 
CONCATENATION, ... works well on TEXT.

Do we have some people in the standardisation committees (ANSI, BSI, 
DIN, JISC, ...), who represents the Postgres interests at this level?

Kind regards, Jürgen



On 07.10.2016 15:19, Adrian Klaver wrote:
> On 10/07/2016 12:25 AM, Pavel Stehule wrote:
>> Hi
>>
>> 2016-10-07 9:10 GMT+02:00 Jürgen Purtz <juergen@purtz.de
>> <mailto:juergen@purtz.de>>:
>>
>>     a) What is the distinction between our data type TEXT and the
>>     SQL:2011 data type CLOB which we do not support (T041)?
>>
>>
>> TEXT type is classic type - you can do any available operation directly
>> there. You don't need special conversions.
>>
>>
>>
>>     b) Is there a distinction between the two Postgres data types TEXT
>>     and "CHARACTER VARYING without specifying a length" - or are they
>>     only synonym terms without different functionalities and 
>> capabilities?
>>
>>
>> TEXT and varchar are pretty same types - you cannot to set limit over
>> TEXT type - only this is visible difference
>
> See also:
>
> https://www.postgresql.org/message-id/998.1474901921%40sss.pgh.pa.us
>
>>
>> Regards
>>
>> Pavel
>>
>>
>>
>>     Kind regards, Jürgen
>>
>>
>>
>>
>>     --
>>     Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org
>>     <mailto:pgsql-sql@postgresql.org>)
>>     To make changes to your subscription:
>>     http://www.postgresql.org/mailpref/pgsql-sql
>>     <http://www.postgresql.org/mailpref/pgsql-sql>
>>
>>
>
>




Re: Large Objects

От
Thomas Kellerer
Дата:
Jürgen Purtz schrieb am 07.10.2016 um 21:31:
> - Types a) and b) are named identical in the standard and in Postgres
> (CHAR/VARCHAR). Data type c) is named CLOB in the standard and TEXT
> in Postgres.

>Why this different wording, if there is no real
> difference between the terms?

I guess because of historical reasons.

But if you need CLOB, then just define it:
  create domain clob as text;  create table foo (id integer, c1 clob);

Although I do agree that it would make sense to create CLOB as an alias for text and BLOB an alias for bytea.