1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-26 12:21:12 +03:00

Support CREATE ACCESS METHOD

This enables external code to create access methods.  This is useful so
that extensions can add their own access methods which can be formally
tracked for dependencies, so that DROP operates correctly.  Also, having
explicit support makes pg_dump work correctly.

Currently only index AMs are supported, but we expect different types to
be added in the future.

Authors: Alexander Korotkov, Petr Jelínek
Reviewed-By: Teodor Sigaev, Petr Jelínek, Jim Nasby
Commitfest-URL: https://commitfest.postgresql.org/9/353/
Discussion: https://www.postgresql.org/message-id/CAPpHfdsXwZmojm6Dx+TJnpYk27kT4o7Ri6X_4OSWcByu1Rm+VA@mail.gmail.com
This commit is contained in:
Alvaro Herrera
2016-03-23 23:01:35 -03:00
parent 2c6af4f442
commit 473b932870
37 changed files with 1150 additions and 101 deletions

View File

@ -3831,6 +3831,18 @@ _copyCreateTransformStmt(const CreateTransformStmt *from)
return newnode;
}
static CreateAmStmt *
_copyCreateAmStmt(const CreateAmStmt *from)
{
CreateAmStmt *newnode = makeNode(CreateAmStmt);
COPY_STRING_FIELD(amname);
COPY_NODE_FIELD(handler_name);
COPY_SCALAR_FIELD(amtype);
return newnode;
}
static CreateTrigStmt *
_copyCreateTrigStmt(const CreateTrigStmt *from)
{
@ -4822,6 +4834,9 @@ copyObject(const void *from)
case T_CreateTransformStmt:
retval = _copyCreateTransformStmt(from);
break;
case T_CreateAmStmt:
retval = _copyCreateAmStmt(from);
break;
case T_CreateTrigStmt:
retval = _copyCreateTrigStmt(from);
break;

View File

@ -1855,6 +1855,16 @@ _equalCreateTransformStmt(const CreateTransformStmt *a, const CreateTransformStm
return true;
}
static bool
_equalCreateAmStmt(const CreateAmStmt *a, const CreateAmStmt *b)
{
COMPARE_STRING_FIELD(amname);
COMPARE_NODE_FIELD(handler_name);
COMPARE_SCALAR_FIELD(amtype);
return true;
}
static bool
_equalCreateTrigStmt(const CreateTrigStmt *a, const CreateTrigStmt *b)
{
@ -3147,6 +3157,9 @@ equal(const void *a, const void *b)
case T_CreateTransformStmt:
retval = _equalCreateTransformStmt(a, b);
break;
case T_CreateAmStmt:
retval = _equalCreateAmStmt(a, b);
break;
case T_CreateTrigStmt:
retval = _equalCreateTrigStmt(a, b);
break;