pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: dafoer_x@163.com
Subject: BUG #17464: Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot be intercepted.
Date: Tue, 12 Apr 2022 12:41:23 +0000
Message-ID: <17464-4751c9d69159f363@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17464
Logged by:          Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot
be intercepted.
Email address:      dafoer_x@163.com
PostgreSQL version: 13.2
Operating system:   centos7.6 x86
Description:        

Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot
be intercepted.
Because texteq cannot accept null input parameters,
op->d.domainCheck.checknull is set to the wrong value .

detail:
postgres=# call f3_basic('男');
NOTICE:  a_xb = 男
CALL
postgres=# call  f3_basic('她');
NOTICE:  a_xb = 她
CALL


eg.
drop domain xb;
CREATE DOMAIN xb AS TEXT CHECK
(
   VALUE = '男'
   OR VALUE ='女'
   OR VALUE = null
 );
drop procedure if exists f3_basic(a_xb xb);
CREATE OR REPLACE procedure f3_basic (a_xb xb)  AS
$$
BEGIN
 RAISE NOTICE 'a_xb = %',a_xb;
END;
$$
LANGUAGE PLPGSQL;
-- success
call f3_basic('男');
-- expected error
call  f3_basic('她');
drop procedure if exists f3_basic(a_xb xb);
drop domain xb;



view thread (3+ messages)  latest in thread

Message-ID: <17464-4751c9d69159f363@postgresql.org>
Permalink:  ../17464-4751c9d69159f363@postgresql.org/
Also on:    postgresql.org/message-id/17464-4751c9d69159f363@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, dafoer_x@163.com
  Subject: Re: BUG #17464: Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot be intercepted.
  In-Reply-To: <17464-4751c9d69159f363@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox