RES: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Márcio A . Sepp
> > Can you elaborate? Why would anyone create a text column to store > customer name or product name which can very well be in varchar(50) > type of cols. > > You sound like you think that varchar(50) is somehow cheaper than text. > That's backwards (at least in PG, other DBMSes may be

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Tom Lane
Rob Sargent writes: > On 09/26/2016 08:14 AM, Adrian Klaver wrote: >> 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

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Adrian Klaver
On 09/26/2016 07:38 AM, Rob Sargent wrote: 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

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Adrian Klaver
On 09/26/2016 07:38 AM, Rob Sargent wrote: 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

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Rob Sargent
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

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Adrian Klaver
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

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Thomas Kellerer
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.

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Michael Sheaver
TEXT is a native type in PostgreSQL, and is highly optimized behind the scenes to be as fast and efficient as possible in both the storage and retrieval of the data. Regarding user input validation, it is almost always better to let the customer-facing app do the validation instead of relying

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Rakesh Kumar
>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.

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Tom Lane
Rakesh Kumar writes: > Can you elaborate? Why would anyone create a text column to store customer > name or product name which can very well be in varchar(50) type of cols. You sound like you think that varchar(50) is somehow cheaper than text. That's backwards (at

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Rakesh Kumar
>I have done some research after converting my database from MySQL 5.6 to >PostgreSQL 9.6 (the best move I have ever made), >and the consensus I found can be summed up as: >1. Never, neve, never use VARCHAR or even CHAR >2. Always always, always use TEXT >Unless, that is, you have some kind of

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Michael Sheaver
I have done some research after converting my database from MySQL 5.6 to PostgreSQL 9.6 (the best move I have ever made), and the consensus I found can be summed up as: 1. Never, neve, never use VARCHAR or even CHAR 2. Always always, always use TEXT Unless, that is, you have some kind of edge

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Jan de Visser
On 2016-09-26 1:15 AM, Gavin Flower wrote: On 26/09/16 17:58, Patrick B wrote: Hi guys, I've got this domain: CREATE DOMAIN public.a_city AS character varying(80) COLLATE pg_catalog."default"; And I need to increase the type from character varying(80) to character

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-25 Thread Gavin Flower
On 26/09/16 17:58, Patrick B wrote: Hi guys, I've got this domain: CREATE DOMAIN public.a_city AS character varying(80) COLLATE pg_catalog."default"; And I need to increase the type from character varying(80) to character varying(255). How can I do that? didn't find info

[GENERAL] Chante domain type - Postgres 9.2

2016-09-25 Thread Patrick B
Hi guys, I've got this domain: CREATE DOMAIN public.a_city > AS character varying(80) > COLLATE pg_catalog."default"; And I need to increase the type from character varying(80) to character varying(255). How can I do that? didn't find info about it. I'm using Postgres 9.2 Thanks! Patrick