As already said in the comments (thanks, @ D-side ), a similar question was on the DBA StackExchange . Of course, there is the answer :)
In addition, pgAdmin 4 is one (and far from the only ) of the free Postgres free administration tools (and there are also proprietary ones ). What types of data it displays in its interface is one thing, and the types of data that the DBMS itself supports are a bit different.
On the other hand, we need to understand, but what exactly do we want to store and what is it like? To do this, you can look directly at the standard described as RFC 821 . In the standard, we are interested in the possible length of the address (described on page 42), and it will be 129 characters. But before that, another RFC 2821 Simple Mail Transfer Protocol (obsolete) standard existed, where the address length was up to 255 characters. You can read more here . The standard may be outdated, but no one will guarantee that there are no longer any addresses with a length of 255 characters. Therefore, let's still be afraid, and we will assume that 255 is the maximum length of the email address.
We are also interested in whether the e-mail address is sensitive to the case of letters? Trusting the English version of StackOverflow and the RFC 5321 standard , section 2.3.11 , it turns out that part of the address to the dog can seem to be case-sensitive.
At the same time, SO on the link above states that, according to RFC 1035, section 3.1, the domain address is not case sensitive. We will not check, because even the fact that part of the address before the dog can be case-sensitive, we need only to understand that we need a type that can store case-sensitive data to store the address.
Total - we need a case-sensitive type in which we can store 255 characters.
The author of the question uses pgAdmin 4 and provided a screen with a possible choice of data types. So, the choice is not rich, but quite sufficient. We look into the documentation for PostrgeSQL, and we see that the character varyng type is a synonym for varchar . Actually, in English SO this opinion is shared :)
In total, the character varing type shown in the screenshot is case sensitive and can have a specified dimension, which is specified in the Lenght field in the pgAdmin 4 interface, which the author of the question cited.
Moreover, this type is part of the SQL standard, and suddenly, if [deleted] tomorrow is war [/ deleted], you need to move to another platform (read - to another database engine), then there will be no problems with the transfer of this field (like many other difficulties, if the type would be unique only for Postgres).
So, it is necessary to use it :)
In general, you can still hang on the field constraints or triggers, which, when entering / changing data in the field for storing an e-mail, would check its validity. But this is a topic for a separate issue. Although, if you want, you can check it regularly, for example . Although personally I myself tend to favor such a solution to verify the validity of an address (use a mailbox with the specified address as part of the registration process), although, of course, this option may not always be convenient.
As a result - use character varyng , it is varchar and do not worry. :-)
CITEXTorvarchar(254)(I’ve put a print of possible data type options) - EmptyManvarchar(254)not possible to use? It is the built in type. - D-side