mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
store all ordering information in pathkeys lists (which are now lists of lists of PathKeyItem nodes, not just lists of lists of vars). This was a big win --- the code is smaller and IMHO more understandable than it was, even though it handles more cases. I believe the node changes will not force an initdb for anyone; planner nodes don't show up in stored rules.
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* nodes.c
|
|
* support code for nodes (now that we get rid of the home-brew
|
|
* inheritance system, our support code for nodes get much simpler)
|
|
*
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
*
|
|
* IDENTIFICATION
|
|
* $Header: /cvsroot/pgsql/src/backend/nodes/nodes.c,v 1.11 1999/08/16 02:17:42 tgl Exp $
|
|
*
|
|
* HISTORY
|
|
* Andrew Yu Oct 20, 1994 file creation
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#include "postgres.h"
|
|
#include "nodes/nodes.h"
|
|
|
|
/*
|
|
* newNode -
|
|
* create a new node of the specified size and tag the node with the
|
|
* specified tag.
|
|
*
|
|
* !WARNING!: Avoid using newNode directly. You should be using the
|
|
* macro makeNode. eg. to create a Resdom node, use makeNode(Resdom)
|
|
*
|
|
*/
|
|
Node *
|
|
newNode(Size size, NodeTag tag)
|
|
{
|
|
Node *newNode;
|
|
|
|
Assert(size >= sizeof(Node)); /* need the tag, at least */
|
|
|
|
newNode = (Node *) palloc(size);
|
|
MemSet((char *) newNode, 0, size);
|
|
newNode->type = tag;
|
|
return newNode;
|
|
}
|