Re: Trying to understand pg_get_expr()

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Trying to understand pg_get_expr()
Дата
Msg-id 5179b412-2eaa-4c96-89f3-53c2fb10dd31@aklaver.com
обсуждение исходный текст
Ответ на Re: Trying to understand pg_get_expr()  (Marcos Pegoraro <marcos@f10.com.br>)
Ответы Re: Trying to understand pg_get_expr()
Re: Trying to understand pg_get_expr()
Список pgsql-general
On 3/17/26 1:26 PM, Marcos Pegoraro wrote:
> Em ter., 17 de mar. de 2026 às 17:19, Adrian Klaver 
> <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> 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
adrian.klaver@aklaver.com



В списке pgsql-general по дате отправления: