1996-08-27 23:50:29 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* genam.h
|
2002-05-21 01:51:44 +02:00
|
|
|
* POSTGRES generalized index access method definitions.
|
1996-08-27 23:50:29 +02:00
|
|
|
*
|
|
|
|
*
|
2018-01-03 05:30:12 +01:00
|
|
|
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-27 23:50:29 +02:00
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/access/genam.h
|
1996-08-27 23:50:29 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef GENAM_H
|
1996-08-27 23:50:29 +02:00
|
|
|
#define GENAM_H
|
|
|
|
|
1999-07-16 19:07:40 +02:00
|
|
|
#include "access/sdir.h"
|
2008-06-19 02:46:06 +02:00
|
|
|
#include "access/skey.h"
|
2008-04-11 00:25:26 +02:00
|
|
|
#include "nodes/tidbitmap.h"
|
2015-08-07 15:10:56 +02:00
|
|
|
#include "storage/lockdefs.h"
|
2008-06-19 02:46:06 +02:00
|
|
|
#include "utils/relcache.h"
|
|
|
|
#include "utils/snapshot.h"
|
1996-08-27 23:50:29 +02:00
|
|
|
|
Allow index AMs to cache data across aminsert calls within a SQL command.
It's always been possible for index AMs to cache data across successive
amgettuple calls within a single SQL command: the IndexScanDesc.opaque
field is meant for precisely that. However, no comparable facility
exists for amortizing setup work across successive aminsert calls.
This patch adds such a feature and teaches GIN, GIST, and BRIN to use it
to amortize catalog lookups they'd previously been doing on every call.
(The other standard index AMs keep everything they need in the relcache,
so there's little to improve there.)
For GIN, the overall improvement in a statement that inserts many rows
can be as much as 10%, though it seems a bit less for the other two.
In addition, this makes a really significant difference in runtime
for CLOBBER_CACHE_ALWAYS tests, since in those builds the repeated
catalog lookups are vastly more expensive.
The reason this has been hard up to now is that the aminsert function is
not passed any useful place to cache per-statement data. What I chose to
do is to add suitable fields to struct IndexInfo and pass that to aminsert.
That's not widening the index AM API very much because IndexInfo is already
within the ken of ambuild; in fact, by passing the same info to aminsert
as to ambuild, this is really removing an inconsistency in the AM API.
Discussion: https://postgr.es/m/27568.1486508680@sss.pgh.pa.us
2017-02-09 17:52:12 +01:00
|
|
|
/* We don't want this file to depend on execnodes.h. */
|
|
|
|
struct IndexInfo;
|
|
|
|
|
2006-05-11 01:18:39 +02:00
|
|
|
/*
|
|
|
|
* Struct for statistics returned by ambuild
|
|
|
|
*/
|
|
|
|
typedef struct IndexBuildResult
|
|
|
|
{
|
|
|
|
double heap_tuples; /* # of tuples seen in parent table */
|
|
|
|
double index_tuples; /* # of tuples inserted into index */
|
|
|
|
} IndexBuildResult;
|
|
|
|
|
2003-02-22 01:45:05 +01:00
|
|
|
/*
|
2006-05-03 00:25:10 +02:00
|
|
|
* Struct for input arguments passed to ambulkdelete and amvacuumcleanup
|
2003-02-22 01:45:05 +01:00
|
|
|
*
|
2009-06-07 00:13:52 +02:00
|
|
|
* num_heap_tuples is accurate only when estimated_count is false;
|
|
|
|
* otherwise it's just an estimate (currently, the estimate is the
|
|
|
|
* prior value of the relation's pg_class.reltuples field). It will
|
|
|
|
* always just be an estimate during ambulkdelete.
|
2006-05-03 00:25:10 +02:00
|
|
|
*/
|
|
|
|
typedef struct IndexVacuumInfo
|
|
|
|
{
|
|
|
|
Relation index; /* the index being vacuumed */
|
2009-03-24 21:17:18 +01:00
|
|
|
bool analyze_only; /* ANALYZE (without any actual vacuum) */
|
2009-06-07 00:13:52 +02:00
|
|
|
bool estimated_count; /* num_heap_tuples is an estimate */
|
2006-05-03 00:25:10 +02:00
|
|
|
int message_level; /* ereport level for progress messages */
|
|
|
|
double num_heap_tuples; /* tuples remaining in heap */
|
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 21:18:54 +02:00
|
|
|
BufferAccessStrategy strategy; /* access strategy for reads */
|
2006-05-03 00:25:10 +02:00
|
|
|
} IndexVacuumInfo;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Struct for statistics returned by ambulkdelete and amvacuumcleanup
|
|
|
|
*
|
|
|
|
* This struct is normally allocated by the first ambulkdelete call and then
|
|
|
|
* passed along through subsequent ones until amvacuumcleanup; however,
|
|
|
|
* amvacuumcleanup must be prepared to allocate it in the case where no
|
|
|
|
* ambulkdelete calls were made (because no tuples needed deletion).
|
|
|
|
* Note that an index AM could choose to return a larger struct
|
|
|
|
* of which this is just the first field; this provides a way for ambulkdelete
|
|
|
|
* to communicate additional private data to amvacuumcleanup.
|
2004-12-01 20:00:56 +01:00
|
|
|
*
|
|
|
|
* Note: pages_removed is the amount by which the index physically shrank,
|
|
|
|
* if any (ie the change in its total size on disk). pages_deleted and
|
2009-06-07 00:13:52 +02:00
|
|
|
* pages_free refer to free space within the index file. Some index AMs
|
|
|
|
* may compute num_index_tuples by reference to num_heap_tuples, in which
|
|
|
|
* case they should copy the estimated_count field from IndexVacuumInfo.
|
2003-02-22 01:45:05 +01:00
|
|
|
*/
|
Restructure index AM interface for index building and index tuple deletion,
per previous discussion on pghackers. Most of the duplicate code in
different AMs' ambuild routines has been moved out to a common routine
in index.c; this means that all index types now do the right things about
inserting recently-dead tuples, etc. (I also removed support for EXTEND
INDEX in the ambuild routines, since that's about to go away anyway, and
it cluttered the code a lot.) The retail indextuple deletion routines have
been replaced by a "bulk delete" routine in which the indexscan is inside
the access method. I haven't pushed this change as far as it should go yet,
but it should allow considerable simplification of the internal bookkeeping
for deletions. Also, add flag columns to pg_am to eliminate various
hardcoded tests on AM OIDs, and remove unused pg_am columns.
Fix rtree and gist index types to not attempt to store NULLs; before this,
gist usually crashed, while rtree managed not to crash but computed wacko
bounding boxes for NULL entries (which might have had something to do with
the performance problems we've heard about occasionally).
Add AtEOXact routines to hash, rtree, and gist, all of which have static
state that needs to be reset after an error. We discovered this need long
ago for btree, but missed the other guys.
Oh, one more thing: concurrent VACUUM is now the default.
2001-07-16 00:48:19 +02:00
|
|
|
typedef struct IndexBulkDeleteResult
|
|
|
|
{
|
2001-10-25 07:50:21 +02:00
|
|
|
BlockNumber num_pages; /* pages remaining in index */
|
2006-05-03 00:25:10 +02:00
|
|
|
BlockNumber pages_removed; /* # removed during vacuum operation */
|
2009-06-07 00:13:52 +02:00
|
|
|
bool estimated_count; /* num_index_tuples is an estimate */
|
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 21:18:54 +02:00
|
|
|
double num_index_tuples; /* tuples remaining */
|
2006-05-03 00:25:10 +02:00
|
|
|
double tuples_removed; /* # removed during vacuum operation */
|
2003-08-04 02:43:34 +02:00
|
|
|
BlockNumber pages_deleted; /* # unused pages in index */
|
|
|
|
BlockNumber pages_free; /* # pages available for reuse */
|
Restructure index AM interface for index building and index tuple deletion,
per previous discussion on pghackers. Most of the duplicate code in
different AMs' ambuild routines has been moved out to a common routine
in index.c; this means that all index types now do the right things about
inserting recently-dead tuples, etc. (I also removed support for EXTEND
INDEX in the ambuild routines, since that's about to go away anyway, and
it cluttered the code a lot.) The retail indextuple deletion routines have
been replaced by a "bulk delete" routine in which the indexscan is inside
the access method. I haven't pushed this change as far as it should go yet,
but it should allow considerable simplification of the internal bookkeeping
for deletions. Also, add flag columns to pg_am to eliminate various
hardcoded tests on AM OIDs, and remove unused pg_am columns.
Fix rtree and gist index types to not attempt to store NULLs; before this,
gist usually crashed, while rtree managed not to crash but computed wacko
bounding boxes for NULL entries (which might have had something to do with
the performance problems we've heard about occasionally).
Add AtEOXact routines to hash, rtree, and gist, all of which have static
state that needs to be reset after an error. We discovered this need long
ago for btree, but missed the other guys.
Oh, one more thing: concurrent VACUUM is now the default.
2001-07-16 00:48:19 +02:00
|
|
|
} IndexBulkDeleteResult;
|
|
|
|
|
|
|
|
/* Typedef for callback function to determine if a tuple is bulk-deletable */
|
|
|
|
typedef bool (*IndexBulkDeleteCallback) (ItemPointer itemptr, void *state);
|
|
|
|
|
2008-06-19 02:46:06 +02:00
|
|
|
/* struct definitions appear in relscan.h */
|
|
|
|
typedef struct IndexScanDescData *IndexScanDesc;
|
|
|
|
typedef struct SysScanDescData *SysScanDesc;
|
2002-02-19 21:11:20 +01:00
|
|
|
|
2017-01-24 22:42:58 +01:00
|
|
|
typedef struct ParallelIndexScanDescData *ParallelIndexScanDesc;
|
|
|
|
|
2009-07-29 22:56:21 +02:00
|
|
|
/*
|
|
|
|
* Enumeration specifying the type of uniqueness check to perform in
|
|
|
|
* index_insert().
|
|
|
|
*
|
|
|
|
* UNIQUE_CHECK_YES is the traditional Postgres immediate check, possibly
|
|
|
|
* blocking to see if a conflicting transaction commits.
|
|
|
|
*
|
|
|
|
* For deferrable unique constraints, UNIQUE_CHECK_PARTIAL is specified at
|
2014-05-06 18:12:18 +02:00
|
|
|
* insertion time. The index AM should test if the tuple is unique, but
|
2009-07-29 22:56:21 +02:00
|
|
|
* should not throw error, block, or prevent the insertion if the tuple
|
|
|
|
* appears not to be unique. We'll recheck later when it is time for the
|
|
|
|
* constraint to be enforced. The AM must return true if the tuple is
|
|
|
|
* known unique, false if it is possibly non-unique. In the "true" case
|
|
|
|
* it is safe to omit the later recheck.
|
|
|
|
*
|
|
|
|
* When it is time to recheck the deferred constraint, a pseudo-insertion
|
|
|
|
* call is made with UNIQUE_CHECK_EXISTING. The tuple is already in the
|
2014-05-06 18:12:18 +02:00
|
|
|
* index in this case, so it should not be inserted again. Rather, just
|
2009-07-29 22:56:21 +02:00
|
|
|
* check for conflicting live tuples (possibly blocking).
|
|
|
|
*/
|
|
|
|
typedef enum IndexUniqueCheck
|
|
|
|
{
|
|
|
|
UNIQUE_CHECK_NO, /* Don't do any uniqueness checking */
|
|
|
|
UNIQUE_CHECK_YES, /* Enforce uniqueness at insertion time */
|
|
|
|
UNIQUE_CHECK_PARTIAL, /* Test uniqueness, but no error */
|
|
|
|
UNIQUE_CHECK_EXISTING /* Check if existing tuple is unique */
|
|
|
|
} IndexUniqueCheck;
|
|
|
|
|
2002-02-19 21:11:20 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* generalized index_ interface routines (in indexam.c)
|
1996-08-27 23:50:29 +02:00
|
|
|
*/
|
2008-06-19 02:46:06 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* IndexScanIsValid
|
|
|
|
* True iff the index scan is valid.
|
|
|
|
*/
|
|
|
|
#define IndexScanIsValid(scan) PointerIsValid(scan)
|
|
|
|
|
2006-07-31 22:09:10 +02:00
|
|
|
extern Relation index_open(Oid relationId, LOCKMODE lockmode);
|
|
|
|
extern void index_close(Relation relation, LOCKMODE lockmode);
|
|
|
|
|
2005-03-21 02:24:04 +01:00
|
|
|
extern bool index_insert(Relation indexRelation,
|
|
|
|
Datum *values, bool *isnull,
|
1997-09-07 07:04:48 +02:00
|
|
|
ItemPointer heap_t_ctid,
|
2002-05-24 20:57:57 +02:00
|
|
|
Relation heapRelation,
|
Allow index AMs to cache data across aminsert calls within a SQL command.
It's always been possible for index AMs to cache data across successive
amgettuple calls within a single SQL command: the IndexScanDesc.opaque
field is meant for precisely that. However, no comparable facility
exists for amortizing setup work across successive aminsert calls.
This patch adds such a feature and teaches GIN, GIST, and BRIN to use it
to amortize catalog lookups they'd previously been doing on every call.
(The other standard index AMs keep everything they need in the relcache,
so there's little to improve there.)
For GIN, the overall improvement in a statement that inserts many rows
can be as much as 10%, though it seems a bit less for the other two.
In addition, this makes a really significant difference in runtime
for CLOBBER_CACHE_ALWAYS tests, since in those builds the repeated
catalog lookups are vastly more expensive.
The reason this has been hard up to now is that the aminsert function is
not passed any useful place to cache per-statement data. What I chose to
do is to add suitable fields to struct IndexInfo and pass that to aminsert.
That's not widening the index AM API very much because IndexInfo is already
within the ken of ambuild; in fact, by passing the same info to aminsert
as to ambuild, this is really removing an inconsistency in the AM API.
Discussion: https://postgr.es/m/27568.1486508680@sss.pgh.pa.us
2017-02-09 17:52:12 +01:00
|
|
|
IndexUniqueCheck checkUnique,
|
|
|
|
struct IndexInfo *indexInfo);
|
2002-05-21 01:51:44 +02:00
|
|
|
|
|
|
|
extern IndexScanDesc index_beginscan(Relation heapRelation,
|
2002-09-04 22:31:48 +02:00
|
|
|
Relation indexRelation,
|
|
|
|
Snapshot snapshot,
|
2010-12-03 02:50:48 +01:00
|
|
|
int nkeys, int norderbys);
|
2008-04-11 00:25:26 +02:00
|
|
|
extern IndexScanDesc index_beginscan_bitmap(Relation indexRelation,
|
2009-06-11 16:49:15 +02:00
|
|
|
Snapshot snapshot,
|
2010-12-03 02:50:48 +01:00
|
|
|
int nkeys);
|
|
|
|
extern void index_rescan(IndexScanDesc scan,
|
|
|
|
ScanKey keys, int nkeys,
|
|
|
|
ScanKey orderbys, int norderbys);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void index_endscan(IndexScanDesc scan);
|
1998-02-26 13:14:54 +01:00
|
|
|
extern void index_markpos(IndexScanDesc scan);
|
|
|
|
extern void index_restrpos(IndexScanDesc scan);
|
2017-01-24 22:42:58 +01:00
|
|
|
extern Size index_parallelscan_estimate(Relation indexrel, Snapshot snapshot);
|
|
|
|
extern void index_parallelscan_initialize(Relation heaprel, Relation indexrel,
|
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they
flow past the right margin.
By default, BSD indent lines up statement continuation lines that are
within parentheses so that they start just to the right of the preceding
left parenthesis. However, traditionally, if that resulted in the
continuation line extending to the right of the desired right margin,
then indent would push it left just far enough to not overrun the margin,
if it could do so without making the continuation line start to the left of
the current statement indent. That makes for a weird mix of indentations
unless one has been completely rigid about never violating the 80-column
limit.
This behavior has been pretty universally panned by Postgres developers.
Hence, disable it with indent's new -lpl switch, so that parenthesized
lines are always lined up with the preceding left paren.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 21:35:54 +02:00
|
|
|
Snapshot snapshot, ParallelIndexScanDesc target);
|
2017-01-24 22:42:58 +01:00
|
|
|
extern void index_parallelrescan(IndexScanDesc scan);
|
|
|
|
extern IndexScanDesc index_beginscan_parallel(Relation heaprel,
|
|
|
|
Relation indexrel, int nkeys, int norderbys,
|
|
|
|
ParallelIndexScanDesc pscan);
|
2011-10-08 02:13:02 +02:00
|
|
|
extern ItemPointer index_getnext_tid(IndexScanDesc scan,
|
|
|
|
ScanDirection direction);
|
|
|
|
extern HeapTuple index_fetch_heap(IndexScanDesc scan);
|
2002-05-21 01:51:44 +02:00
|
|
|
extern HeapTuple index_getnext(IndexScanDesc scan, ScanDirection direction);
|
2008-04-11 00:25:26 +02:00
|
|
|
extern int64 index_getbitmap(IndexScanDesc scan, TIDBitmap *bitmap);
|
2002-05-21 01:51:44 +02:00
|
|
|
|
2006-05-03 00:25:10 +02:00
|
|
|
extern IndexBulkDeleteResult *index_bulk_delete(IndexVacuumInfo *info,
|
|
|
|
IndexBulkDeleteResult *stats,
|
2001-10-25 07:50:21 +02:00
|
|
|
IndexBulkDeleteCallback callback,
|
|
|
|
void *callback_state);
|
2006-05-03 00:25:10 +02:00
|
|
|
extern IndexBulkDeleteResult *index_vacuum_cleanup(IndexVacuumInfo *info,
|
2003-08-04 02:43:34 +02:00
|
|
|
IndexBulkDeleteResult *stats);
|
2015-03-26 18:12:00 +01:00
|
|
|
extern bool index_can_return(Relation indexRelation, int attno);
|
1998-09-01 06:40:42 +02:00
|
|
|
extern RegProcedure index_getprocid(Relation irel, AttrNumber attnum,
|
1997-09-07 07:04:48 +02:00
|
|
|
uint16 procnum);
|
2005-05-28 01:31:21 +02:00
|
|
|
extern FmgrInfo *index_getprocinfo(Relation irel, AttrNumber attnum,
|
2001-10-25 07:50:21 +02:00
|
|
|
uint16 procnum);
|
2018-09-19 00:54:10 +02:00
|
|
|
extern void index_store_float8_orderby_distances(IndexScanDesc scan,
|
|
|
|
Oid *orderByTypes, double *distances,
|
|
|
|
bool recheckOrderBy);
|
1996-08-27 23:50:29 +02:00
|
|
|
|
2002-02-19 21:11:20 +01:00
|
|
|
/*
|
|
|
|
* index access method support routines (in genam.c)
|
|
|
|
*/
|
2002-05-21 01:51:44 +02:00
|
|
|
extern IndexScanDesc RelationGetIndexScan(Relation indexRelation,
|
2010-12-03 02:50:48 +01:00
|
|
|
int nkeys, int norderbys);
|
1999-12-30 06:05:13 +01:00
|
|
|
extern void IndexScanEnd(IndexScanDesc scan);
|
2009-08-01 22:59:17 +02:00
|
|
|
extern char *BuildIndexValueDescription(Relation indexRelation,
|
|
|
|
Datum *values, bool *isnull);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2002-02-19 21:11:20 +01:00
|
|
|
/*
|
|
|
|
* heap-or-index access to system catalogs (in genam.c)
|
|
|
|
*/
|
2002-05-21 01:51:44 +02:00
|
|
|
extern SysScanDesc systable_beginscan(Relation heapRelation,
|
2005-04-14 22:03:27 +02:00
|
|
|
Oid indexId,
|
2002-09-04 22:31:48 +02:00
|
|
|
bool indexOK,
|
|
|
|
Snapshot snapshot,
|
|
|
|
int nkeys, ScanKey key);
|
2002-02-19 21:11:20 +01:00
|
|
|
extern HeapTuple systable_getnext(SysScanDesc sysscan);
|
2008-06-09 00:41:04 +02:00
|
|
|
extern bool systable_recheck_tuple(SysScanDesc sysscan, HeapTuple tup);
|
2002-02-19 21:11:20 +01:00
|
|
|
extern void systable_endscan(SysScanDesc sysscan);
|
2008-04-13 01:14:21 +02:00
|
|
|
extern SysScanDesc systable_beginscan_ordered(Relation heapRelation,
|
2009-06-11 16:49:15 +02:00
|
|
|
Relation indexRelation,
|
|
|
|
Snapshot snapshot,
|
|
|
|
int nkeys, ScanKey key);
|
2008-04-13 01:14:21 +02:00
|
|
|
extern HeapTuple systable_getnext_ordered(SysScanDesc sysscan,
|
2009-06-11 16:49:15 +02:00
|
|
|
ScanDirection direction);
|
2008-04-13 01:14:21 +02:00
|
|
|
extern void systable_endscan_ordered(SysScanDesc sysscan);
|
2002-02-19 21:11:20 +01:00
|
|
|
|
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 21:18:54 +02:00
|
|
|
#endif /* GENAM_H */
|