What does RIR as in fireRIRrules stand for?

Started by Andres Freundover 10 years ago13 messages
#1Andres Freund
andres@anarazel.de

Hi,

I searched the current code, all diffs to the current code, and the
mailing list, but still haven't got an actual clue what RIR is supposed
to stand for. There's a few things that come to mind (Rewrite Instead
Rule?), but none of them seem to make too much sense.

Greetings,

Andres Freund

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Andres Freund (#1)
Re: What does RIR as in fireRIRrules stand for?

Pure speculation but the word fire makes me think of triggers, not rule.
Fire Referential Integrity Rules (Triggers)?

David J.

On Thu, Aug 27, 2015 at 9:13 AM, Andres Freund <andres@anarazel.de> wrote:

Show quoted text

Hi,

I searched the current code, all diffs to the current code, and the
mailing list, but still haven't got an actual clue what RIR is supposed
to stand for. There's a few things that come to mind (Rewrite Instead
Rule?), but none of them seem to make too much sense.

Greetings,

Andres Freund

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#1)
Re: What does RIR as in fireRIRrules stand for?

Andres Freund <andres@anarazel.de> writes:

I searched the current code, all diffs to the current code, and the
mailing list, but still haven't got an actual clue what RIR is supposed
to stand for. There's a few things that come to mind (Rewrite Instead
Rule?), but none of them seem to make too much sense.

/messages/by-id/3E887762.5B68F64B@Yahoo.com

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Andres Freund
andres@anarazel.de
In reply to: Andres Freund (#1)
Re: What does RIR as in fireRIRrules stand for?

On 2015-08-27 15:13:52 +0200, Andres Freund wrote:

I searched the current code, all diffs to the current code, and the
mailing list, but still haven't got an actual clue what RIR is supposed
to stand for. There's a few things that come to mind (Rewrite Instead
Rule?), but none of them seem to make too much sense.

Looking over the original submission it seems to actually stand for
retrieve-instead-retrieve (as somebody on IRC guessed). Doesn't seem to
make much sense to me.

The explanation seems to have been removed way back, in f93b6974 .

Greetings,

Andres Freund

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#3)
Re: What does RIR as in fireRIRrules stand for?

On 2015-08-27 09:43:09 -0400, Tom Lane wrote:

Andres Freund <andres@anarazel.de> writes:

I searched the current code, all diffs to the current code, and the
mailing list, but still haven't got an actual clue what RIR is supposed
to stand for. There's a few things that come to mind (Rewrite Instead
Rule?), but none of them seem to make too much sense.

/messages/by-id/3E887762.5B68F64B@Yahoo.com

Oops. I saw that message but thought, based on the subject, it'd a scam
mail...

Can we either add a comment to the effect of Jan's message, or just
renamoe the functions/variables?

Greetings,

Andres Freund

PS: The sources taught me something today:
reality is for dead birds -- glass

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#5)
Re: What does RIR as in fireRIRrules stand for?

Andres Freund <andres@anarazel.de> writes:

On 2015-08-27 09:43:09 -0400, Tom Lane wrote:

/messages/by-id/3E887762.5B68F64B@Yahoo.com

Oops. I saw that message but thought, based on the subject, it'd a scam
mail...

Can we either add a comment to the effect of Jan's message, or just
renamoe the functions/variables?

