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
a17b01f3
Commit
a17b01f3
authored
Feb 18, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update btree patches that were missed.
parent
e230c0b6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
46 deletions
+68
-46
src/backend/access/nbtree/nbtree.c
src/backend/access/nbtree/nbtree.c
+1
-1
src/backend/access/nbtree/nbtscan.c
src/backend/access/nbtree/nbtscan.c
+61
-9
src/backend/access/nbtree/nbtsearch.c
src/backend/access/nbtree/nbtsearch.c
+2
-2
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+1
-12
src/include/access/nbtree.h
src/include/access/nbtree.h
+2
-4
src/man/postmaster.1
src/man/postmaster.1
+1
-18
No files found.
src/backend/access/nbtree/nbtree.c
View file @
a17b01f3
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.1
3 1997/02/12 05:04:17 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.1
4 1997/02/18 17:13:42 momjian
Exp $
*
*
* NOTES
* NOTES
* This file contains only the public interface routines.
* This file contains only the public interface routines.
...
...
src/backend/access/nbtree/nbtscan.c
View file @
a17b01f3
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.
6 1996/11/15 18:37:00
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.
7 1997/02/18 17:13:45
momjian Exp $
*
*
*
*
* NOTES
* NOTES
...
@@ -40,7 +40,10 @@ typedef struct BTScanListData {
...
@@ -40,7 +40,10 @@ typedef struct BTScanListData {
typedef
BTScanListData
*
BTScanList
;
typedef
BTScanListData
*
BTScanList
;
static
BTScanList
BTScans
=
(
BTScanList
)
NULL
;
static
BTScanList
BTScans
=
(
BTScanList
)
NULL
;
static
void
_bt_scandel
(
IndexScanDesc
scan
,
int
op
,
BlockNumber
blkno
,
OffsetNumber
offno
);
static
bool
_bt_scantouched
(
IndexScanDesc
scan
,
BlockNumber
blkno
,
OffsetNumber
offno
);
/*
/*
* _bt_regscan() -- register a new scan.
* _bt_regscan() -- register a new scan.
*/
*/
...
@@ -81,8 +84,12 @@ _bt_dropscan(IndexScanDesc scan)
...
@@ -81,8 +84,12 @@ _bt_dropscan(IndexScanDesc scan)
pfree
(
chk
);
pfree
(
chk
);
}
}
/*
* _bt_adjscans() -- adjust all scans in the scan list to compensate
* for a given deletion or insertion
*/
void
void
_bt_adjscans
(
Relation
rel
,
ItemPointer
tid
)
_bt_adjscans
(
Relation
rel
,
ItemPointer
tid
,
int
op
)
{
{
BTScanList
l
;
BTScanList
l
;
Oid
relid
;
Oid
relid
;
...
@@ -90,13 +97,34 @@ _bt_adjscans(Relation rel, ItemPointer tid)
...
@@ -90,13 +97,34 @@ _bt_adjscans(Relation rel, ItemPointer tid)
relid
=
rel
->
rd_id
;
relid
=
rel
->
rd_id
;
for
(
l
=
BTScans
;
l
!=
(
BTScanList
)
NULL
;
l
=
l
->
btsl_next
)
{
for
(
l
=
BTScans
;
l
!=
(
BTScanList
)
NULL
;
l
=
l
->
btsl_next
)
{
if
(
relid
==
l
->
btsl_scan
->
relation
->
rd_id
)
if
(
relid
==
l
->
btsl_scan
->
relation
->
rd_id
)
_bt_scandel
(
l
->
btsl_scan
,
ItemPointerGetBlockNumber
(
tid
),
_bt_scandel
(
l
->
btsl_scan
,
op
,
ItemPointerGetBlockNumber
(
tid
),
ItemPointerGetOffsetNumber
(
tid
));
ItemPointerGetOffsetNumber
(
tid
));
}
}
}
}
void
/*
_bt_scandel
(
IndexScanDesc
scan
,
BlockNumber
blkno
,
OffsetNumber
offno
)
* _bt_scandel() -- adjust a single scan
*
* because each index page is always maintained as an ordered array of
* index tuples, the index tuples on a given page shift beneath any
* given scan. an index modification "behind" a scan position (i.e.,
* same page, lower or equal offset number) will therefore force us to
* adjust the scan in the following ways:
*
* - on insertion, we shift the scan forward by one item.
* - on deletion, we shift the scan backward by one item.
*
* note that:
*
* - we need not worry about the actual ScanDirection of the scan
* itself, since the problem is that the "current" scan position has
* shifted.
* - modifications "ahead" of our scan position do not change the
* array index of the current scan position and so can be ignored.
*/
static
void
_bt_scandel
(
IndexScanDesc
scan
,
int
op
,
BlockNumber
blkno
,
OffsetNumber
offno
)
{
{
ItemPointer
current
;
ItemPointer
current
;
Buffer
buf
;
Buffer
buf
;
...
@@ -112,7 +140,17 @@ _bt_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno)
...
@@ -112,7 +140,17 @@ _bt_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno)
if
(
ItemPointerIsValid
(
current
)
if
(
ItemPointerIsValid
(
current
)
&&
ItemPointerGetBlockNumber
(
current
)
==
blkno
&&
ItemPointerGetBlockNumber
(
current
)
==
blkno
&&
ItemPointerGetOffsetNumber
(
current
)
>=
offno
)
{
&&
ItemPointerGetOffsetNumber
(
current
)
>=
offno
)
{
_bt_step
(
scan
,
&
buf
,
BackwardScanDirection
);
switch
(
op
)
{
case
BT_INSERT
:
_bt_step
(
scan
,
&
buf
,
ForwardScanDirection
);
break
;
case
BT_DELETE
:
_bt_step
(
scan
,
&
buf
,
BackwardScanDirection
);
break
;
default:
elog
(
WARN
,
"_bt_scandel: bad operation '%d'"
,
op
);
/*NOTREACHED*/
}
so
->
btso_curbuf
=
buf
;
so
->
btso_curbuf
=
buf
;
}
}
...
@@ -124,7 +162,17 @@ _bt_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno)
...
@@ -124,7 +162,17 @@ _bt_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno)
tmp
=
*
current
;
tmp
=
*
current
;
*
current
=
scan
->
currentItemData
;
*
current
=
scan
->
currentItemData
;
scan
->
currentItemData
=
tmp
;
scan
->
currentItemData
=
tmp
;
_bt_step
(
scan
,
&
buf
,
BackwardScanDirection
);
switch
(
op
)
{
case
BT_INSERT
:
_bt_step
(
scan
,
&
buf
,
ForwardScanDirection
);
break
;
case
BT_DELETE
:
_bt_step
(
scan
,
&
buf
,
BackwardScanDirection
);
break
;
default:
elog
(
WARN
,
"_bt_scandel: bad operation '%d'"
,
op
);
/*NOTREACHED*/
}
so
->
btso_mrkbuf
=
buf
;
so
->
btso_mrkbuf
=
buf
;
tmp
=
*
current
;
tmp
=
*
current
;
*
current
=
scan
->
currentItemData
;
*
current
=
scan
->
currentItemData
;
...
@@ -132,7 +180,11 @@ _bt_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno)
...
@@ -132,7 +180,11 @@ _bt_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno)
}
}
}
}
bool
/*
* _bt_scantouched() -- check to see if a scan is affected by a given
* change to the index
*/
static
bool
_bt_scantouched
(
IndexScanDesc
scan
,
BlockNumber
blkno
,
OffsetNumber
offno
)
_bt_scantouched
(
IndexScanDesc
scan
,
BlockNumber
blkno
,
OffsetNumber
offno
)
{
{
ItemPointer
current
;
ItemPointer
current
;
...
...
src/backend/access/nbtree/nbtsearch.c
View file @
a17b01f3
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.1
3 1997/01/05 10:56:36 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.1
4 1997/02/18 17:13:48 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -332,7 +332,7 @@ _bt_binsrch(Relation rel,
...
@@ -332,7 +332,7 @@ _bt_binsrch(Relation rel,
else
if
(
result
<
0
)
else
if
(
result
<
0
)
high
=
mid
-
1
;
high
=
mid
-
1
;
else
else
return
(
_bt_firsteq
(
rel
,
itupdesc
,
page
,
keysz
,
scankey
,
mid
));
return
(
_bt_firsteq
(
rel
,
itupdesc
,
page
,
keysz
,
scankey
,
mid
));
}
}
/*
/*
...
...
src/backend/postmaster/postmaster.c
View file @
a17b01f3
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.4
0 1997/02/14 04:16:12
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.4
1 1997/02/18 17:13:58
momjian Exp $
*
*
* NOTES
* NOTES
*
*
...
@@ -287,12 +287,6 @@ PostmasterMain(int argc, char *argv[])
...
@@ -287,12 +287,6 @@ PostmasterMain(int argc, char *argv[])
else
else
DebugLvl
=
1
;
DebugLvl
=
1
;
break
;
break
;
case
'e'
:
/*
* Use european date formats.
*/
EuroDates
=
1
;
break
;
case
'm'
:
case
'm'
:
MultiplexedBackends
=
1
;
MultiplexedBackends
=
1
;
MultiplexedBackendPort
=
atoi
(
optarg
);
MultiplexedBackendPort
=
atoi
(
optarg
);
...
@@ -424,7 +418,6 @@ usage(const char *progname)
...
@@ -424,7 +418,6 @@ usage(const char *progname)
fprintf
(
stderr
,
"
\t
-b backend
\t
use a specific backend server executable
\n
"
);
fprintf
(
stderr
,
"
\t
-b backend
\t
use a specific backend server executable
\n
"
);
fprintf
(
stderr
,
"
\t
-d [1|2|3]
\t
set debugging level
\n
"
);
fprintf
(
stderr
,
"
\t
-d [1|2|3]
\t
set debugging level
\n
"
);
fprintf
(
stderr
,
"
\t
-D datadir
\t
set data directory
\n
"
);
fprintf
(
stderr
,
"
\t
-D datadir
\t
set data directory
\n
"
);
fprintf
(
stderr
,
"
\t
-e
\t
turn on European date format
\n
"
);
fprintf
(
stderr
,
"
\t
-m
\t
start up multiplexing backends
\n
"
);
fprintf
(
stderr
,
"
\t
-m
\t
start up multiplexing backends
\n
"
);
fprintf
(
stderr
,
"
\t
-n
\t\t
don't reinitialize shared memory after abnormal exit
\n
"
);
fprintf
(
stderr
,
"
\t
-n
\t\t
don't reinitialize shared memory after abnormal exit
\n
"
);
fprintf
(
stderr
,
"
\t
-o option
\t
pass 'option' to each backend servers
\n
"
);
fprintf
(
stderr
,
"
\t
-o option
\t
pass 'option' to each backend servers
\n
"
);
...
@@ -1113,10 +1106,6 @@ DoExec(StartupInfo *packet, int portFd)
...
@@ -1113,10 +1106,6 @@ DoExec(StartupInfo *packet, int portFd)
av
[
ac
++
]
=
"-o"
;
av
[
ac
++
]
=
"-o"
;
av
[
ac
++
]
=
ttybuf
;
av
[
ac
++
]
=
ttybuf
;
}
}
/* tell the backend we're using European dates */
if
(
EuroDates
==
1
)
av
[
ac
++
]
=
"-e"
;
/* tell the multiplexed backend to start on a certain port */
/* tell the multiplexed backend to start on a certain port */
if
(
MultiplexedBackends
)
{
if
(
MultiplexedBackends
)
{
...
...
src/include/access/nbtree.h
View file @
a17b01f3
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: nbtree.h,v 1.
7 1997/02/14 22:47:36
momjian Exp $
* $Id: nbtree.h,v 1.
8 1997/02/18 17:14:10
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -238,9 +238,7 @@ extern void btdelete(Relation rel, ItemPointer tid);
...
@@ -238,9 +238,7 @@ extern void btdelete(Relation rel, ItemPointer tid);
*/
*/
extern
void
_bt_regscan
(
IndexScanDesc
scan
);
extern
void
_bt_regscan
(
IndexScanDesc
scan
);
extern
void
_bt_dropscan
(
IndexScanDesc
scan
);
extern
void
_bt_dropscan
(
IndexScanDesc
scan
);
extern
void
_bt_adjscans
(
Relation
rel
,
ItemPointer
tid
);
extern
void
_bt_adjscans
(
Relation
rel
,
ItemPointer
tid
,
int
op
);
extern
void
_bt_scandel
(
IndexScanDesc
scan
,
BlockNumber
blkno
,
OffsetNumber
offno
);
extern
bool
_bt_scantouched
(
IndexScanDesc
scan
,
BlockNumber
blkno
,
OffsetNumber
offno
);
/*
/*
* prototypes for functions in nbtsearch.c
* prototypes for functions in nbtsearch.c
...
...
src/man/postmaster.1
View file @
a17b01f3
.\" This is -*-nroff-*-
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/postmaster.1,v 1.
3 1997/01/26 15:32:28 scrappy
Exp $
.\" $Header: /cvsroot/pgsql/src/man/Attic/postmaster.1,v 1.
4 1997/02/18 17:14:25 momjian
Exp $
.TH POSTMASTER UNIX 11/05/95 PostgreSQL PostgreSQL
.TH POSTMASTER UNIX 11/05/95 PostgreSQL PostgreSQL
.SH "NAME"
.SH "NAME"
postmaster \(em run the Postgres postmaster
postmaster \(em run the Postgres postmaster
...
@@ -173,23 +173,6 @@ programmer can then use the
...
@@ -173,23 +173,6 @@ programmer can then use the
.IR shmemdoc
.IR shmemdoc
program to examine shared memory and semaphore state.
program to examine shared memory and semaphore state.
.TP
.TP
.BR "-e"
The
.IR "-e"
option controls how dates are input to and output from the database.
.IP
If the
.IR "-e"
option is supplied, then all dates passed to and from the frontend
processes will be assumed to be in
.IR "European"
format ie.
.IR "DD-MM-YYYY"
otherwise dates are input and output in
.IR "American"
format ie.
.IR "MM-DD-YYYY"
.TP
.BR "-o" " backend_options"
.BR "-o" " backend_options"
The
The
.IR postgres (1)
.IR postgres (1)
...
...
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