Commit 7d60b2af authored by Alvaro Herrera's avatar Alvaro Herrera

Fix DDL command collection for TRANSFORM

Commit b488c580, which added the DDL command collection feature,
neglected to update the code that commit cac76582 had previously
added two weeks earlier for the TRANSFORM feature.

Reported by Michael Paquier.
parent 40282224
......@@ -1740,7 +1740,7 @@ check_transform_function(Form_pg_proc procstruct)
/*
* CREATE TRANSFORM
*/
Oid
ObjectAddress
CreateTransform(CreateTransformStmt *stmt)
{
Oid typeid;
......@@ -1938,7 +1938,7 @@ CreateTransform(CreateTransformStmt *stmt)
heap_close(relation, RowExclusiveLock);
return transformid;
return myself;
}
......
......@@ -1438,7 +1438,7 @@ ProcessUtilitySlow(Node *parsetree,
break;
case T_CreateTransformStmt:
CreateTransform((CreateTransformStmt *) parsetree);
address = CreateTransform((CreateTransformStmt *) parsetree);
break;
case T_AlterOpFamilyStmt:
......
......@@ -51,7 +51,7 @@ extern void SetFunctionArgType(Oid funcOid, int argIndex, Oid newArgType);
extern ObjectAddress AlterFunction(AlterFunctionStmt *stmt);
extern ObjectAddress CreateCast(CreateCastStmt *stmt);
extern void DropCastById(Oid castOid);
extern Oid CreateTransform(CreateTransformStmt *stmt);
extern ObjectAddress CreateTransform(CreateTransformStmt *stmt);
extern void DropTransformById(Oid transformOid);
extern void IsThereFunctionInNamespace(const char *proname, int pronargs,
oidvector *proargtypes, Oid nspOid);
......
......@@ -15,6 +15,7 @@ REGRESS = test_ddl_deparse \
create_domain \
create_sequence_1 \
create_table \
create_transform \
alter_table \
create_view \
create_trigger \
......
--
-- CREATE_TRANSFORM
--
-- Create a dummy transform
-- The function FROM SQL should have internal as single argument as well
-- as return type. The function TO SQL should have as single argument
-- internal and as return argument the datatype of the transform done.
-- pl/plpgsql does not authorize the use of internal as data type.
CREATE TRANSFORM FOR int LANGUAGE SQL (
FROM SQL WITH FUNCTION varchar_transform(internal),
TO SQL WITH FUNCTION int4recv(internal));
NOTICE: DDL test: type simple, tag CREATE TRANSFORM
DROP TRANSFORM FOR int LANGUAGE SQL;
--
-- CREATE_TRANSFORM
--
-- Create a dummy transform
-- The function FROM SQL should have internal as single argument as well
-- as return type. The function TO SQL should have as single argument
-- internal and as return argument the datatype of the transform done.
-- pl/plpgsql does not authorize the use of internal as data type.
CREATE TRANSFORM FOR int LANGUAGE SQL (
FROM SQL WITH FUNCTION varchar_transform(internal),
TO SQL WITH FUNCTION int4recv(internal));
DROP TRANSFORM FOR int LANGUAGE SQL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment