简体   繁体   中英

PostgreSQL - empty values that are not null and not empty strings

I ran this query on a PostgreSQL table:

select * wkt from table  where column <>'' and  column is not null

..and unexpectedly received several rows with no visible value in that column. Why is this? Is there some 'hidden' value in that column for those rows, or a corrupted table, or something else?

t=# select ascii(chr(9));
 ascii
-------
     9
(1 row)

thus

select ascii(column) from table  where column <>'' and  column is not null

should give the idea

https://www.postgresql.org/docs/current/static/functions-string.html

ASCII code of the first character of the argument. For UTF8 returns the Unicode code point of the character. For other multibyte encodings, the argument must be an ASCII character.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM