Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vM0Ki-00GLVM-0M for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Nov 2025 08:48:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vM0Kf-000SPN-25 for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Nov 2025 08:48:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vM0Kf-000SPE-1A for pgsql-hackers@lists.postgresql.org; Thu, 20 Nov 2025 08:48:01 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vM0Kd-000VgH-0J for pgsql-hackers@lists.postgresql.org; Thu, 20 Nov 2025 08:48:01 +0000 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-b99bfb451e5so405155a12.2 for ; Thu, 20 Nov 2025 00:47:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763628476; x=1764233276; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7uD6vJLHS0w+lWeL4cNUPNDUucb7uJoir6AaS56StQo=; b=O7ZMu9iWYm5OhcLvMrDfIfa4d0BY+gXVQaPwrV1Pq/dePmbJNKapq20dTAekGUZgPk ze9fs31TdWRgilfjnn/rm5mUKVllj+sE3WETd8dhdb1dAASEsV86biCdoaKw/e+xTBrn MYvePEDBIWPMi/P7As/hXfXhr/IizlKPoeyyIYoZyJCNFSVo9zdrBwxXe4HBqBFclf59 Ygf8SyDvmG7V04tN4AcyN9JyGN368C4lmDqv4hs1lPTMfCslvbgqhJ5GJEFMFtpR9NO9 BfzKoX6XBOkhrDDiBmPAEzEj9Os5JEx5odP3u54Oqi86nwIaLKBtx7wnNCB2UZgGmqDg rE/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763628476; x=1764233276; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7uD6vJLHS0w+lWeL4cNUPNDUucb7uJoir6AaS56StQo=; b=KqeObmQTdUwTe+xsLekIkkvJ0yG2sRG1H/2AR9Mqr8t8r6qLzKlEwlkM74jFNfXyIl lnxb4vPKkG5S1RBnA8Co9Vk37qffMRMTgdjgg6NXuz9JHZ82ceAdIqLbzj0kEFIqZPYn Jx1jP2huOBGQPxWbgMIojlsfrtZK2vWcYIDgLQmIShCNfGY91VbZ3uVsngKjK8Wwc7cx Gk/AuRmQli7E/LpSP74WvSOjpY8G6fbB/SEOf3QefMUTurZiRMsGzijO1VHXstWpD6qe lq7nLPEl/n8gZ/3kLT+0t7TGZfAO3VAvkUUBCbSxMruA4MCLldfvUeSc5+lUUJDIGXM9 LfGA== X-Gm-Message-State: AOJu0YymZa+9raqDROtIPkGd1iYRPzt3lGIYLGAUUgiFjnevWpS1xSgW swzLZEqo/Lp8tyN34okqli2g4R8Sn24CRieXearHqPSJUFoCUlczwYf5 X-Gm-Gg: ASbGncvj4GSs7bOFlZFhoIxqWLZVb2FdT2Y/uMY4u4giPk/AzPhNVXGaVfSwz3jr9Ne TqMn0fgXRmN0i3skh7o7KWCWC7uPzjLQk4TM+5wuUhrW/l/oxfIZqu0eFjWBU/0mVPRchf6rkpS DbEYHPVPpIh7ykEfBCe9SvTzvv5eXvv1j9s/EKcW8Icub1m1y+5gcSttUZX8FDZvPhH4YQGcc6O 5D17/Gv7+gUKUuVpD8IdkEFLCRlb/TsrvwXK2z53OTP5SYvemx5Z6R1fdrYXZeuSErwtnTnJvzX QNcyPTpeHK+hdlYNC/ouEX72FOU+J+XtDknBw1us91Xepqh6HiTLXZPDJS+DqN2MmpUALQMRO/E Sw8IJwCi2KzsDBXsQJGX6gDpWJwUMwLrkaK40p3jIzxrvYFEf2kxcIVtigts5UtYEoXW/TwoVCJ XqQ7McrSu0dWYhsvKpmCY= X-Google-Smtp-Source: AGHT+IFFup3R8hFKkSqKC4UtSBWU6lh1CjL8LkH/Nxn42jmI7AN9QGiWUWu8qu++HWYnPsDffJ61Eg== X-Received: by 2002:a05:7301:282a:b0:2a4:3592:c5f3 with SMTP id 5a478bee46e88-2a6fcfedf69mr658779eec.4.1763628476373; Thu, 20 Nov 2025 00:47:56 -0800 (PST) Received: from smtpclient.apple ([23.94.170.107]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2a6fc204881sm7320602eec.0.2025.11.20.00.47.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Nov 2025 00:47:55 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [PATCH] pg_get_domain_ddl: DDL reconstruction function for CREATE DOMAIN statement From: Chao Li In-Reply-To: <6a131cc6-ab35-49d2-b9bf-e6ddae4cf3b1@gmail.com> Date: Thu, 20 Nov 2025 16:47:19 +0800 Cc: pgsql-hackers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <36A72FEF-F07E-40A8-8022-998D5DA6FD04@gmail.com> References: <6a131cc6-ab35-49d2-b9bf-e6ddae4cf3b1@gmail.com> To: Florin Irion X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Nov 12, 2025, at 00:14, Florin Irion wrote: >=20 > Hello, Cirrus-CI was complaining because we don't sort the constraints = and thus > they were making the test fail because of the random order. > Made it sort with `list_sort`and `list_oid_cmp`not sure if that's the = best > thing to sort them. > Check v4 attached. > Cheers, > Florin Irion > Tim Waizenegger > EDB (EnterpriseDB) > I just tested v4, and see two problems: ``` evantest=3D# CREATE DOMAIN public.int AS pg_catalog.int4; CREATE DOMAIN evantest=3D# SELECT pg_get_domain_ddl('int'); ERROR: cache lookup failed for type 0 evantest=3D# evantest=3D# evantest=3D# SELECT pg_get_domain_ddl('pg_class'); ERROR: cache lookup failed for type 0 evantest=3D# evantest=3D# evantest=3D# SELECT pg_get_domain_ddl('public.int'); pg_get_domain_ddl ------------------------------------------------ CREATE DOMAIN public."int" AS pg_catalog.int4; (1 row) evantest=3D# show search_path; search_path ----------------- "$user", public (1 row) ``` 1. The error message "cache lookup failed for type 0=E2=80=9D looks not = good. At lease saying something like =E2=80=9Cdomain =E2=80=98int=E2=80=99= does not exist=E2=80=9D. 2. I created a domain =E2=80=9Cint=E2=80=9D in =E2=80=9Cpublic=E2=80=9D, = as you see, =E2=80=9Cpublic=E2=80=9D is in the search_path, but SELECT = pg_get_domain_ddl('int=E2=80=99); failed. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/