diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-11-24 14:20:39 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-11-24 14:22:17 -0500 |
commit | 725d52d0c27cffe8c99bb78e2b0d2480d5cd702b (patch) | |
tree | 23aae31466c0f7e0e65762946b0012d30e92ab4d /src/backend/parser | |
parent | 4fc09ad00c3cc95003a5523d85999da1dd4f9d75 (diff) | |
download | postgresql-725d52d0c27cffe8c99bb78e2b0d2480d5cd702b.tar.gz postgresql-725d52d0c27cffe8c99bb78e2b0d2480d5cd702b.zip |
Create the system catalog infrastructure needed for KNNGIST.
This commit adds columns amoppurpose and amopsortfamily to pg_amop, and
column amcanorderbyop to pg_am. For the moment all the entries in
amcanorderbyop are "false", since the underlying support isn't there yet.
Also, extend the CREATE OPERATOR CLASS/ALTER OPERATOR FAMILY commands with
[ FOR SEARCH | FOR ORDER BY sort_operator_family ] clauses to allow the new
columns of pg_amop to be populated, and create pg_dump support for dumping
that information.
I also added some documentation, although it's perhaps a bit premature
given that the feature doesn't do anything useful yet.
Teodor Sigaev, Robert Haas, Tom Lane
Diffstat (limited to 'src/backend/parser')
-rw-r--r-- | src/backend/parser/gram.y | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index f0c2cd06ea6..1c17be89214 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -295,7 +295,7 @@ static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_ ctext_expr_list ctext_row def_list indirection opt_indirection reloption_list group_clause TriggerFuncArgs select_limit opt_select_limit opclass_item_list opclass_drop_list - opt_opfamily transaction_mode_list_or_empty + opclass_purpose opt_opfamily transaction_mode_list_or_empty OptTableFuncElementList TableFuncElementList opt_type_modifiers prep_type_clause execute_param_clause using_clause returning_clause @@ -3935,22 +3935,25 @@ opclass_item_list: ; opclass_item: - OPERATOR Iconst any_operator opt_recheck + OPERATOR Iconst any_operator opclass_purpose opt_recheck { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = $3; n->args = NIL; n->number = $2; + n->order_family = $4; $$ = (Node *) n; } - | OPERATOR Iconst any_operator oper_argtypes opt_recheck + | OPERATOR Iconst any_operator oper_argtypes opclass_purpose + opt_recheck { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = $3; n->args = $4; n->number = $2; + n->order_family = $5; $$ = (Node *) n; } | FUNCTION Iconst func_name func_args @@ -3989,6 +3992,11 @@ opt_opfamily: FAMILY any_name { $$ = $2; } | /*EMPTY*/ { $$ = NIL; } ; +opclass_purpose: FOR SEARCH { $$ = NIL; } + | FOR ORDER BY any_name { $$ = $4; } + | /*EMPTY*/ { $$ = NIL; } + ; + opt_recheck: RECHECK { /* |