Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
e40492ec
Commit
e40492ec
authored
Jul 15, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove useless and dangerous 'opt_type' option from CREATE INDEX.
parent
6bfe6403
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
43 deletions
+27
-43
src/backend/nodes/outfuncs.c
src/backend/nodes/outfuncs.c
+4
-6
src/backend/parser/analyze.c
src/backend/parser/analyze.c
+1
-2
src/backend/parser/gram.y
src/backend/parser/gram.y
+10
-26
src/include/nodes/parsenodes.h
src/include/nodes/parsenodes.h
+12
-9
No files found.
src/backend/nodes/outfuncs.c
View file @
e40492ec
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.12
1 2000/07/12 02:37:06
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.12
2 2000/07/15 00:01:37
tgl Exp $
*
*
* NOTES
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
* Every (plan) node in POSTGRES has an associated "out" routine which
...
@@ -139,9 +139,9 @@ _outIndexStmt(StringInfo str, IndexStmt *node)
...
@@ -139,9 +139,9 @@ _outIndexStmt(StringInfo str, IndexStmt *node)
appendStringInfo
(
str
,
" :rangetable "
);
appendStringInfo
(
str
,
" :rangetable "
);
_outNode
(
str
,
node
->
rangetable
);
_outNode
(
str
,
node
->
rangetable
);
appendStringInfo
(
str
,
" :
lossy %s :unique
%s "
,
appendStringInfo
(
str
,
" :
unique %s :primary
%s "
,
node
->
lossy
?
"true"
:
"false"
,
node
->
unique
?
"true"
:
"false"
,
node
->
unique
?
"true"
:
"false"
);
node
->
primary
?
"true"
:
"false"
);
}
}
static
void
static
void
...
@@ -210,8 +210,6 @@ _outIndexElem(StringInfo str, IndexElem *node)
...
@@ -210,8 +210,6 @@ _outIndexElem(StringInfo str, IndexElem *node)
_outNode
(
str
,
node
->
args
);
_outNode
(
str
,
node
->
args
);
appendStringInfo
(
str
,
" :class "
);
appendStringInfo
(
str
,
" :class "
);
_outToken
(
str
,
node
->
class
);
_outToken
(
str
,
node
->
class
);
appendStringInfo
(
str
,
" :typename "
);
_outNode
(
str
,
node
->
typename
);
}
}
static
void
static
void
...
...
src/backend/parser/analyze.c
View file @
e40492ec
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: analyze.c,v 1.15
0 2000/07/14 15:43:32 thomas
Exp $
* $Id: analyze.c,v 1.15
1 2000/07/15 00:01:41 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -947,7 +947,6 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
...
@@ -947,7 +947,6 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
iparam
->
name
=
pstrdup
(
column
->
colname
);
iparam
->
name
=
pstrdup
(
column
->
colname
);
iparam
->
args
=
NIL
;
iparam
->
args
=
NIL
;
iparam
->
class
=
NULL
;
iparam
->
class
=
NULL
;
iparam
->
typename
=
NULL
;
index
->
indexParams
=
lappend
(
index
->
indexParams
,
iparam
);
index
->
indexParams
=
lappend
(
index
->
indexParams
,
iparam
);
if
(
index
->
idxname
==
NULL
)
if
(
index
->
idxname
==
NULL
)
...
...
src/backend/parser/gram.y
View file @
e40492ec
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.17
8 2000/07/14 15:43:32 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.17
9 2000/07/15 00:01:41 tgl
Exp $
*
*
* HISTORY
* HISTORY
* AUTHOR DATE MAJOR EVENT
* AUTHOR DATE MAJOR EVENT
...
@@ -250,7 +250,7 @@ static void doNegateFloat(Value *v);
...
@@ -250,7 +250,7 @@ static void doNegateFloat(Value *v);
%type <target> target_el, update_target_el
%type <target> target_el, update_target_el
%type <paramno> ParamNo
%type <paramno> ParamNo
%type <typnam> Typename,
opt_type,
SimpleTypename, ConstTypename
%type <typnam> Typename, SimpleTypename, ConstTypename
Generic, Numeric, Character, ConstDatetime, ConstInterval, Bit
Generic, Numeric, Character, ConstDatetime, ConstInterval, Bit
%type <str> typename, generic, numeric, character, datetime, bit
%type <str> typename, generic, numeric, character, datetime, bit
%type <str> extract_arg
%type <str> extract_arg
...
@@ -1778,7 +1778,7 @@ TriggerFuncArg: ICONST
...
@@ -1778,7 +1778,7 @@ TriggerFuncArg: ICONST
}
}
| FCONST { $$ = $1; }
| FCONST { $$ = $1; }
| Sconst { $$ = $1; }
| Sconst { $$ = $1; }
|
IDENT
{ $$ = $1; }
|
ColId
{ $$ = $1; }
;
;
OptConstrFromTable: /* Empty */
OptConstrFromTable: /* Empty */
...
@@ -2315,8 +2315,6 @@ RevokeStmt: REVOKE privileges ON relation_name_list FROM grantee
...
@@ -2315,8 +2315,6 @@ RevokeStmt: REVOKE privileges ON relation_name_list FROM grantee
IndexStmt: CREATE index_opt_unique INDEX index_name ON relation_name
IndexStmt: CREATE index_opt_unique INDEX index_name ON relation_name
access_method_clause '(' index_params ')' opt_with
access_method_clause '(' index_params ')' opt_with
{
{
/* should check that access_method is valid,
etc ... but doesn't */
IndexStmt *n = makeNode(IndexStmt);
IndexStmt *n = makeNode(IndexStmt);
n->unique = $2;
n->unique = $2;
n->idxname = $4;
n->idxname = $4;
...
@@ -2345,37 +2343,24 @@ index_list: index_list ',' index_elem { $$ = lappend($1, $3); }
...
@@ -2345,37 +2343,24 @@ index_list: index_list ',' index_elem { $$ = lappend($1, $3); }
| index_elem { $$ = lcons($1, NIL); }
| index_elem { $$ = lcons($1, NIL); }
;
;
func_index: func_name '(' name_list ')' opt_
type opt_
class
func_index: func_name '(' name_list ')' opt_class
{
{
$$ = makeNode(IndexElem);
$$ = makeNode(IndexElem);
$$->name = $1;
$$->name = $1;
$$->args = $3;
$$->args = $3;
$$->class = $6;
$$->class = $5;
$$->typename = $5;
}
}
;
;
index_elem: attr_name opt_
type opt_
class
index_elem: attr_name opt_class
{
{
$$ = makeNode(IndexElem);
$$ = makeNode(IndexElem);
$$->name = $1;
$$->name = $1;
$$->args = NIL;
$$->args = NIL;
$$->class = $3;
$$->class = $2;
$$->typename = $2;
}
}
;
;
opt_type: ':' Typename { $$ = $2; }
| FOR Typename { $$ = $2; }
| /*EMPTY*/ { $$ = NULL; }
;
/* opt_class "WITH class" conflicts with preceeding opt_type
* for Typename of "TIMESTAMP WITH TIME ZONE"
* So, remove "WITH class" from the syntax. OK??
* - thomas 1997-10-12
* | WITH class { $$ = $2; }
*/
opt_class: class {
opt_class: class {
/*
/*
* Release 7.0 removed network_ops, timespan_ops, and datetime_ops,
* Release 7.0 removed network_ops, timespan_ops, and datetime_ops,
...
@@ -5352,9 +5337,9 @@ relation_name: SpecialRuleRelation
...
@@ -5352,9 +5337,9 @@ relation_name: SpecialRuleRelation
;
;
database_name: ColId { $$ = $1; };
database_name: ColId { $$ = $1; };
access_method:
IDENT
{ $$ = $1; };
access_method:
ColId
{ $$ = $1; };
attr_name: ColId { $$ = $1; };
attr_name: ColId { $$ = $1; };
class:
IDENT
{ $$ = $1; };
class:
ColId
{ $$ = $1; };
index_name: ColId { $$ = $1; };
index_name: ColId { $$ = $1; };
/* Functions
/* Functions
...
@@ -5365,7 +5350,6 @@ name: ColId { $$ = $1; };
...
@@ -5365,7 +5350,6 @@ name: ColId { $$ = $1; };
func_name: ColId { $$ = xlateSqlFunc($1); };
func_name: ColId { $$ = xlateSqlFunc($1); };
file_name: Sconst { $$ = $1; };
file_name: Sconst { $$ = $1; };
/* NOT USED recipe_name: IDENT { $$ = $1; };*/
/* Constants
/* Constants
* Include TRUE/FALSE for SQL3 support. - thomas 1997-10-24
* Include TRUE/FALSE for SQL3 support. - thomas 1997-10-24
...
@@ -5453,7 +5437,7 @@ ParamNo: PARAM opt_indirection
...
@@ -5453,7 +5437,7 @@ ParamNo: PARAM opt_indirection
Iconst: ICONST { $$ = $1; };
Iconst: ICONST { $$ = $1; };
Sconst: SCONST { $$ = $1; };
Sconst: SCONST { $$ = $1; };
UserId:
IDENT
{ $$ = $1; };
UserId:
ColId
{ $$ = $1; };
/* Column identifier
/* Column identifier
* Include date/time keywords as SQL92 extension.
* Include date/time keywords as SQL92 extension.
...
...
src/include/nodes/parsenodes.h
View file @
e40492ec
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: parsenodes.h,v 1.1
09 2000/07/14 15:43:51 thomas
Exp $
* $Id: parsenodes.h,v 1.1
10 2000/07/15 00:01:38 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -467,13 +467,12 @@ typedef struct IndexStmt
...
@@ -467,13 +467,12 @@ typedef struct IndexStmt
NodeTag
type
;
NodeTag
type
;
char
*
idxname
;
/* name of the index */
char
*
idxname
;
/* name of the index */
char
*
relname
;
/* name of relation to index on */
char
*
relname
;
/* name of relation to index on */
char
*
accessMethod
;
/* name of ac
ess metho
od (eg. btree) */
char
*
accessMethod
;
/* name of ac
cess meth
od (eg. btree) */
List
*
indexParams
;
/* a list of IndexElem */
List
*
indexParams
;
/* a list of IndexElem */
List
*
withClause
;
/* a list of DefElem */
List
*
withClause
;
/* a list of DefElem */
Node
*
whereClause
;
/* qualification
s
*/
Node
*
whereClause
;
/* qualification
(partial-index predicate)
*/
List
*
rangetable
;
/* range table, filled in by
List
*
rangetable
;
/* range table
for qual
, filled in by
* transformStmt() */
* transformStmt() */
bool
*
lossy
;
/* is index lossy? */
bool
unique
;
/* is index unique? */
bool
unique
;
/* is index unique? */
bool
primary
;
/* is index on primary key? */
bool
primary
;
/* is index on primary key? */
}
IndexStmt
;
}
IndexStmt
;
...
@@ -1088,14 +1087,18 @@ typedef struct RangeVar
...
@@ -1088,14 +1087,18 @@ typedef struct RangeVar
/*
/*
* IndexElem - index parameters (used in CREATE INDEX)
* IndexElem - index parameters (used in CREATE INDEX)
*
* For a plain index, each 'name' is an attribute name in the heap relation,
* and 'args' is NIL. For a functional index, only one IndexElem is allowed.
* It has name = name of function and args = list of attribute names that
* are the function's arguments.
*/
*/
typedef
struct
IndexElem
typedef
struct
IndexElem
{
{
NodeTag
type
;
NodeTag
type
;
char
*
name
;
/* name of index */
char
*
name
;
/* name of attribute to index, or function */
List
*
args
;
/* if not NULL, function index */
List
*
args
;
/* list of names of function arguments */
char
*
class
;
char
*
class
;
/* name of desired opclass; NULL = default */
TypeName
*
typename
;
/* type of index's keys (optional) */
}
IndexElem
;
}
IndexElem
;
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment