Hi, Well, best to write this way:
Goal : query splitted to base elements Result : xml response from server Client : select pg_reparse_query(<query>); Target: 8.4 version How : modification of ruleutiles.c Not done : UNION etc. Not done : as builtin function, I don't know how to do it ))) Tested : partly examples : query : ( not meaningful by the way ) pzty - View on table X "wartość zakupu" - from View of table Y "nazwa dostawcy" - from Table Z select public.pg_reparse_query($$with xxx as (select * from pzty) select ctid,upper("nazwa dostawcy") from xxx where typ_dok='PZ' or typ_dok='WZ' and "nazwa dostawcy" = 'A' and "wartość zakupu" = 100 order by "nazwa dostawcy" desc $$); second example: select public.pg_reparse_query($$select ctid,upper("nazwa dostawcy") from pzty where typ_dok='PZ' or typ_dok='WZ' and "nazwa dostawcy" = 'A' and "wartość zakupu" = 100 order by "nazwa dostawcy" desc $$); Does it make sense ???? If you are interested in this solution send me email please. best regards Andrzej Barszcz
query.xml
Description: XML document
query_without_with.xml
Description: XML document
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers