pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Victor Spirin <v.spirin@postgrespro.ru>
To: pgsql-hackers@lists.postgresql.org
Subject: Re: psql tab-complete
Date: Fri, 25 Oct 2019 11:57:18 +0300
Message-ID: <f450fc57-a147-19d0-e50c-33571c52cc13@postgrespro.ru> (raw)
In-Reply-To: <9dec5038-548e-91f9-df14-8825f7aa7c5c@postgrespro.ru>
References: <8d4e41ab-f001-fe9c-d796-a7b584a3c7f6@2ndQuadrant.com>
	<84e2eed6-63ec-b01e-2485-0f8e86da08df@postgrespro.ru>
	<11049.1571953711@sss.pgh.pa.us>
	<9dec5038-548e-91f9-df14-8825f7aa7c5c@postgrespro.ru>

This patch resolved one problem in the tab-complete.c on MSVC. The 
VA_ARGS_NARGS macros now work correctly on Windows.


Victor Spirin
Postgres Professional:http://www.postgrespro.com
The Russian Postgres Company

25.10.2019 0:53, Victor Spirin пишет:
> Yes, I found, that VA_ARGS_NARGS(__ VA_ARGS__) macros always return 1 
> on Windows.
>
> Victor Spirin
> Postgres Professional:http://www.postgrespro.com
> The Russian Postgres Company
>
> 25.10.2019 0:48, Tom Lane пишет:
>> Victor Spirin <v.spirin@postgrespro.ru> writes:
>>> I found some problem with tab-complete in the 12 version.  I checked
>>> this in the Windows.
>> This change seems to break the case intended by the comment,
>> ie given the context
>>
>>     SELECT * FROM tablename WHERE <tab>
>>
>> we want to offer the columns of "tablename" as completions.
>>
>> I'd be the first to agree that that's completely lame, as there
>> are any number of related cases it fails to cover ... but this
>> patch isn't making it better.
>>
>>             regards, tom lane
>>
>>
>
>

Attachments:

nargs.patch (text/plain, 1.0K) download diff --git a/src/include/c.h b/src/include/c.h index edc7822b0f..ed7099164b 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -238,6 +238,19 @@ * the call so that that is the appropriate one of the list of constants. * This idea is due to Laurent Deniau. */ +#ifdef _MSC_VER +#define EXPAND(args) args +#define VA_ARGS_NARGS(...) \ + VA_ARGS_NARGS_ EXPAND((__VA_ARGS__, \ + 63,62,61,60, \ + 59,58,57,56,55,54,53,52,51,50, \ + 49,48,47,46,45,44,43,42,41,40, \ + 39,38,37,36,35,34,33,32,31,30, \ + 29,28,27,26,25,24,23,22,21,20, \ + 19,18,17,16,15,14,13,12,11,10, \ + 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)) +#else + #define VA_ARGS_NARGS(...) \ VA_ARGS_NARGS_(__VA_ARGS__, \ 63,62,61,60, \ @@ -247,6 +260,8 @@ 29,28,27,26,25,24,23,22,21,20, \ 19,18,17,16,15,14,13,12,11,10, \ 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +#endif + #define VA_ARGS_NARGS_( \ _01,_02,_03,_04,_05,_06,_07,_08,_09,_10, \ _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, \

view thread (10+ messages)  latest in thread

Message-ID: <f450fc57-a147-19d0-e50c-33571c52cc13@postgrespro.ru>
Permalink:  ../f450fc57-a147-19d0-e50c-33571c52cc13@postgrespro.ru/
Also on:    postgresql.org/message-id/f450fc57-a147-19d0-e50c-33571c52cc13@postgrespro.ru

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: v.spirin@postgrespro.ru
  Subject: Re: psql tab-complete
  In-Reply-To: <f450fc57-a147-19d0-e50c-33571c52cc13@postgrespro.ru>
  References: <8d4e41ab-f001-fe9c-d796-a7b584a3c7f6@2ndQuadrant.com> <84e2eed6-63ec-b01e-2485-0f8e86da08df@postgrespro.ru> <11049.1571953711@sss.pgh.pa.us> <9dec5038-548e-91f9-df14-8825f7aa7c5c@postgrespro.ru> <f450fc57-a147-19d0-e50c-33571c52cc13@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox