Re: Portal->commandTag as an enum

From: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, John Naylor <john(dot)naylor(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Portal->commandTag as an enum
Date: 2020-02-29 00:26:13
Message-ID: D74DEEE9-17BC-4953-A8BE-25AA0C6D6F9D@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Feb 28, 2020, at 3:05 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
>> I just realized that we could rename command_tag_display_last_oid() to
>> something like command_tag_print_a_useless_zero_for_historical_reasons()
>> and nothing would be lost.
>
> Is there a way to drop that logic altogether by making the tagname string
> be "INSERT 0" for the INSERT case? Or would the zero bleed into other
> places where we don't want it?

In general, I don't think we want to increase the number of distinct tags. Which command you finished running and whether you want a rowcount and/or lastoid are orthogonal issues. We already have problems with there being different commandtags for different versions of morally the same commands. Take for example "SELECT FOR KEY SHARE" vs. "SELECT FOR NO KEY UPDATE" vs. "SELECT FOR SHARE" vs. "SELECT FOR UPDATE".


Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2020-02-29 01:25:11 Re: Allowing ALTER TYPE to change storage strategy
Previous Message Tom Lane 2020-02-29 00:23:38 Re: Assert failure due to "drop schema pg_temp_3 cascade" for temporary tables and \d+ is not showing any info after drooping temp table schema