Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Put a comma between them, postgres has been able to do multiple CTEs in a single query for quite some time: https://stackoverflow.com/questions/35248217/multiple-cte-in...

Or did you mean like using the same CTE across multiple queries? Views / materialized views are good for that.



The second one, yes.

Need to delete from multiple tables with foreign keys back to a single primary table. This before deleting from the primary table, due to consistency.

We often get a "list" of pks, then use it in multiple "delete key in" statements. A kludge, but these are for one-off tests on a dev database.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: