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

Commit908ab80

Browse files
committed
Further refine patch for commenting operator implementation functions.
Instead of manually maintaining the "implementation of XXX operator"comments in pg_proc.h, delete all those entries and let initdb createthem via a join. To let initdb figure out which name to use when thereis a conflict, change the comments for deprecated operators to say theyare deprecated --- which seems like a good thing to do anyway.
1 parent94be9e3 commit908ab80

File tree

6 files changed

+86
-742
lines changed

6 files changed

+86
-742
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,19 @@ setup_description(void)
14941494
" FROM tmp_pg_shdescription t, pg_class c "
14951495
" WHERE c.relname = t.classname;\n");
14961496

1497+
/* Create default descriptions for operator implementation functions */
1498+
PG_CMD_PUTS("WITH funcdescs AS ( "
1499+
"SELECT p.oid as p_oid, oprname, "
1500+
"coalesce(obj_description(o.oid, 'pg_operator'),'') as opdesc "
1501+
"FROM pg_proc p JOIN pg_operator o ON oprcode = p.oid ) "
1502+
"INSERT INTO pg_description "
1503+
" SELECT p_oid, 'pg_proc'::regclass, 0, "
1504+
" 'implementation of ' || oprname || ' operator' "
1505+
" FROM funcdescs "
1506+
" WHERE opdesc NOT LIKE 'deprecated%' AND "
1507+
" NOT EXISTS (SELECT 1 FROM pg_description "
1508+
" WHERE objoid = p_oid AND classoid = 'pg_proc'::regclass);\n");
1509+
14971510
PG_CMD_CLOSE;
14981511

14991512
check_ok();

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO201103031
56+
#defineCATALOG_VERSION_NO201103032
5757

5858
#endif

‎src/include/catalog/pg_operator.h

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ typedef FormData_pg_operator *Form_pg_operator;
8383
* ----------------
8484
*/
8585

86+
/*
87+
* Note: every entry in pg_operator.h is expected to have a DESCR() comment.
88+
* If the operator is a deprecated equivalent of some other entry, be sure
89+
* to comment it as such so that initdb doesn't think it's a preferred name
90+
* for the underlying function.
91+
*/
92+
8693
DATA(insertOID=15 ("="PGNSPPGUIDbtt23201641636int48eqeqseleqjoinsel ));
8794
DESCR("equal");
8895
DATA(insertOID=36 ("<>"PGNSPPGUIDbff23201641715int48neneqselneqjoinsel ));
@@ -141,7 +148,7 @@ DESCR("equal");
141148
DATA(insertOID=388 ("!"PGNSPPGUIDrff200170000numeric_fac-- ));
142149
DESCR("factorial");
143150
DATA(insertOID=389 ("!!"PGNSPPGUIDlff020170000numeric_fac-- ));
144-
DESCR("factorial");
151+
DESCR("deprecated, use ! instead");
145152
DATA(insertOID=385 ("="PGNSPPGUIDbft2929163850cideqeqseleqjoinsel ));
146153
DESCR("equal");
147154
DATA(insertOID=386 ("="PGNSPPGUIDbft2222163860int2vectoreqeqseleqjoinsel ));
@@ -641,7 +648,7 @@ DESCR("is above (allows touching)");
641648
DATA(insertOID=801 ("<^"PGNSPPGUIDbff6036031600box_below_eqpositionselpositionjoinsel ));
642649
DESCR("is below (allows touching)");
643650
DATA(insertOID=802 ("?#"PGNSPPGUIDbff6036031600box_overlapareaselareajoinsel ));
644-
DESCR("overlaps");
651+
DESCR("deprecated, use && instead");
645652
DATA(insertOID=803 ("#"PGNSPPGUIDbff60360360300box_intersect-- ));
646653
DESCR("box intersection");
647654
DATA(insertOID=804 ("+"PGNSPPGUIDbff60360060300box_add-- ));
@@ -1521,41 +1528,41 @@ DESCR("concatenate");
15211528

15221529
/* obsolete names for contains/contained-by operators; remove these someday */
15231530
DATA(insertOID=2860 ("@"PGNSPPGUIDbff6046041628610poly_containedcontselcontjoinsel ));
1524-
DESCR("is contained by");
1531+
DESCR("deprecated, use <@ instead");
15251532
DATA(insertOID=2861 ("~"PGNSPPGUIDbff6046041628600poly_containcontselcontjoinsel ));
1526-
DESCR("contains");
1533+
DESCR("deprecated, use @> instead");
15271534
DATA(insertOID=2862 ("@"PGNSPPGUIDbff6036031628630box_containedcontselcontjoinsel ));
1528-
DESCR("is contained by");
1535+
DESCR("deprecated, use <@ instead");
15291536
DATA(insertOID=2863 ("~"PGNSPPGUIDbff6036031628620box_containcontselcontjoinsel ));
1530-
DESCR("contains");
1537+
DESCR("deprecated, use @> instead");
15311538
DATA(insertOID=2864 ("@"PGNSPPGUIDbff7187181628650circle_containedcontselcontjoinsel ));
1532-
DESCR("is contained by");
1539+
DESCR("deprecated, use <@ instead");
15331540
DATA(insertOID=2865 ("~"PGNSPPGUIDbff7187181628640circle_containcontselcontjoinsel ));
1534-
DESCR("contains");
1541+
DESCR("deprecated, use @> instead");
15351542
DATA(insertOID=2866 ("@"PGNSPPGUIDbff6006031600on_pb-- ));
1536-
DESCR("point inside box");
1543+
DESCR("deprecated, use <@ instead");
15371544
DATA(insertOID=2867 ("@"PGNSPPGUIDbff6006021628680on_ppath-- ));
1538-
DESCR("point within closed path, or point on open path");
1545+
DESCR("deprecated, use <@ instead");
15391546
DATA(insertOID=2868 ("~"PGNSPPGUIDbff6026001628670path_contain_pt-- ));
1540-
DESCR("contains");
1547+
DESCR("deprecated, use @> instead");
15411548
DATA(insertOID=2869 ("@"PGNSPPGUIDbff6006041628700pt_contained_poly-- ));
1542-
DESCR("is contained by");
1549+
DESCR("deprecated, use <@ instead");
15431550
DATA(insertOID=2870 ("~"PGNSPPGUIDbff6046001628690poly_contain_pt-- ));
1544-
DESCR("contains");
1551+
DESCR("deprecated, use @> instead");
15451552
DATA(insertOID=2871 ("@"PGNSPPGUIDbff6007181628720pt_contained_circle-- ));
1546-
DESCR("is contained by");
1553+
DESCR("deprecated, use <@ instead");
15471554
DATA(insertOID=2872 ("~"PGNSPPGUIDbff7186001628710circle_contain_pt-- ));
1548-
DESCR("contains");
1555+
DESCR("deprecated, use @> instead");
15491556
DATA(insertOID=2873 ("@"PGNSPPGUIDbff6006281600on_pl-- ));
1550-
DESCR("point on line");
1557+
DESCR("deprecated, use <@ instead");
15511558
DATA(insertOID=2874 ("@"PGNSPPGUIDbff6006011600on_ps-- ));
1552-
DESCR("is contained by");
1559+
DESCR("deprecated, use <@ instead");
15531560
DATA(insertOID=2875 ("@"PGNSPPGUIDbff6016281600on_sl-- ));
1554-
DESCR("lseg on line");
1561+
DESCR("deprecated, use <@ instead");
15551562
DATA(insertOID=2876 ("@"PGNSPPGUIDbff6016031600on_sb-- ));
1556-
DESCR("is contained by");
1563+
DESCR("deprecated, use <@ instead");
15571564
DATA(insertOID=2877 ("~"PGNSPPGUIDbff103410331600aclcontains-- ));
1558-
DESCR("contains");
1565+
DESCR("deprecated, use @> instead");
15591566

15601567
/* uuid operators */
15611568
DATA(insertOID=2972 ("="PGNSPPGUIDbtt295029501629722973uuid_eqeqseleqjoinsel ));
@@ -1607,9 +1614,9 @@ DESCR("text search match");
16071614
DATA(insertOID=3637 ("@@"PGNSPPGUIDbff361536141636360ts_match_qvtsmatchseltsmatchjoinsel ));
16081615
DESCR("text search match");
16091616
DATA(insertOID=3660 ("@@@"PGNSPPGUIDbff361436151636610ts_match_vqtsmatchseltsmatchjoinsel ));
1610-
DESCR("text search match");
1617+
DESCR("deprecated, use @@ instead");
16111618
DATA(insertOID=3661 ("@@@"PGNSPPGUIDbff361536141636600ts_match_qvtsmatchseltsmatchjoinsel ));
1612-
DESCR("text search match");
1619+
DESCR("deprecated, use @@ instead");
16131620
DATA(insertOID=3674 ("<"PGNSPPGUIDbff361536151636793678tsquery_ltscalarltselscalarltjoinsel ));
16141621
DESCR("less than");
16151622
DATA(insertOID=3675 ("<="PGNSPPGUIDbff361536151636783679tsquery_lescalarltselscalarltjoinsel ));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp