mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
pg_class has a relnamespace column. You can create and access tables
in schemas other than the system namespace; however, there's no search path yet, and not all operations work yet on tables outside the system namespace.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.40 2002/03/02 21:39:20 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.41 2002/03/26 19:15:16 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -32,8 +32,10 @@
|
||||
#include "catalog/pg_am.h"
|
||||
#include "catalog/pg_attribute.h"
|
||||
#include "catalog/pg_class.h"
|
||||
#include "catalog/pg_namespace.h"
|
||||
#include "commands/defrem.h"
|
||||
#include "miscadmin.h"
|
||||
#include "nodes/makefuncs.h"
|
||||
#include "nodes/nodes.h"
|
||||
#include "nodes/parsenodes.h"
|
||||
#include "nodes/pg_list.h"
|
||||
@ -179,7 +181,9 @@ Boot_CreateStmt:
|
||||
}
|
||||
|
||||
tupdesc = CreateTupleDesc(numattr, attrtypes);
|
||||
reldesc = heap_create(LexIDStr($4), tupdesc,
|
||||
reldesc = heap_create(LexIDStr($4),
|
||||
PG_CATALOG_NAMESPACE,
|
||||
tupdesc,
|
||||
false, true, true);
|
||||
reldesc->rd_rel->relhasoids = ! ($3);
|
||||
elog(DEBUG3, "bootstrap relation created");
|
||||
@ -191,6 +195,7 @@ Boot_CreateStmt:
|
||||
|
||||
tupdesc = CreateTupleDesc(numattr,attrtypes);
|
||||
id = heap_create_with_catalog(LexIDStr($4),
|
||||
PG_CATALOG_NAMESPACE,
|
||||
tupdesc,
|
||||
RELKIND_RELATION,
|
||||
! ($3),
|
||||
@ -232,7 +237,7 @@ Boot_DeclareIndexStmt:
|
||||
{
|
||||
do_start();
|
||||
|
||||
DefineIndex(LexIDStr($5),
|
||||
DefineIndex(makeRangeVar(NULL, LexIDStr($5)),
|
||||
LexIDStr($3),
|
||||
LexIDStr($7),
|
||||
$9, false, false, NULL, NIL);
|
||||
@ -245,7 +250,7 @@ Boot_DeclareUniqueIndexStmt:
|
||||
{
|
||||
do_start();
|
||||
|
||||
DefineIndex(LexIDStr($6),
|
||||
DefineIndex(makeRangeVar(NULL, LexIDStr($6)),
|
||||
LexIDStr($4),
|
||||
LexIDStr($8),
|
||||
$10, true, false, NULL, NIL);
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.124 2002/03/15 19:20:34 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.125 2002/03/26 19:15:16 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -153,8 +153,8 @@ extern char *optarg;
|
||||
|
||||
typedef struct _IndexList
|
||||
{
|
||||
char *il_heap;
|
||||
char *il_ind;
|
||||
Oid il_heap;
|
||||
Oid il_ind;
|
||||
IndexInfo *il_info;
|
||||
struct _IndexList *il_next;
|
||||
} IndexList;
|
||||
@ -1080,8 +1080,8 @@ AddStr(char *str, int strlength, int mderef)
|
||||
* are present in the index.
|
||||
*/
|
||||
void
|
||||
index_register(char *heap,
|
||||
char *ind,
|
||||
index_register(Oid heap,
|
||||
Oid ind,
|
||||
IndexInfo *indexInfo)
|
||||
{
|
||||
IndexList *newind;
|
||||
@ -1103,8 +1103,8 @@ index_register(char *heap,
|
||||
oldcxt = MemoryContextSwitchTo(nogc);
|
||||
|
||||
newind = (IndexList *) palloc(sizeof(IndexList));
|
||||
newind->il_heap = pstrdup(heap);
|
||||
newind->il_ind = pstrdup(ind);
|
||||
newind->il_heap = heap;
|
||||
newind->il_ind = ind;
|
||||
newind->il_info = (IndexInfo *) palloc(sizeof(IndexInfo));
|
||||
|
||||
memcpy(newind->il_info, indexInfo, sizeof(IndexInfo));
|
||||
@ -1126,8 +1126,8 @@ build_indices()
|
||||
Relation heap;
|
||||
Relation ind;
|
||||
|
||||
heap = heap_openr(ILHead->il_heap, NoLock);
|
||||
ind = index_openr(ILHead->il_ind);
|
||||
heap = heap_open(ILHead->il_heap, NoLock);
|
||||
ind = index_open(ILHead->il_ind);
|
||||
index_build(heap, ind, ILHead->il_info);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user