I am trying to write a query that indicates whether a column with a name sin the table has a.ta default value (this is a very large base64 row). So I tried:
SELECT 1 FROM a.t WHERE s = (
SELECT column_default FROM information_schema.columns
WHERE (table_schema, table_name, column_name) = ('a', 't', 's'))
AND uname = 'joe';
Which didn’t work, so I noticed that the result from information_schema.columnshad some things that the normal query did not execute on:
SELECT column_default FROM information_schema.columns
WHERE (table_schema, table_name, column_name) = ('a', 't', 's');
column_default | 'data:image/png;base64,iVBO...QmCC'::text
Vs.
SELECT s FROM a.t WHERE uname = 'joe';
s | data:image/png;base64,iVBO...QmCC
Note the absence of quotation marks and explicit casts.
Is this really not the case? A column is sdefined as a type text.
How can I modify my query to check the correspondence between a column value and its default value?