From: Michael P. <mic...@gm...> - 2010-05-24 07:24:46
|
Hi, I noticed a couple of days ago that it is actually not possible to execute directly to Datanodes a query with string elements. For example: 1) execute direct on node 1 'select * from pg_proc where proname = 'foo''; It doesn't work because the query is seen as a unique string for the parser. Parser on coordinator returns an error. 2) execute direct on node 1 'select * from pg_proc where proname = foo'; This one also doesn't work because foo has to be a string. Datanode returns an error. Here is my proposition to correct that: I don't know for the others, but basically I use execute direct only with select queries to see if data is correctly present on data nodes, for debugging, etc. Why not replacing the string query 'Sconst' in EXECUTE DIRECT by a select_with_parens? This grammar is used by COPY (SELECT) With that, even if the use of execute direct is restricted to Select queries only, I feel that it becomes more useful. The new grammar would become: EXECUTE DIRECT ON { COORDINATOR | NODE list_of_nodes } ( SELECT query ); Any opinions? Regards, -- Michael Paquier NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center |