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

Commit85475af

Browse files
committed
Cosmetic improvement: use BKI_DEFAULT and BKI_LOOKUP in pg_language.
The point of this is not really to remove redundancy in pg_language.dat;with only three entries, it's hardly worth it. Rather, it is to getto a point where there are exactly zero hard-coded numeric pg_proc OIDreferences in the catalog .dat files. The lanvalidator column was theonly remaining location of such references, and it seems like a goodthing for future-proofing reasons to make it not be a special case.There are still a few places in the .dat files with numeric OID referencesto other catalogs, but after review I don't see any that seem worthchanging at present. In each case there are just too few entries to makeit worth the trouble to create lookup infrastructure.This doesn't change the emitted postgres.bki file, so no catversion bump.
1 parent9cb7db3 commit85475af

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

‎src/include/catalog/pg_language.dat

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,12 @@
1414

1515
{ oid => '12', oid_symbol => 'INTERNALlanguageId',
1616
descr => 'built-in functions',
17-
lanname => 'internal', lanowner => 'PGUID', lanispl => 'f',
18-
lanpltrusted => 'f', lanplcallfoid => '0', laninline => '0',
19-
lanvalidator => '2246', lanacl => '_null_' },
17+
lanname => 'internal', lanvalidator => 'fmgr_internal_validator' },
2018
{ oid => '13', oid_symbol => 'ClanguageId',
2119
descr => 'dynamically-loaded C functions',
22-
lanname => 'c', lanowner => 'PGUID', lanispl => 'f', lanpltrusted => 'f',
23-
lanplcallfoid => '0', laninline => '0', lanvalidator => '2247',
24-
lanacl => '_null_' },
20+
lanname => 'c', lanvalidator => 'fmgr_c_validator' },
2521
{ oid => '14', oid_symbol => 'SQLlanguageId',
2622
descr => 'SQL-language functions',
27-
lanname => 'sql', lanowner => 'PGUID', lanispl => 'f', lanpltrusted => 't',
28-
lanplcallfoid => '0', laninline => '0', lanvalidator => '2248',
29-
lanacl => '_null_' },
23+
lanname => 'sql', lanpltrusted => 't', lanvalidator => 'fmgr_sql_validator' },
3024

3125
]

‎src/include/catalog/pg_language.h

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,30 @@
2828
*/
2929
CATALOG(pg_language,2612,LanguageRelationId)
3030
{
31-
NameDatalanname;/* Language name */
32-
Oidlanowner;/* Language's owner */
33-
boollanispl;/* Is a procedural language */
34-
boollanpltrusted;/* PL is trusted */
35-
Oidlanplcallfoid;/* Call handler for PL */
36-
Oidlaninline;/* Optional anonymous-block handler function */
37-
Oidlanvalidator;/* Optional validation function */
31+
/* Language name */
32+
NameDatalanname;
33+
34+
/* Language's owner */
35+
OidlanownerBKI_DEFAULT(PGUID);
36+
37+
/* Is a procedural language */
38+
boollanisplBKI_DEFAULT(f);
39+
40+
/* PL is trusted */
41+
boollanpltrustedBKI_DEFAULT(f);
42+
43+
/* Call handler, if it's a PL */
44+
OidlanplcallfoidBKI_DEFAULT(0)BKI_LOOKUP(pg_proc);
45+
46+
/* Optional anonymous-block handler function */
47+
OidlaninlineBKI_DEFAULT(0)BKI_LOOKUP(pg_proc);
48+
49+
/* Optional validation function */
50+
OidlanvalidatorBKI_DEFAULT(0)BKI_LOOKUP(pg_proc);
3851

3952
#ifdefCATALOG_VARLEN/* variable-length fields start here */
40-
aclitemlanacl[1];/* Access privileges */
53+
/* Access privileges */
54+
aclitemlanacl[1]BKI_DEFAULT(_null_);
4155
#endif
4256
}FormData_pg_language;
4357

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp