Re: Imperative Query Languages

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jason Dusek <jason(dot)dusek(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Imperative Query Languages
Date: 2017-07-05 06:01:40
Message-ID: 1437.1499234500@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jason Dusek <jason(dot)dusek(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2017-07-05 06:22:27 Re: Imperative Query Languages
Previous Message John Turner 2017-07-05 05:40:46 Re: Imperative Query Languages