mirror of
https://github.com/postgres/postgres.git
synced 2026-06-06 15:49:28 -04:00
eabc714a91
expressions in CREATE TABLE. There is no longer an emasculated expression syntax for these things; it's full a_expr for constraints, and b_expr for defaults (unfortunately the fact that NOT NULL is a part of the column constraint syntax causes a shift/reduce conflict if you try a_expr. Oh well --- at least parenthesized boolean expressions work now). Also, stored expression for a column default is not pre-coerced to the column type; we rely on transformInsertStatement to do that when the default is actually used. This means "f1 datetime default 'now'" behaves the way people usually expect it to. BTW, all the support code is now there to implement ALTER TABLE ADD CONSTRAINT and ALTER TABLE ADD COLUMN with a default value. I didn't actually teach ALTER TABLE to call it, but it wouldn't be much work.
52 lines
1.4 KiB
C
52 lines
1.4 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* relcache.h
|
|
* Relation descriptor cache definitions.
|
|
*
|
|
*
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* $Id: relcache.h,v 1.15 1999/10/03 23:55:38 tgl Exp $
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef RELCACHE_H
|
|
#define RELCACHE_H
|
|
|
|
#include "utils/rel.h"
|
|
|
|
/*
|
|
* relation lookup routines
|
|
*/
|
|
extern Relation RelationIdCacheGetRelation(Oid relationId);
|
|
extern Relation RelationIdGetRelation(Oid relationId);
|
|
extern Relation RelationNameGetRelation(char *relationName);
|
|
|
|
extern void RelationClose(Relation relation);
|
|
extern void RelationForgetRelation(Oid rid);
|
|
|
|
/*
|
|
* Routines for flushing/rebuilding relcache entries in various scenarios
|
|
*/
|
|
extern void RelationRebuildRelation(Relation relation);
|
|
|
|
extern void RelationIdInvalidateRelationCacheByRelationId(Oid relationId);
|
|
|
|
extern void RelationIdInvalidateRelationCacheByAccessMethodId(Oid accessMethodId);
|
|
|
|
extern void RelationCacheInvalidate(bool onlyFlushReferenceCountZero);
|
|
|
|
extern void RelationRegisterRelation(Relation relation);
|
|
extern void RelationPurgeLocalRelation(bool xactComitted);
|
|
extern void RelationInitialize(void);
|
|
|
|
extern void RelationCacheAbort(void);
|
|
|
|
/*
|
|
* both vacuum.c and relcache.c need to know the name of the relcache init file
|
|
*/
|
|
|
|
#define RELCACHE_INIT_FILENAME "pg_internal.init"
|
|
|
|
#endif /* RELCACHE_H */
|