From: Koichi S. <koi...@gm...> - 2014-01-29 04:00:25
|
Yes, utility statements are not allowed in functions and you cannot use temporary object if more than one node are involved in a transaction. The former may be fixed. Michael, do you have any mention to this restriction that utility statements are not allowed in functions? The background of the latter is the implicit 2PC. You can set enforce_two_phase_commit to OFF to use temporary object but this may come up with data inconsistency among the nodes. I believe we can allow temporary objects in such a transaction because temporary objects don't have to survive beyond the session. As long as only implicit 2PCs are involved, we may be able to allow temporary objects and can extend current XC core. Regards; --- Koichi Suzuki 2014-01-29 David E. Wheeler <da...@ju...>: > XCers, > > I just tried to use pgTAP on XC and got this error: > > dwheeler=# create extension pgtap; > ERROR: In XC, SQL functions cannot contain utility statements > CONTEXT: SQL function "_cleanup" > > This is _cleanup(): > > CREATE OR REPLACE FUNCTION _cleanup() > RETURNS boolean AS $$ > DROP TABLE __tresults__; > DROP SEQUENCE __tresults___numb_seq; > DROP TABLE __tcache__; > DROP SEQUENCE __tcache___id_seq; > SELECT TRUE; > $$ LANGUAGE sql; > > These are temporary objects created by an EXECUTE statement in another function. Are they disallowed? > > Google just turned up the XC source: > > https://github.com/postgres-xc/postgres-xc/blob/master/src/backend/catalog/pg_proc.c#L897 > > Maybe those errors should be re-worded to indicate *what* utility statements are disallowed. Happy to contribute a patch if someone can list them. > > Otherwise, I would be interested to figure out how I could work around this issue on XC. > > Thanks, > > David > > > ------------------------------------------------------------------------------ > WatchGuard Dimension instantly turns raw network data into actionable > security intelligence. It gives you real-time visual feedback on key > security issues and trends. Skip the complicated setup - simply import > a virtual appliance and go from zero to informed in seconds. > http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk > _______________________________________________ > Postgres-xc-developers mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers |