Skip to content

Commit 6b23023

Browse files
committed
Fix "invalid zero OID reference in pg_type.dat" issue
1 parent 94b703d commit 6b23023

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/backend/catalog/genbki.pl

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,10 +1118,27 @@ sub lookup_oids
11181118
push @lookupoids, $lookupname;
11191119
if ($lookupname eq '-' or $lookupname eq '0')
11201120
{
1121-
warn sprintf
1122-
"invalid zero OID reference in %s.dat field %s line %s\n",
1123-
$catname, $attname, $bki_values->{line_number}
1124-
if !$lookup_opt;
1121+
if (defined($bki_values->{type_name})
1122+
and $bki_values->{type_name} ne 'oracharchar'
1123+
and $bki_values->{type_name} ne 'oracharbyte'
1124+
and $bki_values->{type_name} ne 'oravarcharchar'
1125+
and $bki_values->{type_name} ne 'oravarcharbyte'
1126+
and $bki_values->{type_name} ne 'oradate'
1127+
and $bki_values->{type_name} ne 'oratimestamp'
1128+
and $bki_values->{type_name} ne 'oratimestamptz'
1129+
and $bki_values->{type_name} ne 'oratimestampltz'
1130+
and $bki_values->{type_name} ne 'yminterval'
1131+
and $bki_values->{type_name} ne 'dsinterval'
1132+
and $bki_values->{type_name} ne 'number'
1133+
and $bki_values->{type_name} ne 'binary_float'
1134+
and $bki_values->{type_name} ne 'binary_double'
1135+
)
1136+
{
1137+
warn sprintf
1138+
"invalid zero OID reference in %s.dat field %s line %s\n",
1139+
$catname, $attname, $bki_values->{line_number}
1140+
if !$lookup_opt;
1141+
}
11251142
}
11261143
else
11271144
{

0 commit comments

Comments
 (0)