mirror of
https://github.com/postgres/postgres.git
synced 2025-08-22 21:53:06 +03:00
Add transforms feature
This provides a mechanism for specifying conversions between SQL data types and procedural languages. As examples, there are transforms for hstore and ltree for PL/Perl and PL/Python. reviews by Pavel Stěhule and Andres Freund
This commit is contained in:
@@ -3625,6 +3625,20 @@ _copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreateTransformStmt *
|
||||
_copyCreateTransformStmt(const CreateTransformStmt *from)
|
||||
{
|
||||
CreateTransformStmt *newnode = makeNode(CreateTransformStmt);
|
||||
|
||||
COPY_SCALAR_FIELD(replace);
|
||||
COPY_NODE_FIELD(type_name);
|
||||
COPY_STRING_FIELD(lang);
|
||||
COPY_NODE_FIELD(fromsql);
|
||||
COPY_NODE_FIELD(tosql);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static CreateTrigStmt *
|
||||
_copyCreateTrigStmt(const CreateTrigStmt *from)
|
||||
{
|
||||
@@ -4568,6 +4582,9 @@ copyObject(const void *from)
|
||||
case T_ImportForeignSchemaStmt:
|
||||
retval = _copyImportForeignSchemaStmt(from);
|
||||
break;
|
||||
case T_CreateTransformStmt:
|
||||
retval = _copyCreateTransformStmt(from);
|
||||
break;
|
||||
case T_CreateTrigStmt:
|
||||
retval = _copyCreateTrigStmt(from);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user