fix for index problem.
This commit is contained in:
parent
31309423c9
commit
4a70002149
9 changed files with 69 additions and 61 deletions
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.32 1998/08/19 02:01:05 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.33 1998/08/20 22:07:30 momjian Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
|
@ -1274,10 +1274,10 @@ heap_delete(Relation relation, ItemPointer tid)
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
|
heap_replace(Relation relation, ItemPointer otid, HeapTuple replace_tuple)
|
||||||
{
|
{
|
||||||
ItemId lp;
|
ItemId lp;
|
||||||
HeapTuple tp;
|
HeapTuple old_tuple;
|
||||||
Page dp;
|
Page dp;
|
||||||
Buffer buffer;
|
Buffer buffer;
|
||||||
HeapTuple tuple;
|
HeapTuple tuple;
|
||||||
|
@ -1319,8 +1319,8 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
tp = (HeapTuple) PageGetItem(dp, lp);
|
old_tuple = (HeapTuple) PageGetItem(dp, lp);
|
||||||
Assert(HeapTupleIsValid(tp));
|
Assert(HeapTupleIsValid(old_tuple));
|
||||||
|
|
||||||
/* -----------------
|
/* -----------------
|
||||||
* the following test should be able to catch all non-functional
|
* the following test should be able to catch all non-functional
|
||||||
|
@ -1333,7 +1333,7 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
|
||||||
* -----------------
|
* -----------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (TupleUpdatedByCurXactAndCmd(tp))
|
if (TupleUpdatedByCurXactAndCmd(old_tuple))
|
||||||
{
|
{
|
||||||
elog(NOTICE, "Non-functional update, only first update is performed");
|
elog(NOTICE, "Non-functional update, only first update is performed");
|
||||||
if (IsSystemRelationName(RelationGetRelationName(relation)->data))
|
if (IsSystemRelationName(RelationGetRelationName(relation)->data))
|
||||||
|
@ -1367,19 +1367,19 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX order problems if not atomic assignment ??? */
|
/* XXX order problems if not atomic assignment ??? */
|
||||||
tup->t_oid = tp->t_oid;
|
replace_tuple->t_oid = old_tuple->t_oid;
|
||||||
TransactionIdStore(GetCurrentTransactionId(), &(tup->t_xmin));
|
TransactionIdStore(GetCurrentTransactionId(), &(replace_tuple->t_xmin));
|
||||||
tup->t_cmin = GetCurrentCommandId();
|
replace_tuple->t_cmin = GetCurrentCommandId();
|
||||||
StoreInvalidTransactionId(&(tup->t_xmax));
|
StoreInvalidTransactionId(&(replace_tuple->t_xmax));
|
||||||
tup->t_infomask &= ~(HEAP_XACT_MASK);
|
replace_tuple->t_infomask &= ~(HEAP_XACT_MASK);
|
||||||
tup->t_infomask |= HEAP_XMAX_INVALID;
|
replace_tuple->t_infomask |= HEAP_XMAX_INVALID;
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* insert new item
|
* insert new item
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
if ((unsigned) DOUBLEALIGN(tup->t_len) <= PageGetFreeSpace((Page) dp))
|
if ((unsigned) DOUBLEALIGN(replace_tuple->t_len) <= PageGetFreeSpace((Page) dp))
|
||||||
RelationPutHeapTuple(relation, BufferGetBlockNumber(buffer), tup);
|
RelationPutHeapTuple(relation, BufferGetBlockNumber(buffer), replace_tuple);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* ----------------
|
/* ----------------
|
||||||
|
@ -1387,23 +1387,23 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
|
||||||
* for a new place to put it.
|
* for a new place to put it.
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
doinsert(relation, tup);
|
doinsert(relation, replace_tuple);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* new item in place, now record transaction information
|
* new item in place, now record transaction information
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
TransactionIdStore(GetCurrentTransactionId(), &(tp->t_xmax));
|
TransactionIdStore(GetCurrentTransactionId(), &(old_tuple->t_xmax));
|
||||||
tp->t_cmax = GetCurrentCommandId();
|
old_tuple->t_cmax = GetCurrentCommandId();
|
||||||
tp->t_infomask &= ~(HEAP_XMAX_COMMITTED | HEAP_XMAX_INVALID);
|
old_tuple->t_infomask &= ~(HEAP_XMAX_COMMITTED | HEAP_XMAX_INVALID);
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* invalidate caches
|
* invalidate caches
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
SetRefreshWhenInvalidate(ImmediateInvalidation);
|
SetRefreshWhenInvalidate(ImmediateInvalidation);
|
||||||
RelationInvalidateHeapTuple(relation, tp);
|
RelationInvalidateHeapTuple(relation, old_tuple);
|
||||||
SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
|
SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
|
||||||
|
|
||||||
WriteBuffer(buffer);
|
WriteBuffer(buffer);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.58 1998/08/19 02:01:30 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.59 1998/08/20 22:07:32 momjian Exp $
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
* heap_create() - Create an uncataloged heap relation
|
* heap_create() - Create an uncataloged heap relation
|
||||||
|
@ -1051,16 +1051,18 @@ DeletePgAttributeTuples(Relation rel)
|
||||||
*/
|
*/
|
||||||
RelationSetLockForWrite(pg_attribute_desc);
|
RelationSetLockForWrite(pg_attribute_desc);
|
||||||
|
|
||||||
attnum = FirstLowInvalidHeapAttributeNumber + 1; /* cmax */
|
for (attnum = FirstLowInvalidHeapAttributeNumber + 1;
|
||||||
|
attnum <= rel->rd_att->natts;
|
||||||
while (HeapTupleIsValid(tup = SearchSysCacheTupleCopy(ATTNUM,
|
attnum++)
|
||||||
ObjectIdGetDatum(rel->rd_att->attrs[0]->attrelid),
|
{
|
||||||
|
if (HeapTupleIsValid(tup = SearchSysCacheTupleCopy(ATTNUM,
|
||||||
|
ObjectIdGetDatum(RelationGetRelid(rel)),
|
||||||
Int16GetDatum(attnum),
|
Int16GetDatum(attnum),
|
||||||
0, 0)))
|
0, 0)))
|
||||||
{
|
{
|
||||||
heap_delete(pg_attribute_desc, &tup->t_ctid);
|
heap_delete(pg_attribute_desc, &tup->t_ctid);
|
||||||
pfree(tup);
|
pfree(tup);
|
||||||
attnum++;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
|
@ -1104,8 +1106,10 @@ DeletePgTypeTuple(Relation rel)
|
||||||
* to this relation.
|
* to this relation.
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
ScanKeyEntryInitialize(&key, 0, Anum_pg_type_typrelid, F_INT4EQ,
|
ScanKeyEntryInitialize(&key, 0,
|
||||||
rel->rd_att->attrs[0]->attrelid);
|
Anum_pg_type_typrelid,
|
||||||
|
F_OIDEQ,
|
||||||
|
ObjectIdGetDatum(RelationGetRelid(rel)));
|
||||||
|
|
||||||
pg_type_scan = heap_beginscan(pg_type_desc,
|
pg_type_scan = heap_beginscan(pg_type_desc,
|
||||||
0,
|
0,
|
||||||
|
@ -1140,7 +1144,9 @@ DeletePgTypeTuple(Relation rel)
|
||||||
pg_attribute_desc = heap_openr(AttributeRelationName);
|
pg_attribute_desc = heap_openr(AttributeRelationName);
|
||||||
|
|
||||||
ScanKeyEntryInitialize(&attkey,
|
ScanKeyEntryInitialize(&attkey,
|
||||||
0, Anum_pg_attribute_atttypid, F_INT4EQ,
|
0,
|
||||||
|
Anum_pg_attribute_atttypid,
|
||||||
|
F_OIDEQ,
|
||||||
typoid);
|
typoid);
|
||||||
|
|
||||||
pg_attribute_scan = heap_beginscan(pg_attribute_desc,
|
pg_attribute_scan = heap_beginscan(pg_attribute_desc,
|
||||||
|
@ -1151,13 +1157,13 @@ DeletePgTypeTuple(Relation rel)
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* try and get a pg_attribute tuple. if we succeed it means
|
* try and get a pg_attribute tuple. if we succeed it means
|
||||||
* we cant delete the relation because something depends on
|
* we can't delete the relation because something depends on
|
||||||
* the schema.
|
* the schema.
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
atttup = heap_getnext(pg_attribute_scan, 0);
|
atttup = heap_getnext(pg_attribute_scan, 0);
|
||||||
|
|
||||||
if (PointerIsValid(atttup))
|
if (HeapTupleIsValid(atttup))
|
||||||
{
|
{
|
||||||
Oid relid = ((AttributeTupleForm) GETSTRUCT(atttup))->attrelid;
|
Oid relid = ((AttributeTupleForm) GETSTRUCT(atttup))->attrelid;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.49 1998/08/20 15:16:54 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.50 1998/08/20 22:07:34 momjian Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
|
@ -1173,6 +1173,7 @@ index_destroy(Oid indexId)
|
||||||
{
|
{
|
||||||
Relation indexRelation;
|
Relation indexRelation;
|
||||||
Relation catalogRelation;
|
Relation catalogRelation;
|
||||||
|
Relation attributeRelation;
|
||||||
HeapTuple tuple;
|
HeapTuple tuple;
|
||||||
int16 attnum;
|
int16 attnum;
|
||||||
|
|
||||||
|
@ -1200,7 +1201,7 @@ index_destroy(Oid indexId)
|
||||||
* fix ATTRIBUTE relation
|
* fix ATTRIBUTE relation
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
catalogRelation = heap_openr(AttributeRelationName);
|
attributeRelation = heap_openr(AttributeRelationName);
|
||||||
|
|
||||||
attnum = 1; /* indexes start at 1 */
|
attnum = 1; /* indexes start at 1 */
|
||||||
|
|
||||||
|
@ -1209,12 +1210,11 @@ index_destroy(Oid indexId)
|
||||||
Int16GetDatum(attnum),
|
Int16GetDatum(attnum),
|
||||||
0, 0)))
|
0, 0)))
|
||||||
{
|
{
|
||||||
heap_delete(catalogRelation, &tuple->t_ctid);
|
heap_delete(attributeRelation, &tuple->t_ctid);
|
||||||
pfree(tuple);
|
pfree(tuple);
|
||||||
attnum++;
|
attnum++;
|
||||||
}
|
}
|
||||||
|
heap_close(attributeRelation);
|
||||||
heap_close(catalogRelation);
|
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* fix INDEX relation
|
* fix INDEX relation
|
||||||
|
@ -1225,13 +1225,13 @@ index_destroy(Oid indexId)
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
|
|
||||||
if (!HeapTupleIsValid(tuple))
|
if (!HeapTupleIsValid(tuple))
|
||||||
{
|
|
||||||
elog(NOTICE, "IndexRelationDestroy: %s's INDEX tuple missing",
|
elog(NOTICE, "IndexRelationDestroy: %s's INDEX tuple missing",
|
||||||
RelationGetRelationName(indexRelation));
|
RelationGetRelationName(indexRelation));
|
||||||
}
|
|
||||||
heap_delete(catalogRelation, &tuple->t_ctid);
|
Assert(ItemPointerIsValid(&tuple->t_ctid));
|
||||||
|
|
||||||
|
heap_delete(indexRelation, &tuple->t_ctid);
|
||||||
pfree(tuple);
|
pfree(tuple);
|
||||||
heap_close(catalogRelation);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* flush cache and physically remove the file
|
* flush cache and physically remove the file
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.21 1998/08/20 15:16:55 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.22 1998/08/20 22:07:36 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -125,7 +125,7 @@ CatalogIndexInsert(Relation *idescs,
|
||||||
InsertIndexResult indexRes;
|
InsertIndexResult indexRes;
|
||||||
|
|
||||||
indexDescriptor = RelationGetTupleDescriptor(idescs[i]);
|
indexDescriptor = RelationGetTupleDescriptor(idescs[i]);
|
||||||
pgIndexTup = SearchSysCacheTuple(INDEXRELID,
|
pgIndexTup = SearchSysCacheTupleCopy(INDEXRELID,
|
||||||
ObjectIdGetDatum(idescs[i]->rd_id),
|
ObjectIdGetDatum(idescs[i]->rd_id),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
Assert(pgIndexTup);
|
Assert(pgIndexTup);
|
||||||
|
@ -163,6 +163,7 @@ CatalogIndexInsert(Relation *idescs,
|
||||||
&heapTuple->t_ctid, heapRelation);
|
&heapTuple->t_ctid, heapRelation);
|
||||||
if (indexRes)
|
if (indexRes)
|
||||||
pfree(indexRes);
|
pfree(indexRes);
|
||||||
|
pfree(pgIndexTup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.27 1998/08/19 02:01:38 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.28 1998/08/20 22:07:37 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -384,12 +384,12 @@ TypeCreate(char *typeName,
|
||||||
values[i++] = (Datum) GetUserId(); /* 2 */
|
values[i++] = (Datum) GetUserId(); /* 2 */
|
||||||
values[i++] = (Datum) internalSize; /* 3 */
|
values[i++] = (Datum) internalSize; /* 3 */
|
||||||
values[i++] = (Datum) externalSize; /* 4 */
|
values[i++] = (Datum) externalSize; /* 4 */
|
||||||
values[i++] = (Datum) passedByValue; /* 5 */
|
values[i++] = (Datum) passedByValue;/* 5 */
|
||||||
values[i++] = (Datum) typeType; /* 6 */
|
values[i++] = (Datum) typeType; /* 6 */
|
||||||
values[i++] = (Datum) (bool) 1; /* 7 */
|
values[i++] = (Datum) (bool) 1; /* 7 */
|
||||||
values[i++] = (Datum) typDelim; /* 8 */
|
values[i++] = (Datum) typDelim; /* 8 */
|
||||||
values[i++] = (Datum) (typeType == 'c' ? relationOid : InvalidOid); /* 9 */
|
values[i++] = (Datum) (typeType == 'c' ? relationOid : InvalidOid); /* 9 */
|
||||||
values[i++] = (Datum) elementObjectId; /* 10 */
|
values[i++] = (Datum) elementObjectId;/* 10 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* arguments to type input and output functions must be 0
|
* arguments to type input and output functions must be 0
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.75 1998/08/20 15:16:57 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.76 1998/08/20 22:07:39 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -2217,7 +2217,7 @@ vc_mkindesc(Relation onerel, int nindices, Relation *Irel, IndDesc **Idesc)
|
||||||
cachetuple = SearchSysCacheTupleCopy(INDEXRELID,
|
cachetuple = SearchSysCacheTupleCopy(INDEXRELID,
|
||||||
ObjectIdGetDatum(RelationGetRelid(Irel[i])),
|
ObjectIdGetDatum(RelationGetRelid(Irel[i])),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
Assert(tuple);
|
Assert(cachetuple);
|
||||||
|
|
||||||
/* get the buffer cache tuple */
|
/* get the buffer cache tuple */
|
||||||
tuple = heap_fetch(onerel, SnapshotNow, &cachetuple->t_ctid, &buffer);
|
tuple = heap_fetch(onerel, SnapshotNow, &cachetuple->t_ctid, &buffer);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.35 1998/08/19 02:02:01 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.36 1998/08/20 22:07:41 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -690,7 +690,7 @@ ExecGetIndexKeyInfo(IndexTupleForm indexTuple,
|
||||||
* the IndexCatalogInformation function in plancat.c
|
* the IndexCatalogInformation function in plancat.c
|
||||||
* because IndexCatalogInformation is poorly written.
|
* because IndexCatalogInformation is poorly written.
|
||||||
*
|
*
|
||||||
* It would be much better the functionality provided
|
* It would be much better if the functionality provided
|
||||||
* by this function and IndexCatalogInformation was
|
* by this function and IndexCatalogInformation was
|
||||||
* in the form of a small set of orthogonal routines..
|
* in the form of a small set of orthogonal routines..
|
||||||
* If you are trying to understand this, I suggest you
|
* If you are trying to understand this, I suggest you
|
||||||
|
|
3
src/backend/utils/cache/inval.c
vendored
3
src/backend/utils/cache/inval.c
vendored
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.13 1998/08/19 14:51:29 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.14 1998/08/20 22:07:43 momjian Exp $
|
||||||
*
|
*
|
||||||
* Note - this code is real crufty...
|
* Note - this code is real crufty...
|
||||||
*
|
*
|
||||||
|
@ -643,6 +643,7 @@ RelationInvalidateHeapTuple(Relation relation, HeapTuple tuple)
|
||||||
RelationIdRegisterLocalInvalid);
|
RelationIdRegisterLocalInvalid);
|
||||||
|
|
||||||
if (RefreshWhenInvalidate)
|
if (RefreshWhenInvalidate)
|
||||||
|
/* what does this do? bjm 1998/08/20 */
|
||||||
RelationInvalidateCatalogCacheTuple(relation,
|
RelationInvalidateCatalogCacheTuple(relation,
|
||||||
tuple,
|
tuple,
|
||||||
(void (*) ()) NULL);
|
(void (*) ()) NULL);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.49 1998/08/20 15:16:59 momjian Exp $
|
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.50 1998/08/20 22:07:46 momjian Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -404,13 +404,13 @@ echo
|
||||||
PGSQL_OPT="-o /dev/null -F -Q -D$PGDATA"
|
PGSQL_OPT="-o /dev/null -F -Q -D$PGDATA"
|
||||||
|
|
||||||
# If the COPY is first, the VACUUM generates an error, so we vacuum first
|
# If the COPY is first, the VACUUM generates an error, so we vacuum first
|
||||||
echo "vacuuming template1"
|
echo "Vacuuming template1"
|
||||||
echo "vacuum" | postgres $PGSQL_OPT template1 > /dev/null
|
echo "vacuum" | postgres $PGSQL_OPT template1 > /dev/null
|
||||||
|
|
||||||
echo "COPY pg_shadow TO '$PGDATA/pg_pwd' USING DELIMITERS '\\t'" | \
|
echo "COPY pg_shadow TO '$PGDATA/pg_pwd' USING DELIMITERS '\\t'" | \
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
postgres $PGSQL_OPT template1 > /dev/null
|
||||||
|
|
||||||
echo "creating public pg_user view"
|
echo "Creating public pg_user view"
|
||||||
echo "CREATE TABLE xpg_user ( \
|
echo "CREATE TABLE xpg_user ( \
|
||||||
usename name, \
|
usename name, \
|
||||||
usesysid int4, \
|
usesysid int4, \
|
||||||
|
@ -436,7 +436,7 @@ echo "CREATE RULE _RETpg_user AS ON SELECT TO pg_user DO INSTEAD \
|
||||||
echo "REVOKE ALL on pg_shadow FROM public" | \
|
echo "REVOKE ALL on pg_shadow FROM public" | \
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
postgres $PGSQL_OPT template1 > /dev/null
|
||||||
|
|
||||||
echo "loading pg_description"
|
echo "Loading pg_description"
|
||||||
echo "copy pg_description from '$TEMPLATE_DESCR'" | \
|
echo "copy pg_description from '$TEMPLATE_DESCR'" | \
|
||||||
postgres $PGSQL_OPT template1 > /dev/null
|
postgres $PGSQL_OPT template1 > /dev/null
|
||||||
echo "copy pg_description from '$GLOBAL_DESCR'" | \
|
echo "copy pg_description from '$GLOBAL_DESCR'" | \
|
||||||
|
|
Loading…
Reference in a new issue