Hi hackers,
While reviewing the global temporary table patch [1], I noticed
inconsistent terminology in tablecmds.c, where both "temporary relation"
and "temporary table" appear.
$ rg 'temporary table|temporary relation' src/backend/commands/tablecmds.c
856: errmsg("ON COMMIT can only be used on
temporary tables")));
893: errmsg("cannot create temporary table within
security-restricted operation")));
1608: * Note that for temporary relations this lock may get upgraded
later
1609: * on, but as no other session can access a temporary relation,
this
2514: errmsg("cannot truncate temporary tables of
other sessions")));
2789: errmsg("cannot create a temporary
relation as partition of permanent relation \"%s\"",
2798: ? "cannot inherit from
temporary relation \"%s\""
2799: : "cannot create a
permanent relation as partition of temporary relation \"%s\"",
2807: ? "cannot inherit from
temporary relation of another session"
2808: : "cannot create as
partition of temporary relation of another session")));
3807: errmsg("cannot move temporary tables of other
sessions")));
4551: errmsg("cannot alter temporary tables of other
sessions")));
6005: /* Build a temporary relation and copy data */
6040: errmsg("cannot rewrite
temporary tables of other sessions")));
10294: errmsg("constraints on
temporary tables may reference only temporary tables")));
10298: errmsg("constraints on
temporary tables must involve temporary tables of this session")));
17817: errmsg("cannot inherit from temporary relation
\"%s\"",
17824: errmsg("cannot inherit from temporary relation
of another session")));
17830: errmsg("cannot inherit to temporary relation
of another session")));
20995: errmsg("cannot attach a temporary relation as
partition of permanent relation \"%s\"",
21003: errmsg("cannot attach a permanent relation as
partition of temporary relation \"%s\"",
21010: errmsg("cannot attach as partition of
temporary relation of another session")));
21016: errmsg("cannot attach temporary relation of
another session as partition")));
23053: errmsg("cannot create as partition of temporary
relation of another session"));
23082: errmsg("cannot create a temporary relation as
partition of permanent relation \"%s\"",
23090: errmsg("cannot create a permanent relation as
partition of temporary relation \"%s\"",˜J
Given that these paths are table-specific, I suggest we prefer "temporary table"
for user-facing messages to keep the terminology consistent and user-friendly.
Any thoughts?
[1]
https://www.postgresql.org/message-id/CAEZATCUqP6iu0QcuZ%2B718iz630hsfQLdqZdhW%3DB3%2Bvz6iOuq9Q%40mail.gmail.com
--
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.