Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfnsO-0005mb-T2 for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Jun 2020 17:05:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jfnsN-0002VW-PO for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Jun 2020 17:05:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfnsN-0002VD-IU for pgsql-bugs@lists.postgresql.org; Mon, 01 Jun 2020 17:05:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfnsL-0005n2-JF for pgsql-bugs@lists.postgresql.org; Mon, 01 Jun 2020 17:05:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 051H5OB6387002; Mon, 1 Jun 2020 13:05:24 -0400 From: Tom Lane To: d.a.ignatyev@yandex.ru cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16474: Foreign key issue In-reply-to: <16474-03a567470736cd26@postgresql.org> References: <16474-03a567470736cd26@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 01 Jun 2020 16:17:28 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <387000.1591031124.1@sss.pgh.pa.us> Date: Mon, 01 Jun 2020 13:05:24 -0400 Message-ID: <387001.1591031124@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > A few lines of SQL to clarify the situation: This isn't clarifying much. If I guess at your table definitions, it works for me: regression=# create table r_source (source text primary key); CREATE TABLE regression=# create table ppdm_rule_remark(source text references r_source); CREATE TABLE regression=# insert into r_source values ('PPDM39RNEX'); INSERT 0 1 regression=# select source from r_source where source = 'PPDM39RNEX' \gset regression=# \echo :source PPDM39RNEX regression=# INSERT INTO ppdm_rule_remark("source") values (:'source'); INSERT 0 1 Please provide a *self contained* example if you want us to investigate more closely. regards, tom lane