I was was trying to compare a literal to a VARCHAR(31) field in my table. I wasn't getting a match so I tried switching data types. When I tried the Equal operator and CHAR(31) type I get a signal 11: Segmentation fault. This is not a serious problem for me, just something I noticed.
$ echo "select patkey, namefirst, namelast, adrsadd1, adrscity, adrsstate, adrszip from patient where namefirst = 'First' and namelast = 'Lst'" | psql rx30
patkey | namefirst | namelast | adrsadd1 | adrscity | adrsstate | adrszip
--------+-----------+----------+--------------------------+----------+-----------+---------
36505 | First | Lst | 123 Xxxxxxxxxxxxx AVENUE | Xxxxx | NJ | 12345
(1 row)
$ echo "select patkey, namefirst, namelast, adrsadd1, adrscity, adrsstate, adrszip from patient where namefirst = 'First' and namelast = 'Lst' and adrsadd1 = '123 Xxxxxxxxxxxxx AVE '" | psql rx30
patkey | namefirst | namelast | adrsadd1 | adrscity | adrsstate | adrszip
--------+-----------+----------+----------+----------+-----------+---------
(0 rows)
$ echo "select patkey, namefirst, namelast, adrsadd1, adrscity, adrsstate, adrszip from patient where namefirst = 'First' and namelast = 'Lst' and adrsadd1 = '123 Xxxxxxxxxxxxx AVE '::VARCHAR(31)" | psql rx30
patkey | namefirst | namelast | adrsadd1 | adrscity | adrsstate | adrszip
--------+-----------+----------+----------+----------+-----------+---------
(0 rows)
$ echo "select patkey, namefirst, namelast, adrsadd1, adrscity, adrsstate, adrszip from patient where namefirst = 'First' and namelast = 'Lst' and adrsadd1 = '123 Xxxxxxxxxxxxx AVE '::VARCHAR(31)" | psql rx30
patkey | namefirst | namelast | adrsadd1 | adrscity | adrsstate | adrszip
--------+-----------+----------+----------+----------+-----------+---------
(0 rows)
$ echo "select patkey, namefirst, namelast, adrsadd1, adrscity, adrsstate, adrszip from patient where namefirst = 'First' and namelast = 'Lst' and adrsadd1 = '123 Xxxxxxxxxxxxx AVE'::VARCHAR(31)" | psql rx30
patkey | namefirst | namelast | adrsadd1 | adrscity | adrsstate | adrszip
--------+-----------+----------+----------+----------+-----------+---------
(0 rows)
$ echo "select patkey, namefirst, namelast, adrsadd1, adrscity, adrsstate, adrszip from patient where namefirst = 'First' and namelast = 'Lst' and adrsadd1 = '123 Xxxxxxxxxxxxx AVE'::CHAR(31)" | psql rx30
connection to server was lost
$ echo "select patkey, namefirst, namelast, adrsadd1, adrscity, adrsstate, adrszip from patient where namefirst = 'First' and namelast = 'Lst' and adrsadd1 like '123 Xxxxxxxxxxxxx AVE'::CHAR(31)" | psql rx30
patkey | namefirst | namelast | adrsadd1 | adrscity | adrsstate | adrszip
--------+-----------+----------+----------+----------+-----------+---------
(0 rows)
$ echo "select patkey, namefirst, namelast, adrsadd1, adrscity, adrsstate, adrszip from patient where namefirst = 'First' and namelast = 'Lst' and adrsadd1 like '123 Xxxxxxxxxxxxx AVE%'::CHAR(31)" | psql rx30
patkey | namefirst | namelast | adrsadd1 | adrscity | adrsstate | adrszip
--------+-----------+----------+--------------------------+----------+-----------+---------
36505 | First | Lst | 123 Xxxxxxxxxxxxx AVENUE | Xxxxx | NJ | 12345
(1 row)
$