Jason Dusek <jason.dusek@xxxxxxxxx> writes: > This more of a general interest than specifically Postgres question. Are > there any “semi-imperative” query languages that have been tried in the > past? I’m imagining a language where something like this: > for employee in employees: > for department in department: > if employee.department == department.department and > department.name == "infosec": > yield employee.employee, employee.name, employee.location, > employee.favorite_drink I'm pretty sure that that is the model that relational databases (and the SQL language in particular) replaced, back in the 70s or so. Look up "network" databases (eg CODASYL) and "hierarchical" DBs (eg IMS) for some ancient history here. Yeah, you can do it like that, but it's seriously painful to develop and maintain. People were more excited about spending human effort to save machine cycles forty years ago than they are today. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general