Let's add a comment.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Steve Crawford
scrawford@pinpointresearch.com
In reply to: Tom Lane (#6)
Re: What does RIR as in fireRIRrules stand for?

Candidate for Appendix K?

Cheers,
Steve

On Thu, Aug 27, 2015 at 6:52 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Show quoted text

Andres Freund <andres@anarazel.de> writes:

On 2015-08-27 09:43:09 -0400, Tom Lane wrote:

/messages/by-id/3E887762.5B68F64B@Yahoo.com

Oops. I saw that message but thought, based on the subject, it'd a scam
mail...

Can we either add a comment to the effect of Jan's message, or just
renamoe the functions/variables?

Let's add a comment.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: Steve Crawford (#7)
Re: What does RIR as in fireRIRrules stand for?

Steve Crawford <scrawford@pinpointresearch.com> writes:

Candidate for Appendix K?

Meh ... it's not a user-visible notation, in fact it only appears in
rewriteHandler.c AFAICS. I think an explanation in fireRIRrules'
header comment would be fine.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#9Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#8)
Re: What does RIR as in fireRIRrules stand for?

On 2015-08-27 11:12:42 -0400, Tom Lane wrote:

Steve Crawford <scrawford@pinpointresearch.com> writes:

Candidate for Appendix K?

Meh ... it's not a user-visible notation, in fact it only appears in
rewriteHandler.c AFAICS.

Agreed, I don't think we want to distribute that term any wider than
that file.

I think an explanation in fireRIRrules' header comment would be fine.

I was thinking of adding it to the file's header like
* NOTES
* Some of the terms used in this file are of historic nature: "retrieve"
* was the PostQUEL keyword for what today is SELECT. "RIR" stands for
* "Retrieve-Instead-Retrieve", that is an ON SELECT INSTEAD rule (which
* has to be unconditional and where only one rule can exist on each
* relation).

since both retrieve and RIR are used in a bunch of places.

Andres

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#9)
Re: What does RIR as in fireRIRrules stand for?

Andres Freund <andres@anarazel.de> writes:

On 2015-08-27 11:12:42 -0400, Tom Lane wrote:

I think an explanation in fireRIRrules' header comment would be fine.

I was thinking of adding it to the file's header like
* NOTES
* Some of the terms used in this file are of historic nature: "retrieve"
* was the PostQUEL keyword for what today is SELECT. "RIR" stands for
* "Retrieve-Instead-Retrieve", that is an ON SELECT INSTEAD rule (which
* has to be unconditional and where only one rule can exist on each
* relation).

since both retrieve and RIR are used in a bunch of places.

Seems reasonable. Maybe worth writing out the modern spelling a bit
further, "an ON SELECT DO INSTEAD SELECT rule", to make the parallel
to Retrieve-Instead-Retrieve perfectly clear.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#11Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#10)
Re: What does RIR as in fireRIRrules stand for?

On 2015-08-28 10:20:58 -0400, Tom Lane wrote:

Seems reasonable. Maybe worth writing out the modern spelling a bit
further, "an ON SELECT DO INSTEAD SELECT rule", to make the parallel
to Retrieve-Instead-Retrieve perfectly clear.

Makes sense. Pushed that way.

Thanks

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#12fred yin
legendmakeryy@gmail.com
In reply to: Andres Freund (#4)
Re: What does RIR as in fireRIRrules stand for?

I found this thread when trying to understand what RIR means in the source
code. The explanation by Andres (which I find informative) is not in the
code. Should we add it into the comment? I think it will be useful for
readability.

Best,
Yue

On Mon, Jan 3, 2022 at 5:26 PM Andres Freund <andres@anarazel.de> wrote:

Show quoted text

On 2015-08-27 15:13:52 +0200, Andres Freund wrote:

I searched the current code, all diffs to the current code, and the
mailing list, but still haven't got an actual clue what RIR is supposed
to stand for. There's a few things that come to mind (Rewrite Instead
Rule?), but none of them seem to make too much sense.

Looking over the original submission it seems to actually stand for
retrieve-instead-retrieve (as somebody on IRC guessed). Doesn't seem to
make much sense to me.

The explanation seems to have been removed way back, in f93b6974 .

Greetings,

Andres Freund

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#13Tom Lane
tgl@sss.pgh.pa.us
In reply to: fred yin (#12)
Re: What does RIR as in fireRIRrules stand for?

fred yin <legendmakeryy@gmail.com> writes:

I found this thread when trying to understand what RIR means in the source
code. The explanation by Andres (which I find informative) is not in the
code. Should we add it into the comment? I think it will be useful for
readability.

There's this at the top of rewriteHandler.c:

* NOTES
* Some of the terms used in this file are of historic nature: "retrieve"
* was the PostQUEL keyword for what today is SELECT. "RIR" stands for
* "Retrieve-Instead-Retrieve", that is an ON SELECT DO INSTEAD SELECT rule
* (which has to be unconditional and where only one rule can exist on each
* relation).

regards, tom lane