Skip to content

Commit 3599b68

Browse files
author
anju15bharti
committed
Fix long idenitfier
1 parent cd314d6 commit 3599b68

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/backend/catalog/genbki.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
PROCNAMENSPSIGNATURE
6969
SYSNAMESPACENAME
7070
AUTHIDUSEREXTROLENAME
71+
IDENTMAPPINGNAME
7172
);
7273

7374
foreach my $header (@ARGV)

src/backend/rewrite/rewriteDefine.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "nodes/nodeFuncs.h"
2828
#include "parser/parse_utilcmd.h"
2929
#include "rewrite/rewriteDefine.h"
30+
#include "parser/parser.h"
3031
#include "rewrite/rewriteManip.h"
3132
#include "rewrite/rewriteSupport.h"
3233
#include "utils/acl.h"
@@ -562,7 +563,11 @@ checkRuleResultList(List *targetList, TupleDesc resultDesc, bool isSelect,
562563
errmsg("cannot create a RETURNING list for a relation containing dropped columns")));
563564

564565
/* Check name match if required; no need for two error texts here */
565-
if (requireColumnNameMatch && strcmp(tle->resname, attname) != 0)
566+
if (requireColumnNameMatch && strcmp(tle->resname, attname) != 0 &&
567+
!(sql_dialect == SQL_DIALECT_TSQL &&
568+
strlen(tle->resname) > strlen(attname) &&
569+
strlen(attname) >= pg_mbcliplen(tle->resname, strlen(tle->resname), NAMEDATALEN - 1) &&
570+
strncmp(tle->resname, attname, strlen(attname)) == 0))
566571
ereport(ERROR,
567572
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
568573
errmsg("SELECT rule's target entry %d has different column name from column \"%s\"",

0 commit comments

Comments
 (0)