Christopher Browne <cbbro...@gmail.com> writes: > On 17 December 2015 at 14:16, Pavel Stehule <pavel.steh...@gmail.com> wrote: >> or different idea - just enforce syntax check without execution.
> That seems pretty cool... I'd find "syntax check without execution" to be > pretty useful to test SQL (and especially DDL). If it didn't execute the DDL at all, I doubt it would be that useful --- you could not test any statements that depended on earlier statements. Moreover, people might get surprised by error checks that they expect to get reported by the "syntax check" but actually are not made until runtime. There's a lot of behavior there that's currently just implementation detail but would become user-visible, depending on just where the syntax check stops processing. So what you want I think is something that *does* execute everything, but within a single transaction that is guaranteed not to get committed. A bulletproof version of that would likely need to be implemented on the server side, not with some psql hack. Whether we really need a feature like that isn't clear though; it's not like it's hard to test things that way now. Stick in a BEGIN with no COMMIT, you're there. The problem only comes in if you start expecting the behavior to be bulletproof. Maybe I'm being too pessimistic about what people would believe a --dry-run switch to be good for ... but I doubt it. regards, tom lane -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers