Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d60b2a

Browse files
committed
Fix DDL command collection for TRANSFORM
Commitb488c58, which added the DDL command collection feature,neglected to update the code that commitcac7658 had previouslyadded two weeks earlier for the TRANSFORM feature.Reported by Michael Paquier.
1 parent4028222 commit7d60b2a

File tree

6 files changed

+32
-4
lines changed

6 files changed

+32
-4
lines changed

‎src/backend/commands/functioncmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ check_transform_function(Form_pg_proc procstruct)
17401740
/*
17411741
* CREATE TRANSFORM
17421742
*/
1743-
Oid
1743+
ObjectAddress
17441744
CreateTransform(CreateTransformStmt*stmt)
17451745
{
17461746
Oidtypeid;
@@ -1938,7 +1938,7 @@ CreateTransform(CreateTransformStmt *stmt)
19381938

19391939
heap_close(relation,RowExclusiveLock);
19401940

1941-
returntransformid;
1941+
returnmyself;
19421942
}
19431943

19441944

‎src/backend/tcop/utility.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ ProcessUtilitySlow(Node *parsetree,
14381438
break;
14391439

14401440
caseT_CreateTransformStmt:
1441-
CreateTransform((CreateTransformStmt*)parsetree);
1441+
address=CreateTransform((CreateTransformStmt*)parsetree);
14421442
break;
14431443

14441444
caseT_AlterOpFamilyStmt:

‎src/include/commands/defrem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern void SetFunctionArgType(Oid funcOid, int argIndex, Oid newArgType);
5151
externObjectAddressAlterFunction(AlterFunctionStmt*stmt);
5252
externObjectAddressCreateCast(CreateCastStmt*stmt);
5353
externvoidDropCastById(OidcastOid);
54-
externOidCreateTransform(CreateTransformStmt*stmt);
54+
externObjectAddressCreateTransform(CreateTransformStmt*stmt);
5555
externvoidDropTransformById(OidtransformOid);
5656
externvoidIsThereFunctionInNamespace(constchar*proname,intpronargs,
5757
oidvector*proargtypes,OidnspOid);

‎src/test/modules/test_ddl_deparse/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ REGRESS = test_ddl_deparse \
1515
create_domain\
1616
create_sequence_1\
1717
create_table\
18+
create_transform\
1819
alter_table\
1920
create_view\
2021
create_trigger\
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--
2+
-- CREATE_TRANSFORM
3+
--
4+
-- Create a dummy transform
5+
-- The function FROM SQL should have internal as single argument as well
6+
-- as return type. The function TO SQL should have as single argument
7+
-- internal and as return argument the datatype of the transform done.
8+
-- pl/plpgsql does not authorize the use of internal as data type.
9+
CREATE TRANSFORM FOR int LANGUAGE SQL (
10+
FROM SQL WITH FUNCTION varchar_transform(internal),
11+
TO SQL WITH FUNCTION int4recv(internal));
12+
NOTICE: DDL test: type simple, tag CREATE TRANSFORM
13+
DROP TRANSFORM FOR int LANGUAGE SQL;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--
2+
-- CREATE_TRANSFORM
3+
--
4+
5+
-- Create a dummy transform
6+
-- The function FROM SQL should have internal as single argument as well
7+
-- as return type. The function TO SQL should have as single argument
8+
-- internal and as return argument the datatype of the transform done.
9+
-- pl/plpgsql does not authorize the use of internal as data type.
10+
CREATE TRANSFORM FORint LANGUAGE SQL (
11+
FROM SQL WITH FUNCTION varchar_transform(internal),
12+
TO SQL WITH FUNCTION int4recv(internal));
13+
14+
DROP TRANSFORM FORint LANGUAGE SQL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp