Comment in outfunc.c

Started by Tatsuo Ishiiabout 11 years ago2 messages
#1Tatsuo Ishii
ishii@postgresql.org

Hi,

I saw this comment in _outQuery() in outfuncs.c:

WRITE_ENUM_FIELD(commandType, CmdType);
WRITE_ENUM_FIELD(querySource, QuerySource);
/* we intentionally do not print the queryId field */
WRITE_BOOL_FIELD(canSetTag);

What is the resoning behind the comment?

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tatsuo Ishii (#1)
Re: Comment in outfunc.c

Tatsuo Ishii <ishii@postgresql.org> writes:

I saw this comment in _outQuery() in outfuncs.c:

WRITE_ENUM_FIELD(commandType, CmdType);
WRITE_ENUM_FIELD(querySource, QuerySource);
/* we intentionally do not print the queryId field */
WRITE_BOOL_FIELD(canSetTag);

What is the resoning behind the comment?

We don't want the queryId copied when a view/rule is reloaded,
since there's no guarantee that the algorithm for computing it
is stable for the life of a PG major version. Instead it's reset
to zero on reload, and any plugins that care can recompute it.

I suppose we could print it anyway and then ignore it on reload
but what's the point of that?

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