2004-06-18 02:14:31 -04:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
*
|
|
|
|
|
* tablespace.h
|
2004-08-29 17:08:48 -04:00
|
|
|
* Tablespace management commands (create/drop tablespace).
|
2004-06-18 02:14:31 -04:00
|
|
|
*
|
|
|
|
|
*
|
2011-01-01 13:18:15 -05:00
|
|
|
* Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
|
2004-06-18 02:14:31 -04:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
|
*
|
2010-09-20 16:08:53 -04:00
|
|
|
* src/include/commands/tablespace.h
|
2004-06-18 02:14:31 -04:00
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
#ifndef TABLESPACE_H
|
|
|
|
|
#define TABLESPACE_H
|
|
|
|
|
|
2004-08-29 17:08:48 -04:00
|
|
|
#include "access/xlog.h"
|
2004-06-18 02:14:31 -04:00
|
|
|
#include "nodes/parsenodes.h"
|
|
|
|
|
|
2004-08-29 17:08:48 -04:00
|
|
|
/* XLOG stuff */
|
|
|
|
|
#define XLOG_TBLSPC_CREATE 0x00
|
|
|
|
|
#define XLOG_TBLSPC_DROP 0x10
|
|
|
|
|
|
|
|
|
|
typedef struct xl_tblspc_create_rec
|
|
|
|
|
{
|
|
|
|
|
Oid ts_id;
|
|
|
|
|
char ts_path[1]; /* VARIABLE LENGTH STRING */
|
2005-10-14 22:49:52 -04:00
|
|
|
} xl_tblspc_create_rec;
|
2004-08-29 17:08:48 -04:00
|
|
|
|
|
|
|
|
typedef struct xl_tblspc_drop_rec
|
|
|
|
|
{
|
|
|
|
|
Oid ts_id;
|
2005-10-14 22:49:52 -04:00
|
|
|
} xl_tblspc_drop_rec;
|
2004-06-18 02:14:31 -04:00
|
|
|
|
2010-01-05 16:54:00 -05:00
|
|
|
typedef struct TableSpaceOpts
|
|
|
|
|
{
|
2010-01-06 22:53:08 -05:00
|
|
|
int32 vl_len_; /* varlena header (do not touch directly!) */
|
2010-01-05 16:54:00 -05:00
|
|
|
float8 random_page_cost;
|
|
|
|
|
float8 seq_page_cost;
|
|
|
|
|
} TableSpaceOpts;
|
2004-11-05 14:17:13 -05:00
|
|
|
|
2004-08-29 17:08:48 -04:00
|
|
|
extern void CreateTableSpace(CreateTableSpaceStmt *stmt);
|
2004-06-18 02:14:31 -04:00
|
|
|
extern void DropTableSpace(DropTableSpaceStmt *stmt);
|
2004-08-29 17:08:48 -04:00
|
|
|
extern void RenameTableSpace(const char *oldname, const char *newname);
|
2005-06-28 01:09:14 -04:00
|
|
|
extern void AlterTableSpaceOwner(const char *name, Oid newOwnerId);
|
2010-01-05 16:54:00 -05:00
|
|
|
extern void AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt);
|
2004-06-18 02:14:31 -04:00
|
|
|
|
2004-07-11 15:52:52 -04:00
|
|
|
extern void TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo);
|
2004-06-18 02:14:31 -04:00
|
|
|
|
2010-12-13 12:34:26 -05:00
|
|
|
extern Oid GetDefaultTablespace(char relpersistence);
|
2007-06-07 15:19:57 -04:00
|
|
|
|
|
|
|
|
extern void PrepareTempTablespaces(void);
|
2004-11-05 14:17:13 -05:00
|
|
|
|
2010-08-05 10:45:09 -04:00
|
|
|
extern Oid get_tablespace_oid(const char *tablespacename, bool missing_ok);
|
2004-06-18 02:14:31 -04:00
|
|
|
extern char *get_tablespace_name(Oid spc_oid);
|
|
|
|
|
|
2004-10-17 16:47:21 -04:00
|
|
|
extern bool directory_is_empty(const char *path);
|
|
|
|
|
|
2004-08-29 17:08:48 -04:00
|
|
|
extern void tblspc_redo(XLogRecPtr lsn, XLogRecord *rptr);
|
2006-03-23 23:32:13 -05:00
|
|
|
extern void tblspc_desc(StringInfo buf, uint8 xl_info, char *rec);
|
2004-06-25 17:55:59 -04:00
|
|
|
|
2004-06-18 02:14:31 -04:00
|
|
|
#endif /* TABLESPACE_H */
|