Lets say I have two tables in Postgres:
Name: table_rad
Column Type
id integer
username character varying(64)
Name: table_mac
Column Type
id integer
mac macaddr
I want to do to a join:
SELECT * FROM table_rad WHERE username = mac;
Postgres will complain:
ERROR: operator does no exist: character varying = macaddr
LINE 1: ...ELECT * from table_rad WHERE username = mac;
^
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Sofar I have googled for a solution and I know I have to CAST. But how can I cast type macaddr as varhcar?
Formal style:
CAST(mac AS varchar)PostgreSQL-style:
mac::varchare.g.: