On 3/17/26 1:26 PM, Marcos Pegoraro wrote:
Em ter., 17 de mar. de 2026 às 17:19, Adrian Klaver <[email protected] <mailto:[email protected]>> escreveu:

    I also tried other combinations of casting both sides of "=" and it
    still did not work.


"'test'::character varying" is the result of that function, not type of test
This should work
AND pg_get_expr(adbin, adrelid) = $$'test'::character varying$$;

Yeah that worked.

It begs the question then, in:

SELECT
    adrelid::regclass,
    pg_typeof(pg_get_expr(adbin, adrelid)),
    pg_get_expr(adbin, adrelid)
FROM
    pg_attrdef
WHERE
    adrelid = 'default_test'::regclass;

 adrelid    | pg_typeof |        pg_get_expr
--------------+-----------+---------------------------
 default_test | text      | 'test'::character varying
 default_test | text      | 0

Why is the second case not?:

'0'::integer


regards
Marcos



--
Adrian Klaver
[email protected]


Reply via email to