6 ms·
PostgreSQL do have a variable unlimited length datatype : text. AFAIK, Varchar is internally a subtype that bound the text type. So in extreme situations you mi
by ldng 7y ago
PostgreSQL do have a variable unlimited length datatype : text. AFAIK, Varchar is internally a subtype that bound the text type. So in extreme situations you might even get a very slight performance advantage using text instead of varchar.
- pkrefta 7y agoThis is exactly how it is. You can find confirmation in Postgres docs [1] [1] https://www.postgresql.org/docs/9.1/datatype-character.html https://www.postgresql.org/docs/9.1/datatype-character.html
- benatkin 7y agoInteresting. When is there an advantage of using varchar in postgres, other than limiting the field length?
- nicoburns 7y agoI think never, except if you want your SQL to be portable to other dbs.