* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/spccache.c,v 1.3 2010/01/06 23:00:02 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/spccache.c,v 1.4 2010/01/07 03:53:08 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
{
Datum datum;
bool isNull;
- MemoryContext octx;
datum = SysCacheGetAttr(TABLESPACEOID,
tp,
opts = NULL;
else
{
- /* XXX should NOT do the parsing work in CacheMemoryContext */
- octx = MemoryContextSwitchTo(CacheMemoryContext);
- opts = (TableSpaceOpts *) tablespace_reloptions(datum, false);
- MemoryContextSwitchTo(octx);
+ bytea *bytea_opts = tablespace_reloptions(datum, false);
+ opts = MemoryContextAlloc(CacheMemoryContext, VARSIZE(bytea_opts));
+ memcpy(opts, bytea_opts, VARSIZE(bytea_opts));
}
ReleaseSysCache(tp);
}
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/commands/tablespace.h,v 1.22 2010/01/05 21:53:59 rhaas Exp $
+ * $PostgreSQL: pgsql/src/include/commands/tablespace.h,v 1.23 2010/01/07 03:53:08 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct TableSpaceOpts
{
+ int32 vl_len_; /* varlena header (do not touch directly!) */
float8 random_page_cost;
float8 seq_page_cost;
} TableSpaceOpts;