psql \dC incorrectly shows casts "with inout" as "binary coercible"on 9.5.14 and 11beta3 - Mailing list pgsql-hackers

From jean.pierre.pelletier0
Subject psql \dC incorrectly shows casts "with inout" as "binary coercible"on 9.5.14 and 11beta3
Date
Msg-id 5b887023.1c69fb81.ff96e.6a1d@mx.google.com
Whole thread Raw
Responses Re: psql \dC incorrectly shows casts "with inout" as "binary coercible" on 9.5.14 and 11beta3
List pgsql-hackers






To reproduce, compare the output of \dC on two built-in casts
(json to jsonb) and (xml to text) where only the the first is really "with inout".

I've been using the folllowing query which (I believe) correctly shows
the (json to jsonb) cast as "with inout"

SELECT
   CONCAT('CREATE CAST (',
      C.castSource::regType, ' AS ',
      C.castTarget::regType,') ',
      CASE c.castMethod
         WHEN 'b' THEN 'WITHOUT FUNCTION'
         WHEN 'f' THEN 'WITH FUNCTION ' || C.castFunc::regProc || '('
|| pg_get_function_identity_arguments(C.castFunc) || ')'
         WHEN 'i' THEN 'WITH INOUT'
      END,
      CASE c.castContext
         WHEN 'a' THEN ' AS ASSIGNMENT '
         WHEN 'e' THEN ''
         WHEN 'i' THEN ' AS IMPLICIT'
      END)
FROM
   pg_cast C

   INNER JOIN pg_type TS
   ON C.castSource = TS.oid

   INNER JOIN pg_type TT
   ON C.castTarget = TT.oid
WHERE
   (C.castSource::regType::text, C.castTarget::regType::text) IN
(('json','jsonb'), ('xml','text'));


I've also noticed that pgAdmin III 1.22.2 has the same bug,
while pgAdmin 4 3.2 displays "with inout" casts properly.

Thanks,
Jean-Pierre Pelletier

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: B-tree cache prefetches
Next
From: Andres Freund
Date:
Subject: Re: pg_verify_checksums and -fno-strict-aliasing