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
34797d42
Commit
34797d42
authored
Jul 20, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup Name usage.
parent
7193719b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
69 deletions
+48
-69
src/backend/access/gist/gist.c
src/backend/access/gist/gist.c
+1
-1
src/backend/executor/execMain.c
src/backend/executor/execMain.c
+1
-11
src/backend/executor/execUtils.c
src/backend/executor/execUtils.c
+3
-5
src/backend/storage/smgr/md.c
src/backend/storage/smgr/md.c
+4
-4
src/backend/storage/smgr/smgr.c
src/backend/storage/smgr/smgr.c
+11
-17
src/backend/utils/cache/relcache.c
src/backend/utils/cache/relcache.c
+26
-27
src/backend/utils/misc/database.c
src/backend/utils/misc/database.c
+2
-4
No files found.
src/backend/access/gist/gist.c
View file @
34797d42
...
...
@@ -130,7 +130,7 @@ gistbuild(Relation heap,
*/
if
(
oldPred
==
NULL
&&
(
nb
=
RelationGetNumberOfBlocks
(
index
))
!=
0
)
elog
(
ERROR
,
"%
.16s already contains data"
,
&
(
index
->
rd_rel
->
relname
.
data
[
0
])
);
elog
(
ERROR
,
"%
s already contains data"
,
index
->
rd_rel
->
relname
.
data
);
/* initialize the root page (if this is a new index) */
if
(
oldPred
==
NULL
)
...
...
src/backend/executor/execMain.c
View file @
34797d42
...
...
@@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.
49 1998/07/19 03:46:29
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.
50 1998/07/20 16:14:13
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -606,16 +606,6 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
estate
->
es_into_relation_descriptor
=
intoRelationDesc
;
/* ----------------
* return the type information..
* ----------------
*/
/*
attinfo = (AttrInfo *)palloc(sizeof(AttrInfo));
attinfo->numAttr = len;
attinfo->attrs = tupType->attrs;
*/
return
tupType
;
}
...
...
src/backend/executor/execUtils.c
View file @
34797d42
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.3
2 1998/06/15 19:28:20
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.3
3 1998/07/20 16:14:13
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -309,8 +309,7 @@ ExecFreeResultType(CommonState *commonstate)
slot
=
commonstate
->
cs_ResultTupleSlot
;
tupType
=
slot
->
ttc_tupleDescriptor
;
/* ExecFreeTypeInfo(tupType); */
pfree
(
tupType
);
ExecFreeTypeInfo
(
tupType
);
}
#endif
...
...
@@ -407,8 +406,7 @@ ExecFreeScanType(CommonScanState *csstate)
slot
=
csstate
->
css_ScanTupleSlot
;
tupType
=
slot
->
ttc_tupleDescriptor
;
/* ExecFreeTypeInfo(tupType); */
pfree
(
tupType
);
ExecFreeTypeInfo
(
tupType
);
}
#endif
...
...
src/backend/storage/smgr/md.c
View file @
34797d42
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.3
1 1998/06/15 19:29:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.3
2 1998/07/20 16:14:14
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -139,7 +139,7 @@ mdcreate(Relation reln)
vfd
;
char
*
path
;
path
=
relpath
(
&
(
reln
->
rd_rel
->
relname
.
data
[
0
])
);
path
=
relpath
(
reln
->
rd_rel
->
relname
.
data
);
fd
=
FileNameOpenFile
(
path
,
O_RDWR
|
O_CREAT
|
O_EXCL
,
0600
);
/*
...
...
@@ -288,7 +288,7 @@ mdopen(Relation reln)
int
fd
;
int
vfd
;
path
=
relpath
(
&
(
reln
->
rd_rel
->
relname
.
data
[
0
])
);
path
=
relpath
(
reln
->
rd_rel
->
relname
.
data
);
fd
=
FileNameOpenFile
(
path
,
O_RDWR
,
0600
);
...
...
@@ -718,7 +718,7 @@ mdtruncate(Relation reln, int nblocks)
if
(
curnblk
/
RELSEG_SIZE
>
0
)
{
elog
(
NOTICE
,
"Can't truncate multi-segments relation %s"
,
&
(
reln
->
rd_rel
->
relname
.
data
[
0
])
);
reln
->
rd_rel
->
relname
.
data
);
return
(
curnblk
);
}
#endif
...
...
src/backend/storage/smgr/smgr.c
View file @
34797d42
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.1
7 1998/06/27 04:53:40
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.1
8 1998/07/20 16:14:15
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -132,8 +132,7 @@ smgrcreate(int16 which, Relation reln)
int
fd
;
if
((
fd
=
(
*
(
smgrsw
[
which
].
smgr_create
))
(
reln
))
<
0
)
elog
(
ERROR
,
"cannot create %s"
,
&
(
reln
->
rd_rel
->
relname
.
data
[
0
]));
elog
(
ERROR
,
"cannot create %s"
,
reln
->
rd_rel
->
relname
.
data
);
return
(
fd
);
}
...
...
@@ -149,8 +148,7 @@ smgrunlink(int16 which, Relation reln)
int
status
;
if
((
status
=
(
*
(
smgrsw
[
which
].
smgr_unlink
))
(
reln
))
==
SM_FAIL
)
elog
(
ERROR
,
"cannot unlink %s"
,
&
(
reln
->
rd_rel
->
relname
.
data
[
0
]));
elog
(
ERROR
,
"cannot unlink %s"
,
reln
->
rd_rel
->
relname
.
data
);
return
(
status
);
}
...
...
@@ -169,8 +167,7 @@ smgrextend(int16 which, Relation reln, char *buffer)
status
=
(
*
(
smgrsw
[
which
].
smgr_extend
))
(
reln
,
buffer
);
if
(
status
==
SM_FAIL
)
elog
(
ERROR
,
"%s: cannot extend"
,
&
(
reln
->
rd_rel
->
relname
.
data
[
0
]));
elog
(
ERROR
,
"%s: cannot extend"
,
reln
->
rd_rel
->
relname
.
data
);
return
(
status
);
}
...
...
@@ -187,8 +184,7 @@ smgropen(int16 which, Relation reln)
int
fd
;
if
((
fd
=
(
*
(
smgrsw
[
which
].
smgr_open
))
(
reln
))
<
0
)
elog
(
ERROR
,
"cannot open %s"
,
&
(
reln
->
rd_rel
->
relname
.
data
[
0
]));
elog
(
ERROR
,
"cannot open %s"
,
reln
->
rd_rel
->
relname
.
data
);
return
(
fd
);
}
...
...
@@ -209,8 +205,7 @@ int
smgrclose
(
int16
which
,
Relation
reln
)
{
if
((
*
(
smgrsw
[
which
].
smgr_close
))
(
reln
)
==
SM_FAIL
)
elog
(
ERROR
,
"cannot close %s"
,
&
(
reln
->
rd_rel
->
relname
.
data
[
0
]));
elog
(
ERROR
,
"cannot close %s"
,
reln
->
rd_rel
->
relname
.
data
);
return
(
SM_SUCCESS
);
}
...
...
@@ -234,7 +229,7 @@ smgrread(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
if
(
status
==
SM_FAIL
)
elog
(
ERROR
,
"cannot read block %d of %s"
,
blocknum
,
&
(
reln
->
rd_rel
->
relname
.
data
[
0
])
);
blocknum
,
reln
->
rd_rel
->
relname
.
data
);
return
(
status
);
}
...
...
@@ -256,7 +251,7 @@ smgrwrite(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
if
(
status
==
SM_FAIL
)
elog
(
ERROR
,
"cannot write block %d of %s"
,
blocknum
,
&
(
reln
->
rd_rel
->
relname
.
data
[
0
])
);
blocknum
,
reln
->
rd_rel
->
relname
.
data
);
return
(
status
);
}
...
...
@@ -273,7 +268,7 @@ smgrflush(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
if
(
status
==
SM_FAIL
)
elog
(
ERROR
,
"cannot flush block %d of %s to stable store"
,
blocknum
,
&
(
reln
->
rd_rel
->
relname
.
data
[
0
])
);
blocknum
,
reln
->
rd_rel
->
relname
.
data
);
return
(
status
);
}
...
...
@@ -332,8 +327,7 @@ smgrnblocks(int16 which, Relation reln)
int
nblocks
;
if
((
nblocks
=
(
*
(
smgrsw
[
which
].
smgr_nblocks
))
(
reln
))
<
0
)
elog
(
ERROR
,
"cannot count blocks for %s"
,
&
(
reln
->
rd_rel
->
relname
.
data
[
0
]));
elog
(
ERROR
,
"cannot count blocks for %s"
,
reln
->
rd_rel
->
relname
.
data
);
return
(
nblocks
);
}
...
...
@@ -355,7 +349,7 @@ smgrtruncate(int16 which, Relation reln, int nblocks)
{
if
((
newblks
=
(
*
(
smgrsw
[
which
].
smgr_truncate
))
(
reln
,
nblocks
))
<
0
)
elog
(
ERROR
,
"cannot truncate %s to %d blocks"
,
&
(
reln
->
rd_rel
->
relname
.
data
[
0
])
,
nblocks
);
reln
->
rd_rel
->
relname
.
data
,
nblocks
);
}
return
(
newblks
);
...
...
src/backend/utils/cache/relcache.c
View file @
34797d42
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.4
0 1998/06/15 19:29:40
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.4
1 1998/07/20 16:14:16
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -604,8 +604,8 @@ build_tupdesc_ind(RelationBuildDescInfo buildinfo,
atttup
=
(
HeapTuple
)
AttributeNumIndexScan
(
attrel
,
relation
->
rd_id
,
i
);
if
(
!
HeapTupleIsValid
(
atttup
))
elog
(
ERROR
,
"cannot find attribute %d of relation %
.*
s"
,
i
,
NAMEDATALEN
,
&
(
relation
->
rd_rel
->
relname
.
data
[
0
])
);
elog
(
ERROR
,
"cannot find attribute %d of relation %s"
,
i
,
relation
->
rd_rel
->
relname
.
data
);
attp
=
(
AttributeTupleForm
)
GETSTRUCT
(
atttup
);
relation
->
rd_att
->
attrs
[
i
-
1
]
=
...
...
@@ -1712,40 +1712,39 @@ AttrDefaultFetch(Relation relation)
if
(
adform
->
adnum
!=
attrdef
[
i
].
adnum
)
continue
;
if
(
attrdef
[
i
].
adsrc
!=
NULL
)
elog
(
ERROR
,
"AttrDefaultFetch: second record found for attr %
.*s in rel %.*
s"
,
NAMEDATALEN
,
relation
->
rd_att
->
attrs
[
adform
->
adnum
-
1
]
->
attname
.
data
,
NAMEDATALEN
,
relation
->
rd_rel
->
relname
.
data
);
elog
(
ERROR
,
"AttrDefaultFetch: second record found for attr %
s in rel %
s"
,
relation
->
rd_att
->
attrs
[
adform
->
adnum
-
1
]
->
attname
.
data
,
relation
->
rd_rel
->
relname
.
data
);
val
=
(
struct
varlena
*
)
fastgetattr
(
tuple
,
Anum_pg_attrdef_adbin
,
adrel
->
rd_att
,
&
isnull
);
if
(
isnull
)
elog
(
ERROR
,
"AttrDefaultFetch: adbin IS NULL for attr %
.*s in rel %.*
s"
,
NAMEDATALEN
,
relation
->
rd_att
->
attrs
[
adform
->
adnum
-
1
]
->
attname
.
data
,
NAMEDATALEN
,
relation
->
rd_rel
->
relname
.
data
);
elog
(
ERROR
,
"AttrDefaultFetch: adbin IS NULL for attr %
s in rel %
s"
,
relation
->
rd_att
->
attrs
[
adform
->
adnum
-
1
]
->
attname
.
data
,
relation
->
rd_rel
->
relname
.
data
);
attrdef
[
i
].
adbin
=
textout
(
val
);
val
=
(
struct
varlena
*
)
fastgetattr
(
tuple
,
Anum_pg_attrdef_adsrc
,
adrel
->
rd_att
,
&
isnull
);
if
(
isnull
)
elog
(
ERROR
,
"AttrDefaultFetch: adsrc IS NULL for attr %
.*s in rel %.*
s"
,
NAMEDATALEN
,
relation
->
rd_att
->
attrs
[
adform
->
adnum
-
1
]
->
attname
.
data
,
NAMEDATALEN
,
relation
->
rd_rel
->
relname
.
data
);
elog
(
ERROR
,
"AttrDefaultFetch: adsrc IS NULL for attr %
s in rel %
s"
,
relation
->
rd_att
->
attrs
[
adform
->
adnum
-
1
]
->
attname
.
data
,
relation
->
rd_rel
->
relname
.
data
);
attrdef
[
i
].
adsrc
=
textout
(
val
);
break
;
}
if
(
i
>=
ndef
)
elog
(
ERROR
,
"AttrDefaultFetch: unexpected record found for attr %d in rel %
.*
s"
,
elog
(
ERROR
,
"AttrDefaultFetch: unexpected record found for attr %d in rel %s"
,
adform
->
adnum
,
NAMEDATALEN
,
relation
->
rd_rel
->
relname
.
data
);
relation
->
rd_rel
->
relname
.
data
);
ReleaseBuffer
(
buffer
);
}
if
(
found
<
ndef
)
elog
(
ERROR
,
"AttrDefaultFetch: %d record not found for rel %.*s"
,
ndef
-
found
,
NAMEDATALEN
,
relation
->
rd_rel
->
relname
.
data
);
elog
(
ERROR
,
"AttrDefaultFetch: %d record not found for rel %s"
,
ndef
-
found
,
relation
->
rd_rel
->
relname
.
data
);
index_endscan
(
sd
);
pfree
(
sd
);
...
...
@@ -1795,29 +1794,29 @@ RelCheckFetch(Relation relation)
if
(
!
HeapTupleIsValid
(
tuple
))
continue
;
if
(
found
==
ncheck
)
elog
(
ERROR
,
"RelCheckFetch: unexpected record found for rel %
.*
s"
,
NAMEDATALEN
,
relation
->
rd_rel
->
relname
.
data
);
elog
(
ERROR
,
"RelCheckFetch: unexpected record found for rel %s"
,
relation
->
rd_rel
->
relname
.
data
);
rcname
=
(
Name
)
fastgetattr
(
tuple
,
Anum_pg_relcheck_rcname
,
rcrel
->
rd_att
,
&
isnull
);
if
(
isnull
)
elog
(
ERROR
,
"RelCheckFetch: rcname IS NULL for rel %
.*
s"
,
NAMEDATALEN
,
relation
->
rd_rel
->
relname
.
data
);
elog
(
ERROR
,
"RelCheckFetch: rcname IS NULL for rel %s"
,
relation
->
rd_rel
->
relname
.
data
);
check
[
found
].
ccname
=
nameout
(
rcname
);
val
=
(
struct
varlena
*
)
fastgetattr
(
tuple
,
Anum_pg_relcheck_rcbin
,
rcrel
->
rd_att
,
&
isnull
);
if
(
isnull
)
elog
(
ERROR
,
"RelCheckFetch: rcbin IS NULL for rel %
.*
s"
,
NAMEDATALEN
,
relation
->
rd_rel
->
relname
.
data
);
elog
(
ERROR
,
"RelCheckFetch: rcbin IS NULL for rel %s"
,
relation
->
rd_rel
->
relname
.
data
);
check
[
found
].
ccbin
=
textout
(
val
);
val
=
(
struct
varlena
*
)
fastgetattr
(
tuple
,
Anum_pg_relcheck_rcsrc
,
rcrel
->
rd_att
,
&
isnull
);
if
(
isnull
)
elog
(
ERROR
,
"RelCheckFetch: rcsrc IS NULL for rel %
.*
s"
,
NAMEDATALEN
,
relation
->
rd_rel
->
relname
.
data
);
elog
(
ERROR
,
"RelCheckFetch: rcsrc IS NULL for rel %s"
,
relation
->
rd_rel
->
relname
.
data
);
check
[
found
].
ccsrc
=
textout
(
val
);
found
++
;
...
...
@@ -1825,9 +1824,9 @@ RelCheckFetch(Relation relation)
}
if
(
found
<
ncheck
)
elog
(
ERROR
,
"RelCheckFetch: %d record not found for rel %
.*
s"
,
elog
(
ERROR
,
"RelCheckFetch: %d record not found for rel %s"
,
ncheck
-
found
,
NAMEDATALEN
,
relation
->
rd_rel
->
relname
.
data
);
relation
->
rd_rel
->
relname
.
data
);
index_endscan
(
sd
);
pfree
(
sd
);
...
...
src/backend/utils/misc/database.c
View file @
34797d42
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.1
0 1998/06/15 19:29:50
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.1
1 1998/07/20 16:14:18
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -267,9 +267,7 @@ GetRawDatabaseInfo(char *name, Oid *owner, Oid *db_id, char *path)
*/
tup_db
=
(
Form_pg_database
)
GETSTRUCT
(
tup
);
if
(
strncmp
(
name
,
&
(
tup_db
->
datname
.
data
[
0
]),
16
)
==
0
)
if
(
strcmp
(
name
,
tup_db
->
datname
.
data
)
==
0
)
{
*
db_id
=
tup
->
t_oid
;
strncpy
(
path
,
VARDATA
(
&
(
tup_db
->
datpath
)),
...
...
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