Re: psql :: support for \ev viewname and \sv viewname - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: psql :: support for \ev viewname and \sv viewname
Date
Msg-id CAEZATCXU-jX9ebO0unGRCM3Kp3ginYD_er87Vn+p=uaPfjSjAg@mail.gmail.com
Whole thread Raw
In response to Re: psql :: support for \ev viewname and \sv viewname  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: psql :: support for \ev viewname and \sv viewname  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On 4 May 2016 at 01:35, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> On 5/3/16 3:10 PM, Dean Rasheed wrote:
>> On 3 May 2016 at 16:52, Peter Eisentraut
>>>
>>> I would change appendReloptionsArrayAH() to a function and keep AH as the
>>> first argument (similar to other functions that take such a handle).
>>
>> I can understand changing it to a function, but I don't think AH
>> should be the first argument. All other append*() functions that
>> append to a buffer have the buffer as the first argument, including
>> the appendStringLiteralAH() macro on which this is based.
>
> Well, all the functions that take archive handles have that as the first
> argument, so how do we consolidate that?
>

Well, appendStringLiteralAH() takes both, so that sets a precedent.

And I think that makes sense too. The functions that take an archive
handle as their first argument are mostly functions whose primary
concern is to operate on the archive in some way. All the append*()
functions that take a buffer as their first argument are primarily
concerned with operating on the buffer. I'd say
appendStringLiteralAH() and appendReloptionsArrayAH() fall very much
into that second category. They only take an archive handle to get the
encoding and std_strings settings controlling *how* they operate on
the buffer. The main purpose of those append*() functions is to append
to a buffer, so it makes sense that that is their first argument.

All the append*() functions are consistent in their argument ordering,
including those that also take an archive handle, so I think
appendReloptionsArrayAH() should follow that pattern.

Regards,
Dean



pgsql-hackers by date:

Previous
From: Rushabh Lathia
Date:
Subject: Re: pg_dump broken for non-super user
Next
From: Dilip Kumar
Date:
Subject: Segmentation fault when max_parallel degree is very High