*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <access/heapam.h>
-#include <access/htup.h>
-#include <access/transam.h>
-#include <access/tupmacs.h>
-#include <catalog/pg_type.h>
-#include <storage/bufpage.h>
-#include <utils/memutils.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "access/heapam.h"
+#include "catalog/pg_type.h"
/* Used by heap_getattr() macro, for speed */
long heap_sysoffset[] = {
len += bitmaplen;
}
- hoff = len = DOUBLEALIGN(len); /* be conservative here */
+ hoff = len = MAXALIGN(len); /* be conservative here */
len += ComputeDataSize(tupleDescriptor, value, nulls);
len = offsetof(HeapTupleHeaderData, t_bits);
- hoff = len = DOUBLEALIGN(len); /* be conservative */
+ hoff = len = MAXALIGN(len); /* be conservative */
len += structlen;
tuple = (HeapTuple) palloc(HEAPTUPLESIZE + len);
td = tuple->t_data = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE);
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <access/heapam.h>
-#include <access/ibit.h>
-#include <access/itup.h>
-#include <access/tupmacs.h>
-#include <catalog/pg_type.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "access/heapam.h"
+#include "access/itup.h"
+#include "catalog/pg_type.h"
+
/* ----------------------------------------------------------------
* index_ tuple interface routines
hoff = IndexInfoFindDataOffset(infomask);
size = hoff + ComputeDataSize(tupleDescriptor, value, null);
- size = DOUBLEALIGN(size); /* be conservative */
+ size = MAXALIGN(size); /* be conservative */
tp = (char *) palloc(size);
tuple = (IndexTuple) tp;
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-#include <fmgr.h>
+#include "postgres.h"
-#include <access/htup.h>
-#include <access/iqual.h>
-#include <access/itup.h>
-#include <access/skey.h>
-#include <executor/execdebug.h>
+#include "access/iqual.h"
+#include "executor/execdebug.h"
/* ----------------------------------------------------------------
* index scan key qualification code
*-------------------------------------------------------------------------
*/
-#include <string.h>
#include "postgres.h"
-#include "fmgr.h"
#include "access/heapam.h"
#include "access/printtup.h"
#include "catalog/pg_type.h"
-#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "utils/syscache.h"
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <fmgr.h>
-#include <access/skey.h>
+#include "access/skey.h"
/*
* ScanKeyEntryIsLegal
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
-
-#include <postgres.h>
-
-#include <catalog/pg_type.h>
-#include <nodes/parsenodes.h>
-#include <parser/parse_type.h>
-#include <utils/builtins.h>
-#include <utils/fcache.h>
-#include <utils/syscache.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "catalog/pg_type.h"
+#include "nodes/parsenodes.h"
+#include "parser/parse_type.h"
+#include "utils/builtins.h"
+#include "utils/syscache.h"
+
/* ----------------------------------------------------------------
* CreateTemplateTupleDesc
*
*
* IDENTIFICATION
- *
+ * $Header$
*
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <fmgr.h>
-#include <access/genam.h>
-#include <access/gist.h>
-#include <access/gistscan.h>
-#include <access/heapam.h>
-#include <catalog/index.h>
-#include <executor/executor.h>
-#include <storage/bufmgr.h>
-#include <storage/bufpage.h>
-#include <storage/lmgr.h>
-#include <utils/syscache.h>
-#include <utils/tqual.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "access/genam.h"
+#include "access/gist.h"
+#include "access/gistscan.h"
+#include "access/heapam.h"
+#include "catalog/index.h"
+#include "catalog/pg_index.h"
+#include "executor/executor.h"
+#include "utils/syscache.h"
+
/* non-export function prototypes */
static InsertIndexResult gistdoinsert(Relation r, IndexTuple itup,
static IndexTuple gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t);
static void gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr,
Relation r, Page pg, OffsetNumber o, int b, bool l);
+#ifdef GISTDEBUG
static char *int_range_out(INTRANGE *r);
+#endif
/*
** routine to build an index. Basically calls insert over and over
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <access/relscan.h>
-#include <storage/bufpage.h>
-#include <access/sdir.h>
-#include <access/itup.h>
-#include <access/gist.h>
-#include <executor/execdebug.h>
-#include <storage/bufmgr.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "access/gist.h"
+#include "executor/execdebug.h"
+
static OffsetNumber gistfindnext(IndexScanDesc s, Page p, OffsetNumber n,
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <access/gist.h>
-#include <access/gistscan.h>
-#include <access/genam.h>
-#include <access/rtree.h>
-#include <storage/bufmgr.h>
-#include <access/giststrat.h>
-#include <storage/lmgr.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "access/genam.h"
+#include "access/gist.h"
+#include "access/gistscan.h"
+
/* routines defined and used here */
static void gistregscan(IndexScanDesc s);
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <access/gist.h>
-#include <access/istrat.h>
+#include "access/gist.h"
+#include "access/istrat.h"
/*
* Note: negate, commute, and negatecommute all assume that operators are
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <access/hash.h>
-#include <executor/executor.h>
-#include <access/heapam.h>
-#include <access/genam.h>
-#include <catalog/index.h>
-#include <storage/bufmgr.h>
-#include <miscadmin.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "access/genam.h"
+#include "access/hash.h"
+#include "access/heapam.h"
+#include "catalog/index.h"
+#include "executor/executor.h"
+#include "miscadmin.h"
+
bool BuildingHash = false;
#include "postgres.h"
#include "access/hash.h"
-#include "utils/int8.h"
uint32
hashint2(int16 key)
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <access/hash.h>
-#include <storage/bufmgr.h>
-#include <utils/memutils.h>
+#include "access/hash.h"
static InsertIndexResult _hash_insertonpg(Relation rel, Buffer buf, int keysz, ScanKey scankey, HashItem hitem, Buffer metabuf);
static OffsetNumber _hash_pgaddtup(Relation rel, Buffer buf, int keysz, ScanKey itup_scankey, Size itemsize, HashItem hitem);
itemsz = IndexTupleDSize(hitem->hash_itup)
+ (sizeof(HashItemData) - sizeof(IndexTupleData));
- itemsz = DOUBLEALIGN(itemsz);
+ itemsz = MAXALIGN(itemsz);
while (PageGetFreeSpace(page) < itemsz)
{
*
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <access/hash.h>
-#include <storage/bufmgr.h>
-#include <utils/memutils.h>
+#include "access/hash.h"
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
static OverflowPageAddress _hash_getovfladdr(Relation rel, Buffer *metabufp);
static uint32 _hash_firstfreebit(uint32 map);
hitem = (HashItem) PageGetItem(rpage, PageGetItemId(rpage, roffnum));
itemsz = IndexTupleDSize(hitem->hash_itup)
+ (sizeof(HashItemData) - sizeof(IndexTupleData));
- itemsz = DOUBLEALIGN(itemsz);
+ itemsz = MAXALIGN(itemsz);
/*
* walk up the bucket chain, looking for a page big enough for
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <access/hash.h>
+#include "access/hash.h"
static void _hash_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno);
static bool _hash_scantouched(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno);
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <access/hash.h>
-#include <storage/bufmgr.h>
+#include "access/hash.h"
-#ifndef HAVE_MEMMOVE
-#include "regex/utils.h"
-#else
-#include <string.h>
-#endif
/*
* _hash_search() -- Finds the page/bucket that the contains the
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <access/hash.h>
-#include <access/istrat.h>
/*
* only one valid strategy for hash tables: equality.
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <access/hash.h>
-#include <fmgr.h>
-#include <utils/memutils.h>
-#include <access/iqual.h>
+#include "access/hash.h"
+#include "access/iqual.h"
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
ScanKey
_hash_mkscankey(Relation rel, IndexTuple itup, HashMetaPage metap)
Assert(((PageHeader) (page))->pd_lower >= (sizeof(PageHeaderData) - sizeof(ItemIdData)));
#if 1
Assert(((PageHeader) (page))->pd_upper <=
- (BLCKSZ - DOUBLEALIGN(sizeof(HashPageOpaqueData))));
+ (BLCKSZ - MAXALIGN(sizeof(HashPageOpaqueData))));
Assert(((PageHeader) (page))->pd_special ==
- (BLCKSZ - DOUBLEALIGN(sizeof(HashPageOpaqueData))));
+ (BLCKSZ - MAXALIGN(sizeof(HashPageOpaqueData))));
Assert(((PageHeader) (page))->pd_opaque.od_pagesize == BLCKSZ);
#endif
if (flags)
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
#include <time.h>
-#include <postgres.h>
+#include "postgres.h"
-#include <access/heapam.h>
-#include <utils/mcxt.h>
+#include "access/heapam.h"
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
static void InitHeapAccessStatistics(void);
* ----------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
+#include "access/genam.h"
-#include <utils/catcache.h>
-#include <access/genam.h>
-#include <storage/bufmgr.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
/* ----------------------------------------------------------------
* general access method routines
#include "postgres.h"
-#include "miscadmin.h"
#include "access/heapam.h"
#include "access/istrat.h"
#include "catalog/catname.h"
#include "catalog/pg_amproc.h"
#include "catalog/pg_index.h"
#include "catalog/pg_operator.h"
+#include "miscadmin.h"
#include "utils/syscache.h"
-#include "fmgr.h"
-#include "utils/memutils.h" /* could have been access/itup.h */
#ifdef USE_ASSERT_CHECKING
static bool StrategyEvaluationIsValid(StrategyEvaluation evaluation);
*-------------------------------------------------------------------------
*/
-#include <string.h>
-#include <postgres.h>
+#include "postgres.h"
-#include <utils/builtins.h>
-#include <utils/nabstime.h>
+#include "utils/builtins.h"
int32
btint2cmp(int16 a, int16 b)
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <utils/memutils.h>
-#include <storage/bufpage.h>
-#include <access/nbtree.h>
-#include <access/heapam.h>
-#include <access/xact.h>
-#include <fmgr.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "access/heapam.h"
+#include "access/nbtree.h"
+
static InsertIndexResult _bt_insertonpg(Relation rel, Buffer buf, BTStack stack, int keysz, ScanKey scankey, BTItem btitem, BTItem afteritem);
static Buffer _bt_split(Relation rel, Buffer buf, OffsetNumber firstright);
itemsz = IndexTupleDSize(btitem->bti_itup)
+ (sizeof(BTItemData) - sizeof(IndexTupleData));
- itemsz = DOUBLEALIGN(itemsz); /* be safe, PageAddItem will do
+ itemsz = MAXALIGN(itemsz); /* be safe, PageAddItem will do
* this but we need to be
* consistent */
if (currsize > maxsize)
maxsize = currsize;
maxsize += sizeof(PageHeaderData) +
- DOUBLEALIGN(sizeof(BTPageOpaqueData));
+ MAXALIGN(sizeof(BTPageOpaqueData));
if (maxsize >= PageGetPageSize(page) / 2)
do_split = true;
}
maxoff = PageGetMaxOffsetNumber(page);
llimit = PageGetPageSize(page) - sizeof(PageHeaderData) -
- DOUBLEALIGN(sizeof(BTPageOpaqueData))
+ MAXALIGN(sizeof(BTPageOpaqueData))
+sizeof(ItemIdData);
llimit /= 2;
firstright = _bt_findsplitloc(rel, page, start, maxoff, llimit);
* then we must forse insertion.
*/
if (!parent_chained &&
- DOUBLEALIGN(IndexTupleDSize(lowLeftItem->bti_itup)) ==
- DOUBLEALIGN(IndexTupleDSize(stack->bts_btitem->bti_itup)))
+ MAXALIGN(IndexTupleDSize(lowLeftItem->bti_itup)) ==
+ MAXALIGN(IndexTupleDSize(stack->bts_btitem->bti_itup)))
{
_bt_updateitem(rel, keysz, pbuf,
stack->bts_btitem, lowLeftItem);
/* add passed hikey */
itemsz = IndexTupleDSize(hikey->bti_itup)
+ (sizeof(BTItemData) - sizeof(IndexTupleData));
- itemsz = DOUBLEALIGN(itemsz);
+ itemsz = MAXALIGN(itemsz);
if (PageAddItem(page, (Item) hikey, itemsz, P_HIKEY, LP_USED) == InvalidOffsetNumber)
elog(FATAL, "btree: failed to add hikey in _bt_shift");
pfree(hikey);
/* add btitem */
itemsz = IndexTupleDSize(btitem->bti_itup)
+ (sizeof(BTItemData) - sizeof(IndexTupleData));
- itemsz = DOUBLEALIGN(itemsz);
+ itemsz = MAXALIGN(itemsz);
if (PageAddItem(page, (Item) btitem, itemsz, P_FIRSTKEY, LP_USED) == InvalidOffsetNumber)
elog(FATAL, "btree: failed to add firstkey in _bt_shift");
pfree(btitem);
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
#include <time.h>
-#include <postgres.h>
+#include "postgres.h"
-#include <storage/bufpage.h>
-#include <access/nbtree.h>
-#include <miscadmin.h>
-#include <storage/lmgr.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "access/nbtree.h"
+#include "miscadmin.h"
#define BTREE_METAPAGE 0
#define BTREE_MAGIC 0x053162
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <access/genam.h>
-#include <storage/bufpage.h>
-#include <storage/bufmgr.h>
-#include <access/nbtree.h>
-#include <executor/executor.h>
-#include <access/heapam.h>
-#include <catalog/index.h>
-#include <miscadmin.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "access/genam.h"
+#include "access/heapam.h"
+#include "access/nbtree.h"
+#include "catalog/index.h"
+#include "executor/executor.h"
+#include "miscadmin.h"
#ifdef BTREE_BUILD_STATS
-#include <tcop/tcopprot.h>
-#include <utils/trace.h>
#define ShowExecutorStats pg_options[TRACE_EXECUTORSTATS]
#endif
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <storage/bufpage.h>
-#include <access/nbtree.h>
+#include "access/nbtree.h"
typedef struct BTScanListData
{
#include "postgres.h"
#include "access/nbtree.h"
-#include "storage/bufpage.h"
-#include "utils/memutils.h"
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
#ifdef BTREE_BUILD_STATS
-#include "tcop/tcopprot.h"
-#include <utils/trace.h>
#define ShowExecutorStats pg_options[TRACE_EXECUTORSTATS]
#endif
* are potentially reading a bunch of zeroes off of disk in many
* cases.
*
- * BTItems are packed in and DOUBLEALIGN'd.
+ * BTItems are packed in and MAXALIGN'd.
*
* the fd should not be going out to disk, strictly speaking, but it's
* the only thing like that so i'm not going to worry about wasting a
return (BTItem) NULL;
bti = (BTItem) *pos;
itemsz = BTITEMSZ(bti);
- *pos += DOUBLEALIGN(itemsz);
+ *pos += MAXALIGN(itemsz);
return bti;
}
{
memcpy(tape->bttb_data + tape->bttb_top, item, itemsz);
++tape->bttb_ntup;
- tape->bttb_top += DOUBLEALIGN(itemsz);
+ tape->bttb_top += MAXALIGN(itemsz);
}
/*-------------------------------------------------------------------------
itape = btspool->bts_itape[btspool->bts_tape];
itemsz = BTITEMSZ(btitem);
- itemsz = DOUBLEALIGN(itemsz);
+ itemsz = MAXALIGN(itemsz);
/*
* if this buffer is too full for this BTItemData, or if we have run
* BTItemDatas in the order dictated by the sorted array of
* BTItems, not the original order.
*
- * (since everything was DOUBLEALIGN'd and is all on a single tape
+ * (since everything was MAXALIGN'd and is all on a single tape
* block, everything had *better* still fit on one tape block..)
*/
otape = btspool->bts_otape[btspool->bts_tape];
{
bti = parray[i].btsk_item;
btisz = BTITEMSZ(bti);
- btisz = DOUBLEALIGN(btisz);
+ btisz = MAXALIGN(btisz);
_bt_tapeadd(otape, bti, btisz);
#if defined(FASTBUILD_DEBUG) && defined(FASTBUILD_SPOOL)
{
pgspc = PageGetFreeSpace(npage);
btisz = BTITEMSZ(bti);
- btisz = DOUBLEALIGN(btisz);
+ btisz = MAXALIGN(btisz);
if (pgspc < btisz)
{
Buffer obuf = nbuf;
if (bti != (BTItem) NULL)
{
btisz = BTITEMSZ(bti);
- btisz = DOUBLEALIGN(btisz);
+ btisz = MAXALIGN(btisz);
if (doleaf)
{
_bt_buildadd(index, state, bti, BTP_LEAF);
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <access/istrat.h>
-#include <storage/bufpage.h>
-#include <access/nbtree.h>
+#include "access/istrat.h"
+#include "access/nbtree.h"
/*
* Note:
#include "postgres.h"
#include "access/genam.h"
-#include "access/iqual.h"
#include "access/istrat.h"
#include "access/nbtree.h"
#include "executor/execdebug.h"
-#include "fmgr.h"
-#include "storage/bufpage.h"
extern int NIndexTupleProcessed;
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
ScanKey
_bt_mkscankey(Relation rel, IndexTuple itup)
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <storage/bufmgr.h>
-#include <access/sdir.h>
-#include <access/relscan.h>
-#include <access/iqual.h>
-#include <access/rtree.h>
-#include <storage/bufpage.h>
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "access/iqual.h"
+#include "access/rtree.h"
+
static OffsetNumber findnext(IndexScanDesc s, Page p, OffsetNumber n,
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <utils/builtins.h>
-#include <utils/geo_decls.h>
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "utils/builtins.h"
+
BOX
*
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <access/genam.h>
-#include <catalog/index.h>
-#include <access/rtscan.h>
-#include <storage/lmgr.h>
-#include <access/rtree.h>
-#include <storage/bufmgr.h>
-#include <utils/geo_decls.h>
-#include <executor/executor.h>
-#include <access/heapam.h>
-#include <fmgr.h>
-#include <storage/bufpage.h>
-
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "access/genam.h"
+#include "access/heapam.h"
+#include "access/rtree.h"
+#include "catalog/index.h"
+#include "executor/executor.h"
+#include "utils/geo_decls.h"
+
typedef struct SPLITVEC
{
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-
-#include <storage/bufmgr.h>
-#include <access/genam.h>
-#include <storage/lmgr.h>
-#include <storage/bufpage.h>
-#include <access/rtree.h>
-#include <access/rtstrat.h>
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "postgres.h"
+
+#include "access/genam.h"
+#include "access/rtree.h"
+
/* routines defined and used here */
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <utils/rel.h>
-#include <access/rtree.h>
-#include <access/istrat.h>
+#include "access/istrat.h"
+#include "access/rtree.h"
static StrategyNumber RelationGetRTStrategy(Relation r,
AttrNumber attnum, RegProcedure proc);
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
+#include "postgres.h"
-#include <access/transam.h>
-#include <utils/bit.h>
-#include <access/xact.h>
-#include <storage/lmgr.h>
+#include "access/xact.h"
+#include "utils/bit.h"
static XidStatus TransBlockGetXidStatus(Block tblock,
TransactionId transactionId);
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <postgres.h>
-#include <access/xact.h>
+#include "postgres.h"
+#include "access/xact.h"
extern TransactionId NullTransactionId;
extern TransactionId DisabledTransactionId;
*/
#include <string.h>
-#include <postgres.h>
+#include "postgres.h"
#include "utils/fmgrtab.h"
FuNkYfMgRtAbStUfF
CFLAGS += -I../..
+# seems to be required for some date/time stuff 1999/07/22 bjm
+ifeq ($(CPU),alpha)
+ifeq ($(CC), gcc)
+CFLAGS+= -mieee
+endif
+ifeq ($(CC), egcs)
+CFLAGS+= -mieee
+endif
+endif
+
ifdef MULTIBYTE
CFLAGS+= $(MBFLAGS)
endif
ifeq (depend,$(wildcard depend))
include depend
endif
-
*-------------------------------------------------------------------------
*/
#include <ctype.h>
-#include <string.h>
#include "postgres.h"
-#include <utils/memutils.h>
-#include "utils/acl.h"
-#include "utils/syscache.h"
#include "catalog/catalog.h"
#include "catalog/pg_shadow.h"
#include "catalog/pg_type.h"
#include "miscadmin.h"
+#include "utils/acl.h"
+#include "utils/memutils.h"
+#include "utils/syscache.h"
static char *getid(char *s, char *n);
static int32 aclitemeq(AclItem *a1, AclItem *a2);
*/
#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
#include "postgres.h"
+
#include "catalog/catalog.h"
#include "catalog/pg_type.h"
-
-#include "utils/syscache.h"
-#include "utils/memutils.h"
-#include "storage/fd.h"
#include "fmgr.h"
-#include "utils/array.h"
-#include "utils/elog.h"
-
-#include "libpq/libpq-fs.h"
#include "libpq/be-fsstubs.h"
+#include "libpq/libpq-fs.h"
+#include "storage/fd.h"
+#include "utils/array.h"
+#include "utils/memutils.h"
+#include "utils/syscache.h"
#define ASSGN "="
if (values[i])
{
if (typalign == 'd')
- *nbytes += DOUBLEALIGN(*(int32 *) values[i]);
+ *nbytes += MAXALIGN(*(int32 *) values[i]);
else
*nbytes += INTALIGN(*(int32 *) values[i]);
}
#define WEAK_C_OPTIMIZER
#include "postgres.h"
-
#include "utils/array.h"
-
int
GetOffset(int n, int *dim, int *lb, int *indx)
{
*-------------------------------------------------------------------------
*/
-#include <string.h>
#include "postgres.h"
-#include "utils/builtins.h" /* where the declarations go */
-#include "utils/palloc.h"
+#include "utils/builtins.h"
/*****************************************************************************
* USER I/O ROUTINES *
* $Header$
*/
-#include <stdio.h>
-#include <string.h>
#include <limits.h>
#include <ctype.h>
#include <locale.h>
#ifdef USE_LOCALE
static struct lconv *lconvert = NULL;
-
#endif
/* cash_in()
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h> /* for sprintf() */
-#include <string.h>
#include "postgres.h"
-#include "utils/palloc.h"
-#include "utils/builtins.h" /* where the declarations go */
+#include "utils/builtins.h"
/*****************************************************************************
* USER I/O ROUTINES *
#include <fcntl.h>
#include "postgres.h"
-#include "fmgr.h"
#include "catalog/pg_type.h"
+#include "fmgr.h"
#include "libpq/be-fsstubs.h"
#include "libpq/libpq-fs.h"
#include "optimizer/internal.h"
#include "utils/array.h"
#include "utils/memutils.h"
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
-
#define INFTY 500000000
#define MANY 10000
#define MAXPAT 20
*-------------------------------------------------------------------------
*/
#include <ctype.h>
-#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <string.h>
#include "postgres.h"
-#include "miscadmin.h"
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
+
#include "access/xact.h"
-#include "utils/builtins.h" /* where function declarations go */
-#include "utils/palloc.h"
+#include "miscadmin.h"
+#include "utils/builtins.h"
#include "utils/dt.h"
#define INVALID_RELTIME_STR "Undefined RelTime"
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h> /* for sprintf() */
-#include <string.h>
#include <limits.h>
#include "postgres.h"
#endif
#include "miscadmin.h"
#include "utils/builtins.h"
-#include "utils/nabstime.h"
-#include "utils/datetime.h"
-#include "access/xact.h"
static int date2tm(DateADT dateVal, int *tzp, struct tm * tm, double *fsec, char **tzn);
* particular instance of the type and about its value.
*
*/
-#include <string.h>
#include "postgres.h"
#include "utils/datum.h"
-#include "catalog/pg_type.h"
-#include "utils/palloc.h"
/*-------------------------------------------------------------------------
* datumGetSize
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
#include <ctype.h>
#include <math.h>
-#include <string.h>
#include <sys/types.h>
#include <errno.h>
#include "postgres.h"
-#include "miscadmin.h"
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
#ifndef USE_POSIX_TIME
#include <sys/timeb.h>
#endif
-#include "utils/builtins.h"
+#include "miscadmin.h"
+#include "utils/builtins.h"
static int DecodeDate(char *str, int fmask, int *tmask, struct tm * tm);
static int DecodeNumber(int flen, char *field,
*-------------------------------------------------------------------------
*/
-#include <string.h>
-#include <stdio.h>
#include <pwd.h>
#include <sys/param.h>
#include "postgres.h"
-#include <miscadmin.h>
-#include "utils/builtins.h" /* where function declarations go */
+#include "miscadmin.h"
+#include "utils/builtins.h"
char *
filename_in(char *file)
* for calls to pow(), exp() since on some machines (my Linux box
* included) these routines do not set errno. - tgl 97/05/10
*/
-#include <stdio.h> /* for sprintf() */
-#include <string.h>
#include <ctype.h>
-#include <stdlib.h>
#include <errno.h>
#include <float.h> /* faked on sunos4 */
#include <limits.h>
#endif
#include "fmgr.h"
-#include "utils/builtins.h" /* for ftod() prototype */
-#include "utils/palloc.h"
+#include "utils/builtins.h"
#ifndef NAN
#define NAN (0.0/0.0)
* until the distributions are updated.
* --djm 12/16/96
*/
-#if ( defined(linux) && defined(__alpha) ) && !defined(UNSAFE_FLOATS)
+#if ( defined(linux) && defined(__alpha__) ) && !defined(UNSAFE_FLOATS)
#define UNSAFE_FLOATS
#endif
#include <math.h>
#include <limits.h>
#include <float.h>
-#include <stdio.h> /* for sprintf proto, etc. */
-#include <stdlib.h> /* for strtod, etc. */
-#include <string.h>
#include <ctype.h>
#include "postgres.h"
#include "utils/geo_decls.h"
-#include "utils/palloc.h"
#ifndef PI
#define PI 3.1415926536
*/
#include "postgres.h"
-#include "access/attnum.h"
-#include "utils/geo_decls.h" /* where function declarations go */
-#include "utils/palloc.h"
#include "utils/builtins.h"
float64
#include <arpa/inet.h>
#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <postgres.h>
-#include <utils/builtins.h>
+#include "postgres.h"
+#include "utils/builtins.h"
#ifdef SPRINTF_CHAR
#define SPRINTF(x) strlen(sprintf/**/x)
#include <assert.h>
#include <ctype.h>
#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <postgres.h>
-#include <utils/builtins.h>
+#include "postgres.h"
+#include "utils/builtins.h"
#ifdef SPRINTF_CHAR
#define SPRINTF(x) strlen(sprintf/**/x)
* XXX makes massive and possibly unwarranted type promotion assumptions.
* fix me when we figure out what we want to do about ANSIfication...
*/
-#include <stdio.h>
-#include <string.h>
+
+#include "postgres.h"
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
-#include "postgres.h"
-#include "fmgr.h"
-#include "utils/builtins.h" /* where the declarations go */
+#include "utils/builtins.h"
#ifndef SHRT_MAX
#define SHRT_MAX (0x7FFF)
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h> /* for sprintf proto, etc. */
-#include <stdlib.h> /* for strtod, etc. */
-#include <string.h>
#include <ctype.h>
#include <time.h>
#include <math.h>
#include <limits.h>
#include "postgres.h"
-#include "utils/palloc.h"
#include "utils/int8.h"
#define MAXINT8LEN 25
*
*-------------------------------------------------------------------------
*/
-#include <string.h>
-#include "postgres.h" /* postgres system include file */
-#include "utils/palloc.h"
-#include "utils/builtins.h" /* where the function declarations go */
+#include "postgres.h"
#include "mb/pg_wchar.h"
+#include "utils/builtins.h"
static int like(pg_wchar * text, pg_wchar * p);
}
-/* $Revision: 1.25 $
+/* $Revision: 1.25.2.1 $
** "like.c" A first attempt at a LIKE operator for Postgres95.
**
** Originally written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986.
* $Id$
*/
-#include <stdio.h>
-#include <string.h>
-#include <postgres.h>
-#include <utils/palloc.h>
-#include <utils/builtins.h>
-#include <utils/inet.h>
+#include "postgres.h"
+#include "utils/builtins.h"
manufacturer manufacturers[] = {
{0x00, 0x00, 0x0C, "Cisco"},
#include <sys/file.h>
#include <time.h>
#include "postgres.h"
-#include "utils/datum.h"
-#include "catalog/pg_type.h"
#include "utils/builtins.h"
/*-------------------------------------------------------------------------
* $Id$
*
*/
-#include <stdio.h>
#include <ctype.h>
-#include <string.h>
#include <sys/types.h>
#include "postgres.h"
-#include <miscadmin.h>
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
#ifndef USE_POSIX_TIME
#include <sys/timeb.h>
#endif
-#include "utils/builtins.h"
+
#include "access/xact.h"
+#include "miscadmin.h"
+#include "utils/builtins.h"
static AbsoluteTime tm2abstime(struct tm * tm, int tz);
break;
default:
abstime2tm(time, &tz, tm, tzn);
-#if DATEDEBUG
-#endif
EncodeDateTime(tm, fsec, &tz, &tzn, DateStyle, buf);
break;
}
*
*-------------------------------------------------------------------------
*/
-#include <string.h>
#include "postgres.h"
-#include "utils/builtins.h" /* where the declarations go */
-#include "utils/palloc.h" /* where the declarations go */
+#include "utils/builtins.h"
/*****************************************************************************
* USER I/O ROUTINES (none) *
#include <sys/types.h>
#include <sys/socket.h>
-#include <stdio.h>
-#include <string.h>
#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <postgres.h>
-#include <utils/palloc.h>
-#include <utils/builtins.h>
-#include <utils/inet.h>
+#include "postgres.h"
+#include "utils/builtins.h"
static int v4bitncmp(unsigned int a1, unsigned int a2, int bits);
* columns are ******REALLY****** implemented!!!!!!!!!!!
*
*/
-#include <stdio.h>
-#include <string.h>
+
#include "postgres.h"
#include "access/heapam.h"
-#include "access/relscan.h"
-#include "utils/builtins.h" /* where function decls go */
+#include "utils/builtins.h"
static int my_varattno(Relation rd, char *a);
* ----------
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <ctype.h>
#include <float.h>
#include <math.h>
#include "postgres.h"
#include "utils/builtins.h"
-#include "utils/palloc.h"
#include "utils/numeric.h"
-
/* ----------
* Uncomment the following to enable compilation of dump_numeric()
* and dump_var() and to get a dump of any result produced by make_result().
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h> /* for sprintf() */
#include <errno.h>
#include <math.h>
+
+#include "postgres.h"
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
-#include "postgres.h"
-#include "utils/builtins.h" /* where the declarations go */
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "utils/builtins.h"
#ifndef INT_MAX
#define INT_MAX (0x7FFFFFFFL)
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <string.h>
#include "postgres.h"
-#include "utils/builtins.h" /* where function declarations go */
+#include "utils/builtins.h"
/*****************************************************************************
* USER I/O ROUTINES *
#include <ctype.h>
#include "postgres.h"
-
text *lower(text *string);
text *upper(text *string);
text *initcap(text *string);
*
*-------------------------------------------------------------------------
*/
-#include <string.h>
-#include "postgres.h" /* postgres system include file */
+#include "postgres.h"
-#include <regex/regex.h>
-#include "utils/builtins.h" /* where the function declarations go */
+#include "regex/regex.h"
+#include "utils/builtins.h"
#if defined(DISABLE_XOPEN_NLS)
#undef _XOPEN_SOURCE
*
*-------------------------------------------------------------------------
*/
-#include <string.h>
#include "postgres.h"
-#include "miscadmin.h"
-#include "access/heapam.h"
-#include "access/genam.h"
-#include "access/itup.h"
-#include "access/relscan.h"
-#include "storage/bufmgr.h"
-#include "fmgr.h"
-#include "utils/palloc.h"
-#include "utils/syscache.h"
+#include "access/genam.h"
+#include "access/heapam.h"
#include "catalog/catname.h"
#include "catalog/indexing.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
-#include "utils/builtins.h" /* where function declarations go */
+#include "miscadmin.h"
+#include "utils/builtins.h"
+#include "utils/syscache.h"
/*****************************************************************************
* USER I/O ROUTINES *
*
**********************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
#include <unistd.h>
#include <fcntl.h>
-#include <string.h>
+#include "postgres.h"
#include "executor/spi.h"
-#include "commands/trigger.h"
-#include "utils/elog.h"
-#include "utils/builtins.h"
-#include "nodes/nodes.h"
#include "optimizer/clauses.h"
-#include "utils/syscache.h"
#include "utils/lsyscache.h"
-#include "catalog/pg_class.h"
-#include "catalog/pg_type.h"
#include "catalog/pg_shadow.h"
#include "catalog/pg_index.h"
-#include "catalog/pg_opclass.h"
-#include "fmgr.h"
#define BUFSIZE 8192
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <string.h>
#include "postgres.h"
#include "access/heapam.h"
-#include "fmgr.h"
-#include "utils/builtins.h" /* for textout() prototype and where the
- * declarations go */
-#include "utils/palloc.h"
-
#include "catalog/catname.h"
-#include "utils/syscache.h"
-#include "utils/lsyscache.h" /* for get_oprrest() */
#include "catalog/pg_statistic.h"
+#include "utils/builtins.h"
+#include "utils/lsyscache.h"
+#include "utils/syscache.h"
/* N is not a valid var/constant or relation id */
#define NONVALUE(N) ((N) == -1)
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h> /* for sprintf() */
-#include <string.h>
#include "postgres.h"
#include "access/heapam.h"
-#include "access/relscan.h"
-#include "access/xact.h"
-#include "catalog/pg_proc.h" /* for Form_pg_proc */
-#include "catalog/catname.h" /* for ProcedureRelationName */
-#include "catalog/indexing.h" /* for Num_pg_proc_indices */
-#include "fmgr.h"
-#include "storage/lmgr.h"
-#include "tcop/dest.h"
-#include "utils/sets.h" /* for GENERICSETNAME */
-#include "utils/syscache.h" /* for PROOID */
-#include "utils/tqual.h"
+#include "catalog/catname.h"
+#include "catalog/indexing.h"
+#include "catalog/pg_proc.h"
+#include "utils/sets.h"
+#include "utils/syscache.h"
extern CommandDest whereToSendOutput; /* defined in tcop/postgres.c */
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h> /* for sprintf() */
-#include <string.h>
-#include "postgres.h"
-#include "storage/bufpage.h"
-
-#include "utils/palloc.h"
-#include "utils/builtins.h" /* where function declarations go */
+#include "postgres.h"
+#include "utils/builtins.h"
#define LDELIM '('
#define RDELIM ')'
-#include <stdio.h>
-#include <string.h>
#include <time.h>
#include <ctype.h>
+
#include "postgres.h"
+#include "access/xact.h"
#include "miscadmin.h"
#include "utils/builtins.h"
-#include "access/xact.h"
time_t
timestamp_in(const char *timestamp_str)
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h> /* for sprintf() */
-#include <string.h>
+
#include "postgres.h"
#include "access/htup.h"
-#include "utils/array.h"
-#include "utils/builtins.h"
#include "catalog/pg_type.h"
+#include "utils/builtins.h"
+
+#ifdef MULTIBYTE
+#include "mb/pg_wchar.h"
+#endif
#ifdef CYR_RECODE
char *convertstr(char *, int, int);
-
#endif
-#include "mb/pg_wchar.h"
/*
* CHAR() and VARCHAR() types are part of the ANSI SQL standard. CHAR()
*-------------------------------------------------------------------------
*/
#include <ctype.h>
-#include <string.h>
#include "postgres.h"
-#include "utils/palloc.h"
-#include "utils/builtins.h" /* where function declarations go */
#include "mb/pg_wchar.h"
+#include "utils/builtins.h"
static int text_cmp(text *arg1, text *arg2);
*-------------------------------------------------------------------------
*/
-#include <string.h>
#include "postgres.h"
#include "version.h"
*
*-------------------------------------------------------------------------
*/
-#include <string.h>
#include "postgres.h"
-#include "access/heapam.h"
#include "access/genam.h"
-#include "utils/tqual.h"
-#include "utils/builtins.h"
-#include "utils/portal.h"
-#include "utils/catcache.h"
-#include "utils/elog.h"
-#include "utils/palloc.h"
-#include "utils/mcxt.h"
-#include "utils/rel.h"
-#include "storage/bufpage.h"
+#include "access/heapam.h"
#include "access/valid.h"
+#include "catalog/pg_type.h"
#include "miscadmin.h"
-#include "fmgr.h" /* for F_BOOLEQ, etc. DANGER */
-#include "catalog/pg_type.h" /* for OID of int28 type */
-#include "lib/dllist.h"
+#include "utils/builtins.h"
+#include "utils/catcache.h"
static void CatCacheRemoveCTup(CatCache *cache, Dlelem *e);
static Index CatalogCacheComputeHashIndex(struct catcache * cacheInP);
*/
#include "postgres.h"
-#include <miscadmin.h>
-
-#include "access/heapam.h" /* XXX to support hacks below */
-#include "access/htup.h"
#include "catalog/catalog.h"
+#include "catalog/catname.h"
#include "catalog/heap.h"
-#include "storage/bufpage.h"
-#include "storage/buf.h" /* XXX for InvalidBuffer */
-#include "storage/ipc.h"
+#include "miscadmin.h"
#include "storage/sinval.h"
#include "utils/catcache.h"
#include "utils/inval.h"
-#include "utils/rel.h"
#include "utils/relcache.h"
-#include "catalog/catname.h" /* XXX to support hacks below */
-#include "utils/syscache.h" /* XXX to support the hacks below */
static InvalidationEntry InvalidationEntryAllocate(uint16 size);
static void LocalInvalidInvalidate(LocalInvalid invalid, void (*function) ());
* Eventually, the index information should go through here, too.
*-------------------------------------------------------------------------
*/
-#include <string.h>
#include "postgres.h"
-#include "nodes/pg_list.h"
-#include "utils/syscache.h"
-#include "utils/lsyscache.h"
-#include "access/tupmacs.h"
-#include "utils/rel.h"
-#include "utils/palloc.h"
-#include "utils/elog.h"
-#include "access/attnum.h"
-#include "access/heapam.h"
-
-#include "catalog/pg_amop.h"
+
#include "catalog/pg_operator.h"
#include "catalog/pg_type.h"
+#include "utils/lsyscache.h"
+#include "utils/syscache.h"
/* ---------- AMOP CACHES ---------- */
/* #define RELREFDEBUG 1 */
#include "postgres.h"
-#include "miscadmin.h"
#include "access/istrat.h"
-#include "access/tupdesc.h"
-#include "utils/rel.h"
-#include "storage/fd.h"
/*
*
*/
#include <sys/types.h>
-#include <stdio.h> /* for sprintf() */
#include <errno.h>
#include <sys/file.h>
#include <fcntl.h>
-#include <string.h>
#include "postgres.h"
#include "access/genam.h"
#include "access/heapam.h"
-#include "access/htup.h"
#include "access/istrat.h"
-#include "access/itup.h"
-#include "access/skey.h"
-#include "access/tupdesc.h"
-#include "access/tupmacs.h"
-#include "access/xact.h"
#include "catalog/catalog.h"
#include "catalog/catname.h"
#include "catalog/index.h"
#include "catalog/indexing.h"
-#include "catalog/pg_aggregate.h"
#include "catalog/pg_attrdef.h"
-#include "catalog/pg_attribute.h"
-#include "catalog/pg_index.h"
-#include "catalog/pg_proc.h"
-#include "catalog/pg_class.h"
#include "catalog/pg_log.h"
+#include "catalog/pg_proc.h"
#include "catalog/pg_relcheck.h"
#include "catalog/pg_rewrite.h"
#include "catalog/pg_type.h"
#include "catalog/pg_variable.h"
-#include "fmgr.h"
#include "lib/hasht.h"
#include "miscadmin.h"
-#include "storage/buf.h"
-#include "storage/bufmgr.h"
-#include "storage/fd.h" /* for SEEK_ */
-#include "storage/lmgr.h"
#include "storage/smgr.h"
#include "utils/builtins.h"
#include "utils/catcache.h"
-#include "utils/hsearch.h"
-#include "utils/mcxt.h"
-#include "utils/memutils.h"
-#include "utils/rel.h"
#include "utils/relcache.h"
-#include "utils/syscache.h"
static void RelationFlushRelation(Relation *relationPtr,
#include "postgres.h"
#include "access/heapam.h"
-#include "access/htup.h"
#include "catalog/catname.h"
-#include "utils/catcache.h"
-#include <string.h>
-
-
-/* ----------------
- * hardwired attribute information comes from system catalog files.
- * ----------------
- */
-#include "catalog/pg_am.h"
+#include "catalog/pg_aggregate.h"
#include "catalog/pg_amop.h"
-#include "catalog/pg_attribute.h"
#include "catalog/pg_group.h"
#include "catalog/pg_index.h"
#include "catalog/pg_inherits.h"
#include "catalog/pg_language.h"
+#include "catalog/pg_listener.h"
#include "catalog/pg_opclass.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_proc.h"
-#include "catalog/pg_class.h"
-#include "catalog/pg_type.h"
#include "catalog/pg_rewrite.h"
-#include "catalog/pg_aggregate.h"
#include "catalog/pg_shadow.h"
-#include "storage/large_object.h"
-#include "catalog/pg_listener.h"
+#include "catalog/pg_type.h"
+#include "utils/catcache.h"
extern bool AMI_OVERRIDE; /* XXX style */
*/
#include <sys/types.h>
-#include <stdio.h>
-#include <string.h>
#include "postgres.h"
-#include "miscadmin.h"
-#include "nodes/pg_list.h"
-#include "utils/mcxt.h"
-#include "utils/temprel.h"
-#include "access/xact.h"
-#include "access/htup.h"
#include "access/heapam.h"
#include "catalog/heap.h"
#include "catalog/index.h"
-#include "catalog/pg_class.h"
+#include "utils/temprel.h"
GlobalMemory CacheCxt;
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
#include <unistd.h>
-#include "postgres.h" /* where the declaration goes */
-#include "utils/module.h"
+#include "postgres.h"
#include "utils/exc.h"
#include "utils/trace.h"
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <string.h>
#include <time.h>
#include <fcntl.h>
#ifndef O_RDONLY
#include <sys/file.h>
#endif /* O_RDONLY */
#include <sys/types.h>
-#include <stdarg.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
+#include "postgres.h"
#ifdef USE_SYSLOG
#include <syslog.h>
#endif
-#include "postgres.h"
-#include "miscadmin.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
+#include "miscadmin.h"
#include "storage/proc.h"
#include "tcop/tcopprot.h"
#include "utils/trace.h"
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h> /* XXX use own I/O routines */
#include <errno.h>
-#include <string.h>
#include "postgres.h"
-#include "utils/exc.h"
#include "storage/ipc.h"
+#include "utils/exc.h"
static void ExcUnCaught(Exception *excP, ExcDetail detail, ExcData data,
ExcMessage message);
#include "postgres.h"
-#include "utils/exc.h" /* where function declarations go */
+#include "utils/exc.h"
void
ExcAbort(const Exception *excP,
#include "postgres.h"
-#include "utils/excid.h"
-
/*****************************************************************************
* Generic Recoverable Exceptions *
*****************************************************************************/
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <stdarg.h>
#include "postgres.h"
#define FormMaxSize 1024
*/
#include <sys/types.h>
#include <sys/stat.h>
-#include <stdio.h>
-#include <string.h>
#include "postgres.h"
-#include "config.h" /* for MAXPATHLEN */
-#include "fmgr.h" /* generated by Gen_fmgrtab.sh */
#include "utils/dynamic_loader.h"
-#include "utils/elog.h"
-#include "utils/builtins.h"
-#include "access/heapam.h"
-#include "nodes/pg_list.h"
-
-#include "dynloader.h"
-
-#ifdef __ultrix
-#include <dl.h>
-#endif
+#include "access/heapam.h"
#include "catalog/catname.h"
-#include "utils/syscache.h"
#include "catalog/pg_proc.h"
+#include "dynloader.h"
+#include "utils/builtins.h"
+#include "utils/syscache.h"
static DynamicFileList *file_list = (DynamicFileList *) NULL;
static DynamicFileList *file_tail = (DynamicFileList *) NULL;
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
#include "postgres.h"
-/* these 2 files are generated by Gen_fmgrtab.sh; contain the declarations */
-#include "fmgr.h"
-#include "utils/fmgrtab.h"
-
-#include "nodes/pg_list.h"
-#include "catalog/pg_proc.h"
#include "catalog/pg_language.h"
-#include "utils/syscache.h"
-#include "nodes/params.h"
-
-#include "utils/builtins.h"
-#include "utils/elog.h"
-
-#include "nodes/parsenodes.h"
+#include "catalog/pg_proc.h"
#include "commands/trigger.h"
+#include "utils/builtins.h"
+#include "utils/fmgrtab.h"
+#include "utils/syscache.h"
/*
* Modified by sullivan@postgres.berkeley.edu April 1990
* changed ctl structure for shared memory
*/
-#include <stdio.h>
-#include <sys/types.h>
-#include <string.h>
-#include "postgres.h"
-#include "utils/dynahash.h"
-#include "utils/hsearch.h"
-#ifndef FRONTEND
-#include "utils/mcxt.h"
-#endif /* !FRONTEND */
-#include "utils/palloc.h"
-#include "utils/memutils.h"
+#include <sys/types.h>
+
+#include "postgres.h"
+#include "utils/dynahash.h"
+#include "utils/hsearch.h"
+#include "utils/memutils.h"
/*
* Fast MOD arithmetic, assuming that y is a power of 2 !
*
*-------------------------------------------------------------------------
*/
-#include <string.h>
#include "postgres.h"
#include "utils/hsearch.h"
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-#include "utils/module.h" /* where the declarations go */
+#include "utils/module.h"
/*
* BypassEnable
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
#include <grp.h>
#include <pwd.h>
-#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "postgres.h"
-#include "miscadmin.h" /* for DebugLvl */
+#include "miscadmin.h"
#ifndef S_IRUSR /* XXX [TRH] should be in a header */
#define S_IRUSR S_IREAD
*-------------------------------------------------------------------------
*/
#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
#include <sys/file.h>
#include <sys/types.h>
#include <math.h>
#include <unistd.h>
#include "postgres.h"
-#include "miscadmin.h" /* where the declarations go */
-#include <storage/backendid.h>
-#include "access/heapam.h"
-#include "storage/sinval.h"
-#include "storage/sinvaladt.h"
-#include "storage/lmgr.h"
-#include "utils/elog.h"
-#include "libpq/pqcomm.h"
#include "catalog/catname.h"
+#include "libpq/pqcomm.h"
+#include "miscadmin.h"
+#include "storage/backendid.h"
+#include "storage/lmgr.h"
ProtocolVersion FrontendProtocol = PG_PROTOCOL_LATEST;
*
*-------------------------------------------------------------------------
*/
-#include <string.h>
-#include <sys/param.h> /* for MAXPATHLEN */
+#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>
-#include <stdio.h>
#include <unistd.h>
-#include <grp.h> /* for getgrgid */
-#include <pwd.h> /* for getpwuid */
+#include <grp.h>
+#include <pwd.h>
#include "postgres.h"
-
-#include "utils/portal.h" /* for EnablePortalManager, etc. */
-#include "utils/exc.h" /* for EnableExceptionHandling, etc. */
-#include "utils/mcxt.h" /* for EnableMemoryContext, etc. */
-#include "utils/elog.h"
-#include "utils/builtins.h"
-
-#include "miscadmin.h" /* where the declarations go */
-
#include "catalog/catname.h"
#include "catalog/pg_shadow.h"
-#include "catalog/pg_proc.h"
+#include "miscadmin.h"
#include "utils/syscache.h"
-#include "storage/fd.h" /* for O_ */
-#include "storage/ipc.h" /* for proc_exit */
/*
* EnableAbortEnvVarName
*-------------------------------------------------------------------------
*/
#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
#include <sys/file.h>
#include <sys/types.h>
#include <math.h>
#include <unistd.h>
#include "postgres.h"
-#include "version.h"
-
-#include <storage/ipc.h>
-#include <storage/backendid.h>
-#include <storage/buf_internals.h>
-#include <storage/smgr.h>
-#include <storage/proc.h>
-#include <utils/relcache.h>
#include "access/heapam.h"
-#include "access/xact.h"
-#include "storage/bufmgr.h"
-#include "access/transam.h" /* XXX dependency problem */
-#include "utils/syscache.h"
-#include "storage/bufpage.h" /* for page layout, for
- * InitMyDatabaseInfo() */
+#include "catalog/catname.h"
+#include "libpq/libpq.h"
+#include "miscadmin.h"
+#include "storage/backendid.h"
+#include "storage/proc.h"
#include "storage/sinval.h"
-#include "storage/sinvaladt.h"
-#include "storage/lmgr.h"
-
-#include "miscadmin.h" /* for global decls */
-#include "utils/portal.h" /* for EnablePortalManager, etc. */
-
-#include "utils/exc.h" /* for EnableExceptionHandling, etc. */
-#include "fmgr.h" /* for EnableDynamicFunctionManager, etc. */
-#include "utils/elog.h"
-#include "utils/palloc.h"
-#include "utils/mcxt.h" /* for EnableMemoryContext, etc. */
+#include "storage/smgr.h"
#include "utils/inval.h"
+#include "utils/portal.h"
+#include "utils/relcache.h"
+#include "utils/syscache.h"
+#include "version.h"
-#include "catalog/catname.h"
#ifdef MULTIBYTE
#include "mb/pg_wchar.h"
#endif
-#include "libpq/libpq.h"
-
static void VerifySystemDatabase(void);
static void VerifyMyDatabase(void);
static void InitCommunication(void);
* $Id$ */
#include <stdlib.h>
+#include <string.h>
#ifdef WIN32
#include "win32.h"
#else
-#if !defined(NO_UNISTD_H)
#include <unistd.h>
#endif
-#endif
-
-#include <string.h>
#include "mb/pg_wchar.h"
* Tatsuo Ishii
* $Id$ */
-#include <stdio.h>
-#include <string.h>
+#include "postgres.h"
+#include "miscadmin.h"
#include "mb/pg_wchar.h"
static int client_encoding = -1;
* testing of utf2wchar()
* $Id$
*/
-#include <regex/regex.h>
-#include <regex/utils.h>
-#include <regex/regex2.h>
+#include "regex/regex.h"
+#include "regex/utils.h"
+#include "regex/regex2.h"
-#include <regex/pg_wchar.h>
+#include "regex/pg_wchar.h"
main()
{
* $Id$
*/
+#include "postgres.h"
#include "mb/pg_wchar.h"
bool
* SUCH DAMAGE.
*/
-#include <mb/pg_wchar.h>
+#include "mb/pg_wchar.h"
int
pg_char_and_wchar_strcmp(s1, s2)
* SUCH DAMAGE.
*/
-#include <mb/pg_wchar.h>
+#include "mb/pg_wchar.h"
int
pg_wchar_strncmp(s1, s2, n)
*
*-------------------------------------------------------------------------
*/
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include "postgres.h"
-#include "access/heapam.h"
#include "access/xact.h"
-#include "catalog/catname.h"
#include "catalog/pg_database.h"
-#include "fmgr.h"
#include "miscadmin.h"
-#include "storage/bufmgr.h"
-#include "storage/bufpage.h"
-#include "utils/builtins.h"
#include "utils/syscache.h"
#ifdef MULTIBYTE
*-------------------------------------------------------------------------
*/
-#include <postgres.h>
-#include <utils/syscache.h>
-#include <catalog/pg_shadow.h>
+#include "postgres.h"
+#include "catalog/pg_shadow.h"
+#include "utils/syscache.h"
bool
superuser(void)
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
#include <unistd.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include "postgres.h"
+
#ifdef USE_SYSLOG
#include <syslog.h>
#endif
-#include "postgres.h"
#include "miscadmin.h"
#include "utils/trace.h"
-#include "libpq/pqsignal.h"
#ifdef USE_SYSLOG
/*
* Jan Wieck
*-------------------------------------------------------------------------
*/
-#include <stdio.h>
#include "postgres.h"
-#include "utils/excid.h" /* for ExhaustedMemory */
-#include "utils/memutils.h" /* where funnction declarations go */
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
+#include "utils/memutils.h"
#undef AllocSetReset
*
*-------------------------------------------------------------------------
*/
-#include <stdio.h> /* XXX for printf debugging */
#include "postgres.h"
-#include "utils/memutils.h"
-#include "utils/module.h"
-#include "utils/excid.h"
-
#include "nodes/memnodes.h"
-#include "nodes/nodes.h"
+#include "utils/excid.h"
+#include "utils/module.h"
-#include "utils/mcxt.h"
-#include "utils/elog.h"
-#include "utils/palloc.h"
#undef MemoryContextAlloc
#undef MemoryContextFree
*/
#include "postgres.h"
-#include "utils/memutils.h" /* where declarations of this file goes */
+#include "utils/memutils.h"
static Pointer OrderedElemGetBase(OrderedElem elem);
static void OrderedElemPush(OrderedElem elem);
*-------------------------------------------------------------------------
*/
-#include <string.h>
#include "postgres.h"
-#include "utils/mcxt.h"
-#include "utils/elog.h"
-#include "utils/palloc.h"
-
#include "nodes/memnodes.h"
* PortalHeapMemory y y y *
*
*/
-#include <stdio.h> /* for sprintf() */
-#include <string.h> /* for strlen, strncpy */
#include "postgres.h"
#include "lib/hasht.h"
#include "utils/module.h"
-#include "utils/excid.h" /* for Unimplemented */
-#include "utils/mcxt.h"
-#include "utils/hsearch.h"
-
-#include "nodes/memnodes.h"
-#include "nodes/nodes.h"
-#include "nodes/pg_list.h"
-#include "nodes/execnodes.h" /* for EState */
-
#include "utils/portal.h"
static void CollectNamedPortals(Portal *portalP, int destroy);
*
*-------------------------------------------------------------------------
*/
-#include <string.h>
-#include <stdio.h>
#include "postgres.h"
-#include "storage/buf.h"
-#include "access/skey.h"
-#include "access/heapam.h"
-#include "access/htup.h"
-#include "utils/rel.h"
-#include "utils/psort.h"
+#include "access/heapam.h"
#include "utils/lselect.h"
/*
* MAXMERGE, MAXTAPES
*
*/
-#include <stdio.h>
#include <math.h>
-#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "postgres.h"
-#include "miscadmin.h"
#include "access/heapam.h"
-#include "access/htup.h"
-#include "access/relscan.h"
-#include "access/skey.h"
#include "executor/execdebug.h"
#include "executor/executor.h"
-#include "nodes/execnodes.h"
-#include "nodes/plannodes.h"
-#include "storage/buf.h"
-#include "storage/fd.h"
-#include "utils/lselect.h"
-#include "utils/portal.h" /* for {Start,End}PortalAllocMode */
+#include "miscadmin.h"
#include "utils/psort.h"
-#include "utils/rel.h"
static bool createfirstrun(Sort *node);
static bool createrun(Sort *node, BufFile *file);
#include "postgres.h"
-#include "access/htup.h"
-#include "access/xact.h"
-#include "storage/bufmgr.h"
-#include "access/transam.h"
-#include "utils/elog.h"
-#include "utils/palloc.h"
#include "utils/tqual.h"
extern bool PostgresIsInitialized;
#ifndef GIST_H
#define GIST_H
-#include <access/funcindex.h>
-#include <access/itup.h>
-#include <access/relscan.h>
-#include <access/sdir.h>
-#include <storage/page.h>
-#include <storage/block.h>
-#include <utils/rel.h>
-#include <storage/off.h>
-
-#include <fmgr.h>
+#include "access/funcindex.h"
+#include "access/itup.h"
+#include "access/relscan.h"
+#include "access/sdir.h"
/*
** You can have as many strategies as you please in GiSTs, as
*/
#ifndef GISTSCAN_H
-#include <access/relscan.h>
-#include <storage/off.h>
-#include <storage/block.h>
-#include <utils/rel.h>
+#include "access/relscan.h"
extern IndexScanDesc gistbeginscan(Relation r, bool fromEnd,
uint16 nkeys, ScanKey key);
#ifndef GISTSTRAT_H
#define GISTSTRAT_H
-#include <access/strat.h>
-#include <utils/rel.h>
+#include "utils/rel.h"
extern StrategyNumber RelationGetGISTStrategy(Relation r,
AttrNumber attnum, RegProcedure proc);
#ifndef HASH_H
#define HASH_H
-#include <access/sdir.h>
-#include <access/funcindex.h>
-#include <storage/bufpage.h>
-#include <access/relscan.h>
-#include <access/itup.h>
-#include <utils/int8.h>
+#include "access/funcindex.h"
+#include "access/itup.h"
+#include "access/relscan.h"
+#include "access/sdir.h"
+#include "utils/int8.h"
/*
* An overflow page is a spare page allocated for storing data whose
#define BMPGSZ_BYTE(metap) ((metap)->hashm_bmsize)
#define BMPGSZ_BIT(metap) ((metap)->hashm_bmsize << BYTE_TO_BIT)
#define HashPageGetBitmap(pg) \
- ((uint32 *) (((char *) (pg)) + DOUBLEALIGN(sizeof(PageHeaderData))))
+ ((uint32 *) (((char *) (pg)) + MAXALIGN(sizeof(PageHeaderData))))
/*
* The number of bits in an ovflpage bitmap which
#ifndef ISTRAT_H
#define ISTRAT_H
-#include <utils/rel.h>
-#include <access/strat.h>
+#include "utils/rel.h"
/*
* StrategyNumberIsValid
#ifndef ITUP_H
#define ITUP_H
-#include <access/ibit.h>
-#include <access/tupmacs.h>
-#include <access/tupdesc.h>
-#include <storage/itemptr.h>
-#include <utils/memutils.h>
+#include "access/ibit.h"
+#include "access/tupdesc.h"
+#include "access/tupmacs.h"
+#include "storage/itemptr.h"
#define MaxIndexAttributeNumber 7
) \
: \
( \
- (Size)DOUBLEALIGN(sizeof(IndexTupleData) + sizeof(IndexAttributeBitMapData)) \
+ (Size)MAXALIGN(sizeof(IndexTupleData) + sizeof(IndexAttributeBitMapData)) \
) \
)
#ifndef RTREE_H
#define RTREE_H
-#include <access/funcindex.h>
-#include <access/itup.h>
-#include <access/relscan.h>
-#include <access/sdir.h>
-#include <access/skey.h>
-#include <access/strat.h>
-#include <storage/block.h>
-#include <storage/off.h>
+#include "access/funcindex.h"
+#include "access/itup.h"
+#include "access/relscan.h"
+#include "access/sdir.h"
/* see rtstrat.c for what all this is about */
#define RTNStrategies 8
#ifndef RTSTRAT_H
#define RTSTRAT_H
-#include <utils/rel.h>
-#include <access/attnum.h>
+#include "utils/rel.h"
extern RegProcedure RTMapOperator(Relation r, AttrNumber attnum,
RegProcedure proc);
#ifndef ARRAY_H
#define ARRAY_H
-#include <stdio.h>
+#include "utils/memutils.h"
typedef struct
{
*/
#define ARR_DATA_PTR(a) \
(((char *) a) + \
- DOUBLEALIGN(sizeof(ArrayType) + 2 * (sizeof(int) * (a)->ndim)))
+ MAXALIGN(sizeof(ArrayType) + 2 * (sizeof(int) * (a)->ndim)))
/*
* The total array header size for an array of dimension n (in bytes).
*/
#define ARR_OVERHEAD(n) \
- (DOUBLEALIGN(sizeof(ArrayType) + 2 * (n) * sizeof(int)))
+ (MAXALIGN(sizeof(ArrayType) + 2 * (n) * sizeof(int)))
/*------------------------------------------------------------------------
* Miscellaneous helper definitions and routines for arrayfuncs.c
*------------------------------------------------------------------------
*/
-/* #if defined(irix5) */
-/* #define RETURN_NULL {*isNull = true; return(0); }*/
- /* #else *//* irix5 */
#define RETURN_NULL {*isNull = true; return(0); }
- /* #endif *//* irix5 */
#define NAME_LEN 30
#define MAX_BUFF_SIZE BLCKSZ
#ifndef BUILTINS_H
#define BUILTINS_H
-#include <storage/itemptr.h>
-#include <utils/array.h>
-#include <utils/geo_decls.h>
-#include <utils/datetime.h>
-#include <utils/nabstime.h>
-#include <utils/int8.h>
-#include <utils/cash.h>
-#include <utils/inet.h>
-#include <utils/rel.h>
-#include <utils/numeric.h>
+#include "storage/itemptr.h"
+#include "utils/array.h"
+#include "utils/datetime.h"
+#include "utils/geo_decls.h"
+#include "utils/inet.h"
+#include "utils/int8.h"
+#include "utils/nabstime.h"
+#include "utils/numeric.h"
/*
* Defined in adt/
#ifndef DATETIME_H
#define DATETIME_H
-#include "utils/dt.h"
-
typedef int32 DateADT;
typedef float8 TimeADT;
#include <time.h>
#include <math.h>
+#include <limits.h>
/*
* DateTime represents absolute time.
#include <sys/types.h>
#include <sys/param.h> /* For MAXPATHLEN */
-#include <postgres.h>
+/* we need this include because port files use them */
+#include "postgres.h"
#ifdef MIN
#undef MIN
#define ABORTX 0x4000 /* abort process after logging */
#endif
-/***S*I***/
/* Increase this to be able to use postmaster -d 3 with complex
* view definitions (which are transformed to very, very large INSERT statements
* and if -d 3 is used the query string of these statements is printed using
#ifndef FCACHE_H
#define FCACHE_H
-#include <fmgr.h>
+#include "fmgr.h"
typedef struct
#ifndef FCACHE2_H
#define FCACHE2_H
-#include <nodes/execnodes.h>
+#include "nodes/execnodes.h"
extern void setFcache(Node *node, Oid foid, List *argList, ExprContext *econtext);
#ifndef INVAL_H
#define INVAL_H
-#include <access/htup.h>
-#include <utils/rel.h>
+#include "access/htup.h"
extern void InitLocalInvalidateData(void);
#ifndef LSELECT_H
#define LSELECT_H
-#include <stdio.h>
-
-#include "access/skey.h"
-#include "access/tupdesc.h"
-#include "access/htup.h"
#include "utils/syscache.h"
struct leftist
#ifndef LSYSCACHE_H
#define LSYSCACHE_H
-#include <access/attnum.h>
-#include <access/htup.h>
+#include "access/htup.h"
extern bool op_class(Oid oprno, int32 opclass, Oid amopid);
extern char *get_attname(Oid relid, AttrNumber attnum);
#ifndef MEMUTILS_H
#define MEMUTILS_H
+/*
+ * This is not needed by this include file, but by almost every file
+ * that includes this file.
+ */
/* ----------------
* Alignment macros: align a length or address appropriately for a given type.
#ifndef _PG_NUMERIC_H_
#define _PG_NUMERIC_H_
-#include "postgres.h"
-
-
/* ----------
* The hardcoded limits and defaults of the numeric data type
* ----------
#ifndef PORTAL_H
#define PORTAL_H
-#include <executor/execdesc.h>
-#include <lib/fstack.h>
-#include <nodes/memnodes.h>
-#include <utils/memutils.h>
+#include "executor/execdesc.h"
+#include "nodes/memnodes.h"
typedef struct PortalBlockData
{
#define TEMPREL_H
#include "access/htup.h"
-#include "access/attnum.h"
void create_temp_relation(char *relname, HeapTuple pg_class_tuple);
void remove_all_temp_relations(void);
#ifndef TQUAL_H
#define TQUAL_H
-#include <access/htup.h>
+#include "access/htup.h"
+#include "access/xact.h"
typedef struct SnapshotData
{
#ifndef TRACE_H
#define TRACE_H
-#include <stdio.h>
#include <string.h>
#include <time.h>
-#include <stdarg.h>
-
-#include "postgres.h"
#ifdef ELOG_TIMESTAMPS
char *tprintf_timestamp(void);