Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit36b9312

Browse files
committed
Don't use custom OID symbols in pg_proc.dat.
We have a perfectly good convention for OID macros for built-in functionsalready, so making custom symbols is just introducing unnecessarydeviation from the convention. Remove the one case that had snuck in,and add an error check in genbki.pl to discourage future instances.Although this touches pg_proc.dat, there's no need for a catversionbump since the actual catalog data isn't changed.John NaylorDiscussion:https://postgr.es/m/CAFBsxsHpCbjfoddNGpnnnY5pHwckWfiYkMYSF74PmP1su0+ZOw@mail.gmail.com
1 parentad1c36b commit36b9312

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

‎src/backend/catalog/genbki.pl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,13 @@
602602
# Emit OID symbol
603603
if (defined$bki_values{oid_symbol})
604604
{
605+
# OID symbols for builtin functions are handled automatically
606+
# by utils/Gen_fmgrtab.pl
607+
diesprintf
608+
"custom OID symbols are not allowed for pg_proc entries: '%s'",
609+
$bki_values{oid_symbol}
610+
if$catnameeq'pg_proc';
611+
605612
printf$def"#define%s%s\n",
606613
$bki_values{oid_symbol},$bki_values{oid};
607614
}

‎src/backend/utils/cache/relcache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,15 +1761,15 @@ RelationInitTableAccessMethod(Relation relation)
17611761
* seem prudent to show that in the catalog. So just overwrite it
17621762
* here.
17631763
*/
1764-
relation->rd_amhandler=HEAP_TABLE_AM_HANDLER_OID;
1764+
relation->rd_amhandler=F_HEAP_TABLEAM_HANDLER;
17651765
}
17661766
elseif (IsCatalogRelation(relation))
17671767
{
17681768
/*
17691769
* Avoid doing a syscache lookup for catalog tables.
17701770
*/
17711771
Assert(relation->rd_rel->relam==HEAP_TABLE_AM_OID);
1772-
relation->rd_amhandler=HEAP_TABLE_AM_HANDLER_OID;
1772+
relation->rd_amhandler=F_HEAP_TABLEAM_HANDLER;
17731773
}
17741774
else
17751775
{

‎src/include/catalog/pg_proc.dat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,7 @@
901901
prosrc => 'ftoi4' },
902902

903903
# Table access method handlers
904-
{ oid => '3', oid_symbol => 'HEAP_TABLE_AM_HANDLER_OID',
905-
descr => 'row-oriented heap table access method handler',
904+
{ oid => '3', descr => 'row-oriented heap table access method handler',
906905
proname => 'heap_tableam_handler', provolatile => 'v',
907906
prorettype => 'table_am_handler', proargtypes => 'internal',
908907
prosrc => 'heap_tableam_handler' },

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp