Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
759fba48
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
759fba48
编写于
1月 16, 2000
作者:
P
Peter Eisentraut
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Included all yacc and lex files into the distribution.
上级
a4e1304e
变更
19
展开全部
隐藏空白更改
内联
并排
Showing
19 changed file
with
823 addition
and
555 deletion
+823
-555
doc/src/sgml/install.sgml
doc/src/sgml/install.sgml
+0
-61
src/GNUmakefile.in
src/GNUmakefile.in
+1
-16
src/backend/bootstrap/Makefile
src/backend/bootstrap/Makefile
+2
-2
src/backend/catalog/aclchk.c
src/backend/catalog/aclchk.c
+3
-3
src/backend/catalog/catalog.c
src/backend/catalog/catalog.c
+4
-4
src/backend/commands/command.c
src/backend/commands/command.c
+238
-18
src/backend/parser/gram.y
src/backend/parser/gram.y
+71
-34
src/backend/tcop/utility.c
src/backend/tcop/utility.c
+39
-19
src/bin/psql/mainloop.c
src/bin/psql/mainloop.c
+3
-2
src/configure
src/configure
+377
-363
src/configure.in
src/configure.in
+14
-0
src/include/catalog/catalog.h
src/include/catalog/catalog.h
+4
-4
src/include/commands/command.h
src/include/commands/command.h
+22
-5
src/include/nodes/nodes.h
src/include/nodes/nodes.h
+2
-2
src/include/nodes/parsenodes.h
src/include/nodes/parsenodes.h
+11
-7
src/include/utils/acl.h
src/include/utils/acl.h
+2
-2
src/pl/plpgsql/src/Makefile.in
src/pl/plpgsql/src/Makefile.in
+2
-2
src/test/regress/run_check.sh
src/test/regress/run_check.sh
+13
-1
src/tools/release_prep
src/tools/release_prep
+15
-10
未找到文件。
doc/src/sgml/install.sgml
浏览文件 @
759fba48
...
...
@@ -176,67 +176,6 @@ Ftp file
</Para>
</Step>
<Step Performance="required">
<Para>
Some platforms use <application>flex</application>.
If your system uses <application>flex</application> then make sure
you have a good version. To check, type
<programlisting>
$ flex --version
</programlisting>
</Para>
<Para>
If the <application>flex</application> command is not found then you probably do not need it.
If the version is 2.5.2 or 2.5.4 or greater then you are okay. If it
is 2.5.3 or before 2.5.2 then you will have to upgrade <application>flex</application>. You may
get it at
<ulink url="ftp://prep.ai.mit.edu/pub/gnu/flex-2.5.4.tar.gz">ftp://prep.ai.mit.edu/pub/gnu/flex-2.5.4.tar.gz</ulink>.
</Para>
<Para>
If you need <application>flex</application> and don't have it or have the wrong version, then
you will be told so when you attempt to compile the program. Feel
free to skip this step if you aren't sure you need it. If you do
need it then you will be told to install/upgrade <application>flex</application> when you try to
compile <productname>Postgres</productname>.
</Para>
<Para>
You may want to do the entire <application>flex</application> installation from
the root account, though that is not absolutely necessary.
Assuming that you want the installation to place files in the usual default
areas, type the following:
<ProgramListing>
$ su -
$ cd /usr/local/src
ftp prep.ai.mit.edu
ftp> cd /pub/gnu/
ftp> binary
ftp> get flex-2.5.4.tar.gz
ftp> quit
$ gunzip -c flex-2.5.4.tar.gz | tar xvf -
$ cd flex-2.5.4
$ configure --prefix=/usr
$ gmake
$ gmake check
# You must be root when typing the next line:
$ gmake install
$ cd /usr/local/src
$ rm -rf flex-2.5.4
</ProgramListing>
</Para>
<Para>
This will update files <filename>/usr/man/man1/flex.1</filename>,
<filename>/usr/bin/flex</filename>,
<filename>/usr/lib/libfl.a</filename>,
<filename>/usr/include/FlexLexer.h</filename> and will add a link
<filename>/usr/bin/flex++</filename> which points to flex.
</Para>
</Step>
<Step Performance="required">
<Para>
If you are not upgrading an existing system then skip to
...
...
src/GNUmakefile.in
浏览文件 @
759fba48
...
...
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.4
7 2000/01/09 07:53:52 tgl
Exp $
# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.4
8 2000/01/16 20:04:51 petere
Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -24,7 +24,6 @@ ETAGS = @etags@
XARGS = @xargs@
all:
$(MAKE) lexverify
$(MAKE) -C utils all
$(MAKE) -C backend all
$(MAKE) -C interfaces all
...
...
@@ -35,7 +34,6 @@ all:
fi
install:
$(MAKE) lexverify
$(MAKE) -C utils install
$(MAKE) -C backend install
$(MAKE) -C interfaces install
...
...
@@ -43,19 +41,7 @@ install:
$(MAKE) -C pl install
cat ../register.txt
lexverify:
$(MAKE) -C lextest all
@if test ! -f lextest/lextest; then \
echo "";\
echo "You have a buggy version of flex. Read INSTALL and search for flex for a fix.";\
echo "";\
false;\
else \
true;\
fi
clean:
$(MAKE) -C lextest clean
$(MAKE) -C utils clean
$(MAKE) -C backend clean
$(MAKE) -C interfaces clean
...
...
@@ -108,7 +94,6 @@ distclean: clean
test/regress/GNUmakefile
.DEFAULT:
$(MAKE) -C lextest $@
$(MAKE) -C utils $@
$(MAKE) -C backend $@
$(MAKE) -C interfaces $@
...
...
src/backend/bootstrap/Makefile
浏览文件 @
759fba48
...
...
@@ -4,7 +4,7 @@
# Makefile for the bootstrap module
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.
19 1999/12/16 16:52:46 momjian
Exp $
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.
20 2000/01/16 20:04:53 petere
Exp $
#
#
# We must build bootparse.c and bootscanner.c with yacc and lex and sed,
...
...
@@ -68,7 +68,7 @@ bootscanner.c: bootscanner.l
rm
-f
lex.yy.c sedfile
clean
:
rm
-f
SUBSYS.o
$(OBJS)
bootparse.c bootstrap_tokens.h bootscanner.c
rm
-f
SUBSYS.o
$(OBJS)
# And the garbage that might have been left behind by partial build:
rm
-f
y.tab.h
y.tab.c
y.output
lex.yy.c
...
...
src/backend/catalog/aclchk.c
浏览文件 @
759fba48
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.3
4 2000/01/15 02:59:28
petere Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.3
5 2000/01/16 20:04:54
petere Exp $
*
* NOTES
* See acl.h.
...
...
@@ -444,8 +444,8 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
}
int32
pg_ownercheck
(
char
*
usename
,
char
*
value
,
pg_ownercheck
(
c
onst
c
har
*
usename
,
c
onst
c
har
*
value
,
int
cacheid
)
{
HeapTuple
tuple
;
...
...
src/backend/catalog/catalog.c
浏览文件 @
759fba48
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.2
7 2000/01/15 02:59:28
petere Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.2
8 2000/01/16 20:04:54
petere Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -26,7 +26,7 @@
* Perhaps this should be in-line code in relopen().
*/
char
*
relpath
(
char
*
relname
)
relpath
(
c
onst
c
har
*
relname
)
{
char
*
path
;
size_t
bufsize
=
0
;
...
...
@@ -52,7 +52,7 @@ relpath(char *relname)
* XXX this is way bogus. -- pma
*/
bool
IsSystemRelationName
(
char
*
relname
)
IsSystemRelationName
(
c
onst
c
har
*
relname
)
{
if
(
relname
[
0
]
&&
relname
[
1
]
&&
relname
[
2
])
return
(
relname
[
0
]
==
'p'
&&
...
...
@@ -67,7 +67,7 @@ IsSystemRelationName(char *relname)
* True iff name is the name of a shared system catalog relation.
*/
bool
IsSharedSystemRelationName
(
char
*
relname
)
IsSharedSystemRelationName
(
c
onst
c
har
*
relname
)
{
int
i
;
...
...
src/backend/commands/command.c
浏览文件 @
759fba48
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.6
2 1999/12/20 10:40:41 wieck
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.6
3 2000/01/16 20:04:55 petere
Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
...
...
@@ -23,13 +23,16 @@
#include "postgres.h"
#include "access/heapam.h"
#include "access/skey.h"
#include "catalog/catalog.h"
#include "catalog/catname.h"
#include "catalog/indexing.h"
#include "catalog/pg_attrdef.h"
#include "catalog/pg_type.h"
#include "commands/command.h"
#include "executor/execdefs.h"
#include "executor/executor.h"
#include "catalog/heap.h"
#include "miscadmin.h"
#include "optimizer/prep.h"
#include "utils/acl.h"
...
...
@@ -37,6 +40,7 @@
#include "utils/syscache.h"
#include "utils/temprel.h"
/* ----------------
* PortalExecutorHeapMemory stuff
*
...
...
@@ -246,7 +250,8 @@ PerformPortalClose(char *name, CommandDest dest)
}
/* ----------------
* PerformAddAttribute
* AlterTableAddColumn
* (formerly known as PerformAddAttribute)
*
* adds an additional attribute to a relation
*
...
...
@@ -276,8 +281,7 @@ PerformPortalClose(char *name, CommandDest dest)
* ----------------
*/
void
PerformAddAttribute
(
char
*
relationName
,
char
*
userName
,
AlterTableAddColumn
(
const
char
*
relationName
,
bool
inherits
,
ColumnDef
*
colDef
)
{
...
...
@@ -295,6 +299,7 @@ PerformAddAttribute(char *relationName,
Relation
idescs
[
Num_pg_attr_indices
];
Relation
ridescs
[
Num_pg_class_indices
];
bool
hasindex
;
List
*
rawDefaults
=
NIL
;
/*
* permissions checking. this would normally be done in utility.c,
...
...
@@ -303,19 +308,18 @@ PerformAddAttribute(char *relationName,
* normally, only the owner of a class can change its schema.
*/
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
relationName
))
elog
(
ERROR
,
"
PerformAddAttribute: class
\"
%s
\"
is a system catalog"
,
elog
(
ERROR
,
"
ALTER TABLE: relation
\"
%s
\"
is a system catalog"
,
relationName
);
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
userName
,
relationName
,
RELNAME
))
elog
(
ERROR
,
"PerformAddAttribute: you do not own class
\"
%s
\"
"
,
relationName
);
if
(
!
pg_ownercheck
(
UserName
,
relationName
,
RELNAME
))
elog
(
ERROR
,
"ALTER TABLE: permission denied"
);
#endif
/*
* Grab an exclusive lock on the target table, which we will NOT release
* until end of transaction.
*/
rel
=
heap_openr
(
relationName
,
AccessExclusiveLock
);
rel
=
heap_openr
(
(
char
*
)
relationName
,
AccessExclusiveLock
);
myrelid
=
RelationGetRelid
(
rel
);
heap_close
(
rel
,
NoLock
);
/* close rel but keep lock! */
...
...
@@ -324,8 +328,10 @@ PerformAddAttribute(char *relationName,
*/
if
(
colDef
->
is_not_null
)
elog
(
ERROR
,
"Can't add a NOT NULL attribute to an existing relation"
);
if
(
colDef
->
raw_default
||
colDef
->
cooked_default
)
elog
(
ERROR
,
"ADD ATTRIBUTE: DEFAULT not yet implemented"
);
elog
(
ERROR
,
"Adding columns with defaults is not implemented."
);
/*
* if the first element in the 'schema' list is a "*" then we are
...
...
@@ -358,8 +364,8 @@ PerformAddAttribute(char *relationName,
if
(
childrelid
==
myrelid
)
continue
;
rel
=
heap_open
(
childrelid
,
AccessExclusiveLock
);
PerformAddAttribute
(
RelationGetRelationName
(
rel
),
userName
,
false
,
colDef
);
AlterTableAddColumn
(
RelationGetRelationName
(
rel
),
false
,
colDef
);
heap_close
(
rel
,
AccessExclusiveLock
);
}
}
...
...
@@ -372,7 +378,7 @@ PerformAddAttribute(char *relationName,
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
reltup
))
elog
(
ERROR
,
"
PerformAddAttribute
: relation
\"
%s
\"
not found"
,
elog
(
ERROR
,
"
ALTER TABLE
: relation
\"
%s
\"
not found"
,
relationName
);
/*
...
...
@@ -380,14 +386,14 @@ PerformAddAttribute(char *relationName,
*/
if
(((
Form_pg_class
)
GETSTRUCT
(
reltup
))
->
relkind
==
RELKIND_INDEX
)
{
elog
(
ERROR
,
"
PerformAddAttribute
: index relation
\"
%s
\"
not changed"
,
elog
(
ERROR
,
"
ALTER TABLE
: index relation
\"
%s
\"
not changed"
,
relationName
);
}
minattnum
=
((
Form_pg_class
)
GETSTRUCT
(
reltup
))
->
relnatts
;
maxatts
=
minattnum
+
1
;
if
(
maxatts
>
MaxHeapAttributeNumber
)
elog
(
ERROR
,
"
PerformAddAttribute: relations limited to %d attribute
s"
,
elog
(
ERROR
,
"
ALTER TABLE: relations limited to %d column
s"
,
MaxHeapAttributeNumber
);
attrdesc
=
heap_openr
(
AttributeRelationName
,
RowExclusiveLock
);
...
...
@@ -421,7 +427,7 @@ PerformAddAttribute(char *relationName,
0
,
0
);
if
(
HeapTupleIsValid
(
tup
))
elog
(
ERROR
,
"
PerformAddAttribute: attribute
\"
%s
\"
already exists in class
\"
%s
\"
"
,
elog
(
ERROR
,
"
ALTER TABLE: column name
\"
%s
\"
already exists in relation
\"
%s
\"
"
,
colDef
->
colname
,
relationName
);
/*
...
...
@@ -444,7 +450,7 @@ PerformAddAttribute(char *relationName,
tform
=
(
Form_pg_type
)
GETSTRUCT
(
typeTuple
);
if
(
!
HeapTupleIsValid
(
typeTuple
))
elog
(
ERROR
,
"A
dd: type
\"
%s
\"
nonexisten
t"
,
typename
);
elog
(
ERROR
,
"A
LTER TABLE: type
\"
%s
\"
does not exis
t"
,
typename
);
namestrcpy
(
&
(
attribute
->
attname
),
colDef
->
colname
);
attribute
->
atttypid
=
typeTuple
->
t_data
->
t_oid
;
attribute
->
attlen
=
tform
->
typlen
;
...
...
@@ -483,9 +489,223 @@ PerformAddAttribute(char *relationName,
CatalogCloseIndices
(
Num_pg_class_indices
,
ridescs
);
heap_freetuple
(
reltup
);
heap_close
(
rel
,
RowExclusiveLock
);
heap_close
(
rel
,
NoLock
);
}
static
void
drop_default
(
Oid
relid
,
int16
attnum
);
/*
* ALTER TABLE ALTER COLUMN SET/DROP DEFAULT
*/
void
AlterTableAlterColumn
(
const
char
*
relationName
,
bool
inh
,
const
char
*
colName
,
Node
*
newDefault
)
{
Relation
rel
;
HeapTuple
tuple
;
int16
attnum
;
Oid
myrelid
;
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
relationName
))
elog
(
ERROR
,
"ALTER TABLE: relation
\"
%s
\"
is a system catalog"
,
relationName
);
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
UserName
,
relationName
,
RELNAME
))
elog
(
ERROR
,
"ALTER TABLE: permission denied"
);
#endif
/* XXX should heap_openr take const char * ? */
rel
=
heap_openr
((
char
*
)
relationName
,
AccessExclusiveLock
);
myrelid
=
RelationGetRelid
(
rel
);
heap_close
(
rel
,
NoLock
);
/*
* Propagate to children if desired
*/
if
(
inh
)
{
List
*
child
,
*
children
;
/* this routine is actually in the planner */
children
=
find_all_inheritors
(
myrelid
);
/*
* find_all_inheritors does the recursive search of the
* inheritance hierarchy, so all we have to do is process all
* of the relids in the list that it returns.
*/
foreach
(
child
,
children
)
{
Oid
childrelid
=
lfirsti
(
child
);
if
(
childrelid
==
myrelid
)
continue
;
rel
=
heap_open
(
childrelid
,
AccessExclusiveLock
);
AlterTableAlterColumn
(
RelationGetRelationName
(
rel
),
false
,
colName
,
newDefault
);
heap_close
(
rel
,
AccessExclusiveLock
);
}
}
/* -= now do the thing on this relation =- */
/* reopen the business */
rel
=
heap_openr
((
char
*
)
relationName
,
AccessExclusiveLock
);
/*
* get the number of the attribute
*/
tuple
=
SearchSysCacheTuple
(
ATTNAME
,
ObjectIdGetDatum
(
myrelid
),
NameGetDatum
(
namein
((
char
*
)
colName
)),
0
,
0
);
if
(
!
HeapTupleIsValid
(
tuple
))
{
heap_close
(
rel
,
AccessExclusiveLock
);
elog
(
ERROR
,
"ALTER TABLE: relation
\"
%s
\"
has no column
\"
%s
\"
"
,
relationName
,
colName
);
}
attnum
=
((
Form_pg_attribute
)
GETSTRUCT
(
tuple
))
->
attnum
;
if
(
newDefault
)
/* SET DEFAULT */
{
List
*
rawDefaults
=
NIL
;
RawColumnDefault
*
rawEnt
;
/* Get rid of the old one first */
drop_default
(
myrelid
,
attnum
);
rawEnt
=
(
RawColumnDefault
*
)
palloc
(
sizeof
(
RawColumnDefault
));
rawEnt
->
attnum
=
attnum
;
rawEnt
->
raw_default
=
newDefault
;
rawDefaults
=
lappend
(
rawDefaults
,
rawEnt
);
/*
* This function is intended for CREATE TABLE,
* so it processes a _list_ of defaults, but we just do one.
*/
AddRelationRawConstraints
(
rel
,
rawDefaults
,
NIL
);
}
else
/* DROP DEFAULT */
{
Relation
attr_rel
;
ScanKeyData
scankeys
[
3
];
HeapScanDesc
scan
;
HeapTuple
tuple
;
attr_rel
=
heap_openr
(
AttributeRelationName
,
AccessExclusiveLock
);
ScanKeyEntryInitialize
(
&
scankeys
[
0
],
0x0
,
Anum_pg_attribute_attrelid
,
F_OIDEQ
,
ObjectIdGetDatum
(
myrelid
));
ScanKeyEntryInitialize
(
&
scankeys
[
1
],
0x0
,
Anum_pg_attribute_attnum
,
F_INT2EQ
,
Int16GetDatum
(
attnum
));
ScanKeyEntryInitialize
(
&
scankeys
[
2
],
0x0
,
Anum_pg_attribute_atthasdef
,
F_BOOLEQ
,
TRUE
);
scan
=
heap_beginscan
(
attr_rel
,
false
,
SnapshotNow
,
3
,
scankeys
);
AssertState
(
scan
!=
NULL
);
if
(
HeapTupleIsValid
(
tuple
=
heap_getnext
(
scan
,
0
)))
{
HeapTuple
newtuple
;
Relation
irelations
[
Num_pg_attr_indices
];
/* update to false */
newtuple
=
heap_copytuple
(
tuple
);
((
Form_pg_attribute
)
GETSTRUCT
(
newtuple
))
->
atthasdef
=
FALSE
;
heap_update
(
attr_rel
,
&
tuple
->
t_self
,
newtuple
,
NULL
);
/* keep the system catalog indices current */
CatalogOpenIndices
(
Num_pg_attr_indices
,
Name_pg_attr_indices
,
irelations
);
CatalogIndexInsert
(
irelations
,
Num_pg_attr_indices
,
attr_rel
,
newtuple
);
CatalogCloseIndices
(
Num_pg_class_indices
,
irelations
);
/* get rid of actual default definition */
drop_default
(
myrelid
,
attnum
);
}
else
elog
(
NOTICE
,
"ALTER TABLE: there was no default on column
\"
%s
\"
of relation
\"
%s
\"
"
,
colName
,
relationName
);
heap_endscan
(
scan
);
heap_close
(
attr_rel
,
NoLock
);
}
heap_close
(
rel
,
NoLock
);
}
static
void
drop_default
(
Oid
relid
,
int16
attnum
)
{
ScanKeyData
scankeys
[
2
];
HeapScanDesc
scan
;
Relation
attrdef_rel
;
HeapTuple
tuple
;
attrdef_rel
=
heap_openr
(
AttrDefaultRelationName
,
AccessExclusiveLock
);
ScanKeyEntryInitialize
(
&
scankeys
[
0
],
0x0
,
Anum_pg_attrdef_adrelid
,
F_OIDEQ
,
ObjectIdGetDatum
(
relid
));
ScanKeyEntryInitialize
(
&
scankeys
[
1
],
0x0
,
Anum_pg_attrdef_adnum
,
F_INT2EQ
,
Int16GetDatum
(
attnum
));
scan
=
heap_beginscan
(
attrdef_rel
,
false
,
SnapshotNow
,
2
,
scankeys
);
AssertState
(
scan
!=
NULL
);
if
(
HeapTupleIsValid
(
tuple
=
heap_getnext
(
scan
,
0
)))
heap_delete
(
attrdef_rel
,
&
tuple
->
t_self
,
NULL
);
heap_endscan
(
scan
);
heap_close
(
attrdef_rel
,
NoLock
);
}
/*
* ALTER TABLE DROP COLUMN
*/
void
AlterTableDropColumn
(
const
char
*
relationName
,
bool
inh
,
const
char
*
colName
,
int
behavior
)
{
elog
(
NOTICE
,
"ALTER TABLE / DROP COLUMN is not implemented"
);
}
void
AlterTableAddConstraint
(
const
char
*
relationName
,
bool
inh
,
Node
*
newConstraint
)
{
elog
(
NOTICE
,
"ALTER TABLE / ADD CONSTRAINT is not implemented"
);
}
void
AlterTableDropConstraint
(
const
char
*
relationName
,
bool
inh
,
const
char
*
constrName
,
int
behavior
)
{
elog
(
NOTICE
,
"ALTER TABLE / DROP CONSTRAINT is not implemented"
);
}
/*
*
* LOCK TABLE
*
*/
void
LockTableCommand
(
LockStmt
*
lockstmt
)
{
...
...
src/backend/parser/gram.y
浏览文件 @
759fba48
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.12
6 2000/01/15 02:59:32
petere Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.12
7 2000/01/16 20:04:55
petere Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -114,7 +114,7 @@ static Node *doNegate(Node *n);
}
%type <node> stmt,
A
ddAttr
Stmt, ClosePortalStmt,
A
lterTable
Stmt, ClosePortalStmt,
CopyStmt, CreateStmt, CreateAsStmt, CreateSeqStmt, DefineStmt, DropStmt,
TruncateStmt, CommentStmt,
ExtendStmt, FetchStmt, GrantStmt, CreateTrigStmt, DropTrigStmt,
...
...
@@ -130,6 +130,9 @@ static Node *doNegate(Node *n);
RuleActionStmtOrEmpty, ConstraintsSetStmt,
CreateGroupStmt, AlterGroupStmt, DropGroupStmt
%type <node> alter_column_action
%type <ival> drop_behavior
%type <str> createdb_opt_location
%type <ival> createdb_opt_encoding
...
...
@@ -210,7 +213,7 @@ static Node *doNegate(Node *n);
%type <astmt> insert_rest
%type <node> OptTableElement, ConstraintElem
%type <node> columnDef
, alter_clause
%type <node> columnDef
%type <defelt> def_elem
%type <node> def_arg, columnElem, where_clause,
a_expr, a_expr_or_null, b_expr, com_expr, AexprConst,
...
...
@@ -391,7 +394,7 @@ stmtmulti: stmtmulti ';' stmt
}
;
stmt :
AddAttr
Stmt
stmt :
AlterTable
Stmt
| AlterGroupStmt
| AlterUserStmt
| ClosePortalStmt
...
...
@@ -797,40 +800,74 @@ constraints_set_mode: DEFERRED
/*****************************************************************************
*
* QUERY :
* addattr ( attr1 = type1 .. attrn = typen ) to <relname> [*]
* ALTER TABLE variations
*
*****************************************************************************/
AddAttrStmt: ALTER TABLE relation_name opt_inh_star alter_clause
{
AddAttrStmt *n = makeNode(AddAttrStmt);
n->relname = $3;
n->inh = $4;
n->colDef = $5;
$$ = (Node *)n;
}
;
AlterTableStmt:
/* ALTER TABLE <name> ADD [COLUMN] <coldef> */
ALTER TABLE relation_name opt_inh_star ADD opt_column columnDef
{
AlterTableStmt *n = makeNode(AlterTableStmt);
n->subtype = 'A';
n->relname = $3;
n->inh = $4;
n->def = $7;
$$ = (Node *)n;
}
/* ALTER TABLE <name> ALTER [COLUMN] <colname> {SET DEFAULT <expr>|DROP DEFAULT} */
| ALTER TABLE relation_name opt_inh_star ALTER opt_column ColId alter_column_action
{
AlterTableStmt *n = makeNode(AlterTableStmt);
n->subtype = 'T';
n->relname = $3;
n->inh = $4;
n->name = $7;
n->def = $8;
$$ = (Node *)n;
}
/* ALTER TABLE <name> DROP [COLUMN] <name> {RESTRICT|CASCADE} */
| ALTER TABLE relation_name opt_inh_star DROP opt_column ColId drop_behavior
{
AlterTableStmt *n = makeNode(AlterTableStmt);
n->subtype = 'D';
n->relname = $3;
n->inh = $4;
n->name = $7;
n->behavior = $8;
$$ = (Node *)n;
}
/* ALTER TABLE <name> ADD CONSTRAINT ... */
| ALTER TABLE relation_name opt_inh_star ADD TableConstraint
{
AlterTableStmt *n = makeNode(AlterTableStmt);
n->subtype = 'A';
n->relname = $3;
n->inh = $4;
n->def = $6;
$$ = (Node *)n;
}
/* ALTER TABLE <name> DROP CONSTRAINT <name> {RESTRICT|CASCADE} */
| ALTER TABLE relation_name opt_inh_star DROP CONSTRAINT name drop_behavior
{
AlterTableStmt *n = makeNode(AlterTableStmt);
n->relname = $3;
n->inh = $4;
n->name = $7;
n->behavior = $8;
$$ = (Node *)n;
}
;
alter_column_action:
SET DEFAULT a_expr_or_null { $$ = $3; }
| DROP DEFAULT { $$ = NULL; }
;
drop_behavior: CASCADE { $$ = CASCADE; }
| RESTRICT { $$ = RESTRICT; }
;
alter_clause: ADD opt_column columnDef
{
$$ = $3;
}
| ADD '(' OptTableElementList ')'
{
if (length($3) != 1)
elog(ERROR,"ALTER TABLE/ADD() allows one column only");
$$ = (Node *) lfirst($3);
}
| DROP opt_column ColId
{ elog(ERROR,"ALTER TABLE/DROP COLUMN not yet implemented"); }
| ALTER opt_column ColId SET DEFAULT a_expr
{ elog(ERROR,"ALTER TABLE/ALTER COLUMN/SET DEFAULT not yet implemented"); }
| ALTER opt_column ColId DROP DEFAULT
{ elog(ERROR,"ALTER TABLE/ALTER COLUMN/DROP DEFAULT not yet implemented"); }
| ADD ConstraintElem
{ elog(ERROR,"ALTER TABLE/ADD CONSTRAINT not yet implemented"); }
;
/*****************************************************************************
...
...
src/backend/tcop/utility.c
浏览文件 @
759fba48
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.
79 2000/01/15 18:30:30
petere Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.
80 2000/01/16 20:04:56
petere Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -270,24 +270,6 @@ ProcessUtility(Node *parsetree,
}
break
;
case
T_AddAttrStmt
:
{
AddAttrStmt
*
stmt
=
(
AddAttrStmt
*
)
parsetree
;
PS_SET_STATUS
(
commandTag
=
"ADD"
);
CHECK_IF_ABORTED
();
/*
* owner checking done in PerformAddAttribute (now
* recursive)
*/
PerformAddAttribute
(
stmt
->
relname
,
userName
,
stmt
->
inh
,
(
ColumnDef
*
)
stmt
->
colDef
);
}
break
;
/*
* schema
*/
...
...
@@ -346,6 +328,44 @@ ProcessUtility(Node *parsetree,
}
break
;
/* various Alter Table forms */
case
T_AlterTableStmt
:
{
AlterTableStmt
*
stmt
=
(
AlterTableStmt
*
)
parsetree
;
PS_SET_STATUS
(
commandTag
=
"ALTER TABLE"
);
CHECK_IF_ABORTED
();
/*
* Some or all of these functions are recursive to cover inherited things,
* so permission checks are done there.
*/
switch
(
stmt
->
subtype
)
{
case
'A'
:
/* ADD COLUMN */
AlterTableAddColumn
(
stmt
->
relname
,
stmt
->
inh
,
(
ColumnDef
*
)
stmt
->
def
);
break
;
case
'T'
:
/* ALTER COLUMN */
AlterTableAlterColumn
(
stmt
->
relname
,
stmt
->
inh
,
stmt
->
name
,
stmt
->
def
);
break
;
case
'D'
:
/* ALTER DROP */
AlterTableDropColumn
(
stmt
->
relname
,
stmt
->
inh
,
stmt
->
name
,
stmt
->
behavior
);
break
;
case
'C'
:
/* ADD CONSTRAINT */
AlterTableAddConstraint
(
stmt
->
relname
,
stmt
->
inh
,
stmt
->
def
);
break
;
case
'X'
:
/* DROP CONSTRAINT */
AlterTableDropConstraint
(
stmt
->
relname
,
stmt
->
inh
,
stmt
->
name
,
stmt
->
behavior
);
break
;
default:
/* oops */
elog
(
ERROR
,
"T_AlterTableStmt: unknown subtype"
);
break
;
}
}
break
;
case
T_ChangeACLStmt
:
{
ChangeACLStmt
*
stmt
=
(
ChangeACLStmt
*
)
parsetree
;
...
...
src/bin/psql/mainloop.c
浏览文件 @
759fba48
...
...
@@ -268,8 +268,9 @@ MainLoop(FILE *source, int encoding)
/* colon -> substitute variable */
/* we need to be on the watch for the '::' operator */
else
if
(
line
[
i
]
==
':'
&&
!
was_bslash
&&
strspn
(
line
+
i
+
thislen
,
VALID_VARIABLE_CHARS
)
>
0
else
if
(
line
[
i
]
==
':'
&&
!
was_bslash
&&
strspn
(
line
+
i
+
thislen
,
VALID_VARIABLE_CHARS
)
>
0
&&
!
(
prevlen
>
0
&&
line
[
i
-
prevlen
]
==
':'
)
)
{
size_t
in_length
,
...
...
src/configure
浏览文件 @
759fba48
此差异已折叠。
点击以展开。
src/configure.in
浏览文件 @
759fba48
...
...
@@ -545,6 +545,20 @@ AC_SUBST(DASH_N)
AC_SUBST(BACKSLASH_C)
AC_PROG_LEX
if test "$LEX" = "flex"; then
$LEX --version 2> /dev/null | grep -s '2\.5\.3' >& /dev/null
if test $? -eq 0 ; then
AC_MSG_WARN([
***
You have flex version 2.5.3, which is broken. Get version 2.5.4 or
a different lex.
(If you are using the official distribution of PostgreSQL then you
do not need to worry about this because the lexer files are
pre-generated. However, other software using flex is likely to be
broken as well.)
***])
fi
fi
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
...
...
src/include/catalog/catalog.h
浏览文件 @
759fba48
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: catalog.h,v 1.
8 1999/07/15 23:03:41 momjian
Exp $
* $Id: catalog.h,v 1.
9 2000/01/16 20:04:57 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -15,9 +15,9 @@
#include "access/tupdesc.h"
extern
char
*
relpath
(
char
*
relname
);
extern
bool
IsSystemRelationName
(
char
*
relname
);
extern
bool
IsSharedSystemRelationName
(
char
*
relname
);
extern
char
*
relpath
(
c
onst
c
har
*
relname
);
extern
bool
IsSystemRelationName
(
c
onst
c
har
*
relname
);
extern
bool
IsSharedSystemRelationName
(
c
onst
c
har
*
relname
);
extern
Oid
newoid
(
void
);
extern
void
fillatt
(
TupleDesc
att
);
...
...
src/include/commands/command.h
浏览文件 @
759fba48
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: command.h,v 1.1
5 1999/07/15 23:03:44 momjian
Exp $
* $Id: command.h,v 1.1
6 2000/01/16 20:04:58 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -38,12 +38,29 @@ extern void PerformPortalClose(char *name, CommandDest dest);
extern
void
PortalCleanup
(
Portal
portal
);
/*
* PerformAddAttribute
* Performs the POSTQUEL function ADD.
* ALTER TABLE variants
*/
extern
void
PerformAddAttribute
(
char
*
relationName
,
char
*
user
Name
,
bool
inh
,
ColumnDef
*
colDef
);
extern
void
AlterTableAddColumn
(
const
char
*
relation
Name
,
bool
inh
,
ColumnDef
*
colDef
);
extern
void
AlterTableAlterColumn
(
const
char
*
relationName
,
bool
inh
,
const
char
*
colName
,
Node
*
newDefault
);
extern
void
AlterTableDropColumn
(
const
char
*
relationName
,
bool
inh
,
const
char
*
colName
,
int
behavior
);
extern
void
AlterTableAddConstraint
(
const
char
*
relationName
,
bool
inh
,
Node
*
newConstraint
);
extern
void
AlterTableDropConstraint
(
const
char
*
relationName
,
bool
inh
,
const
char
*
constrName
,
int
behavior
);
/*
* LOCK
*/
extern
void
LockTableCommand
(
LockStmt
*
lockstmt
);
#endif
/* COMMAND_H */
src/include/nodes/nodes.h
浏览文件 @
759fba48
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: nodes.h,v 1.6
0 2000/01/09 00:26:42 tgl
Exp $
* $Id: nodes.h,v 1.6
1 2000/01/16 20:04:58 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -145,7 +145,7 @@ typedef enum NodeTag
T_DeleteStmt
,
T_UpdateStmt
,
T_SelectStmt
,
T_AddAttr
Stmt
,
T_AlterTable
Stmt
,
T_AggregateStmt
,
T_ChangeACLStmt
,
T_ClosePortalStmt
,
...
...
src/include/nodes/parsenodes.h
浏览文件 @
759fba48
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.9
3 2000/01/14 22:11:3
8 petere Exp $
* $Id: parsenodes.h,v 1.9
4 2000/01/16 20:04:5
8 petere Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -84,16 +84,20 @@ typedef struct Query
*****************************************************************************/
/* ----------------------
*
Add Column Statement
*
Alter Table
* ----------------------
*/
typedef
struct
AddAttrStmt
/* The fields are used in different ways by the different variants of this command */
typedef
struct
AlterTableStmt
{
NodeTag
type
;
char
*
relname
;
/* the relation to add attr */
bool
inh
;
/* add recursively to children? */
Node
*
colDef
;
/* the attribute definition */
}
AddAttrStmt
;
char
subtype
;
/* A = add, T = alter, D = drop, C = add constr, X = drop constr */
char
*
relname
;
/* table to work on */
bool
inh
;
/* recursively on children? */
char
*
name
;
/* column or constraint name to act on */
Node
*
def
;
/* definition of new column or constraint */
int
behavior
;
/* CASCADE or RESTRICT drop behavior */
}
AlterTableStmt
;
/* ----------------------
* Change ACL Statement
...
...
src/include/utils/acl.h
浏览文件 @
759fba48
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: acl.h,v 1.2
2 1999/07/15 23:04:19 momjian
Exp $
* $Id: acl.h,v 1.2
3 2000/01/16 20:04:59 petere
Exp $
*
* NOTES
* For backward-compatability purposes we have to allow there
...
...
@@ -168,7 +168,7 @@ extern AclId get_grosysid(char *groname);
extern
char
*
get_groname
(
AclId
grosysid
);
extern
int32
pg_aclcheck
(
char
*
relname
,
char
*
usename
,
AclMode
mode
);
extern
int32
pg_ownercheck
(
c
har
*
usename
,
char
*
value
,
int
cacheid
);
extern
int32
pg_ownercheck
(
c
onst
char
*
usename
,
const
char
*
value
,
int
cacheid
);
extern
int32
pg_func_ownercheck
(
char
*
usename
,
char
*
funcname
,
int
nargs
,
Oid
*
arglist
);
extern
int32
pg_aggr_ownercheck
(
char
*
usename
,
char
*
aggname
,
...
...
src/pl/plpgsql/src/Makefile.in
浏览文件 @
759fba48
...
...
@@ -4,7 +4,7 @@
# Makefile for the plpgsql shared object
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.1
8 1999/10/13 11:38:40 momjian
Exp $
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.1
9 2000/01/16 20:04:59 petere
Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -79,6 +79,6 @@ pl_scan.c: scan.l
clean
:
clean-shlib
rm
-f
lib
$(NAME)
.a
rm
-f
*
.o
pl.tab.h pl_gram.c pl_scan.c
rm
-f
*
.o
# And the garbage that might have been left behind by partial build:
rm
-f
y.tab.c
y.tab.h
lex.yy.c
src/test/regress/run_check.sh
浏览文件 @
759fba48
#!/bin/sh
#
# $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.
6 2000/01/09 20:54:36 tgl
Exp $
# $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.
7 2000/01/16 20:05:00 petere
Exp $
# ----------
# Check call syntax
...
...
@@ -37,6 +37,16 @@ export LOGDIR
export
TIMDIR
export
PGPORT
# Needed by psql and pg_encoding (if you run multibyte).
# I hope this covers all platforms with shared libraries,
# otherwise feel free to cover your platform here as well.
if
[
"
$LD_LIBRARY_PATH
"
]
;
then
old_LD_LIBRARY_PATH
=
"
$LD_LIBRARY_PATH
"
LD_LIBRARY_PATH
=
"
$LIBDIR
:
$LD_LIBARY_PATH
"
else
LD_LIBRARY_PATH
=
"
$LIBDIR
"
fi
export
LD_LIBRARY_PATH
# ----------
# Get the commandline parameters
...
...
@@ -111,6 +121,7 @@ trap ' echo ""
echo ""
fi
echo ""
LD_LIBRARY_PATH="$old_LD_LIBRARY_PATH"
exit 1
'
2 15
...
...
@@ -434,5 +445,6 @@ done | tee run_check.out 2>&1
echo
"=============== Terminating regression postmaster ================"
kill
-15
$PMPID
LD_LIBRARY_PATH
=
"
$old_LD_LIBRARY_PATH
"
exit
0
src/tools/release_prep
浏览文件 @
759fba48
...
...
@@ -31,34 +31,39 @@ cd src
./configure
# Generate parser's
gram and lex files.
# Generate parser's
yacc and lex files
cd
backend/parser
rm
-f
gram.c parse.h scan.c
$MAKE
gram.c parse.h scan.c
cd
../..
# Generate bootstrap parser's yacc and lex files
cd
backend/bootstrap
rm
-f
bootstrap_tokens.h bootparse.c bootscanner.c
$MAKE
bootstrap_tokens.h bootparse.c bootscanner.c
cd
../..
# Generate ecpg preprocessor's
gram and lex files.
# Generate ecpg preprocessor's
yacc and lex files
cd
interfaces/ecpg/preproc
rm
-f
preproc.c preproc.h pgc.c
$MAKE
preproc.c preproc.h pgc.c
cd
../../..
# Generate plpgsql's yacc and lex files
cd
pl/plpgsql
rm
-rf
pl_scan.c pl.tab.h pl_gram.c
$MAKE
pl_scan.c pl.tab.h pl_gram.c
cd
../..
# Generate psql's help on SQL command from the SGML docs
cd
bin/psql
rm
-f
sql_help.h
$MAKE
sql_help.h
cd
../..
# Clean up
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录