pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
increase message string buffer size of watch command of psql
9+ messages / 4 participants
[nested] [flat]

* increase message string buffer size of watch command of psql
@ 2016-06-12 14:55  Ioseph Kim <pgsql-kr@postgresql.kr>
  0 siblings, 1 reply; 9+ messages in thread

From: Ioseph Kim @ 2016-06-12 14:55 UTC (permalink / raw)
  To: pgsql-hackers

Hello.
In po.ko (korean message) at psql 
#: command.c:2971
#, c-format
msgid "Watch every %lds\t%s"
msgstr "%ld초 간격으로 지켜보기\t%s"

this message string is a cut string, because buffer size is small.
At line 2946 in src/bin/psql/command.c 
char            title[50];

size of message string for korean is over 50 bytes.
(at least 80 columns terminal for common)

Increase size of this title, please.
50 bytes is so small for multi language.

And. I suggest that date string might be local language,
or current_timestamp string.

Regards, Ioseph.



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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: increase message string buffer size of watch command of psql
@ 2016-06-13 01:20  Robert Haas <robertmhaas@gmail.com>
  parent: Ioseph Kim <pgsql-kr@postgresql.kr>
  0 siblings, 1 reply; 9+ messages in thread

From: Robert Haas @ 2016-06-13 01:20 UTC (permalink / raw)
  To: Ioseph Kim <pgsql-kr@postgresql.kr>; +Cc: pgsql-hackers

On Sun, Jun 12, 2016 at 10:55 AM, Ioseph Kim <pgsql-kr@postgresql.kr> wrote:
> Hello.
> In po.ko (korean message) at psql
> #: command.c:2971
> #, c-format
> msgid "Watch every %lds\t%s"
> msgstr "%ld초 간격으로 지켜보기\t%s"
>
> this message string is a cut string, because buffer size is small.
> At line 2946 in src/bin/psql/command.c
> char            title[50];
>
> size of message string for korean is over 50 bytes.
> (at least 80 columns terminal for common)
>
> Increase size of this title, please.
> 50 bytes is so small for multi language.
>
> And. I suggest that date string might be local language,
> or current_timestamp string.

This was already changed in commit dea2b5960.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: increase message string buffer size of watch command of psql
@ 2016-06-13 01:52  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Lane @ 2016-06-13 01:52 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Ioseph Kim <pgsql-kr@postgresql.kr>; pgsql-hackers

Robert Haas <robertmhaas@gmail.com> writes:
> On Sun, Jun 12, 2016 at 10:55 AM, Ioseph Kim <pgsql-kr@postgresql.kr> wrote:
>> Increase size of this title, please.
>> 50 bytes is so small for multi language.
>> 
>> And. I suggest that date string might be local language,
>> or current_timestamp string.

> This was already changed in commit dea2b5960.

Well, we did part of that, but it's still using asctime().  Should we
change that to strftime(..."%c"...) to be less English-centric?
(The result seems to be the same in C locale.  pg_controldata has done
it that way for a long time, with few complaints.)  If we want to do so,
now would be the time, since 9.6 already whacked around the format
of \watch output.

			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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: increase message string buffer size of watch command of psql
@ 2016-06-14 16:56  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 9+ messages in thread

From: Tom Lane @ 2016-06-14 16:56 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Ioseph Kim <pgsql-kr@postgresql.kr>; pgsql-hackers

I wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Sun, Jun 12, 2016 at 10:55 AM, Ioseph Kim <pgsql-kr@postgresql.kr> wrote:
>>> Increase size of this title, please.
>>> 50 bytes is so small for multi language.
>>> And. I suggest that date string might be local language,
>>> or current_timestamp string.

>> This was already changed in commit dea2b5960.

> Well, we did part of that, but it's still using asctime().  Should we
> change that to strftime(..."%c"...) to be less English-centric?
> (The result seems to be the same in C locale.  pg_controldata has done
> it that way for a long time, with few complaints.)  If we want to do so,
> now would be the time, since 9.6 already whacked around the format
> of \watch output.

I take it from the vast silence that nobody particularly cares one way
or the other.  On reflection I think that this would be a good change
to make, so I'll go do so unless I hear complaints soon.

			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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: increase message string buffer size of watch command of psql
@ 2016-06-15 00:37  Ioseph Kim <pgsql-kr@postgresql.kr>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 9+ messages in thread

From: Ioseph Kim @ 2016-06-15 00:37 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers



2016년 06월 15일 01:56에 Tom Lane 이(가) 쓴 글:
> I take it from the vast silence that nobody particularly cares one way 
> or the other. On reflection I think that this would be a good change 
> to make, so I'll go do so unless I hear complaints soon. regards, tom 
> lane 

I propose to change from asctime() to sql current_timestamp value,
then users will  change date format with set command DateStyle.

Regards, Ioseph.



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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: increase message string buffer size of watch command of psql
@ 2016-06-15 02:56  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Ioseph Kim <pgsql-kr@postgresql.kr>
  0 siblings, 0 replies; 9+ messages in thread

From: Tom Lane @ 2016-06-15 02:56 UTC (permalink / raw)
  To: Ioseph Kim <pgsql-kr@postgresql.kr>; +Cc: pgsql-hackers

Ioseph Kim <pgsql-kr@postgresql.kr> writes:
> 2016년 06월 15일 01:56에 Tom Lane 이(가) 쓴 글:
>> I take it from the vast silence that nobody particularly cares one way 
>> or the other. On reflection I think that this would be a good change 
>> to make, so I'll go do so unless I hear complaints soon. regards, tom 
>> lane 

> I propose to change from asctime() to sql current_timestamp value,
> then users will  change date format with set command DateStyle.

That would require an additional SQL query each time through the loop,
which seems like undue expense.  It's also not terribly friendly to the
goal of localization, I should think, given the limited number of
datestyle options and the fact that none of them actually change day or
month names to non-English choices.  And it would imply changing the
timestamps from psql's timezone to the backend's.  While that might have
been a good way to do it in a green field, it's not the way \watch has
worked in the past, and given the lack of complaints I'm disinclined
to change 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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: increase message string buffer size of watch command of psql
@ 2016-06-15 20:38  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 9+ messages in thread

From: Alvaro Herrera @ 2016-06-15 20:38 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Robert Haas <robertmhaas@gmail.com>; Ioseph Kim <pgsql-kr@postgresql.kr>; pgsql-hackers

Tom Lane wrote:
> I wrote:

> > Well, we did part of that, but it's still using asctime().  Should we
> > change that to strftime(..."%c"...) to be less English-centric?
> > (The result seems to be the same in C locale.  pg_controldata has done
> > it that way for a long time, with few complaints.)  If we want to do so,
> > now would be the time, since 9.6 already whacked around the format
> > of \watch output.
> 
> I take it from the vast silence that nobody particularly cares one way
> or the other.  On reflection I think that this would be a good change
> to make, so I'll go do so unless I hear complaints soon.

+1 to strftime("%c").  If we wanted to provide additional flexibility we
could have a \pset option to change the strftime format string to
something other than %c, but I don't think there's enough demand to
justify it.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: increase message string buffer size of watch command of psql
@ 2016-06-15 23:37  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Lane @ 2016-06-15 23:37 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Robert Haas <robertmhaas@gmail.com>; Ioseph Kim <pgsql-kr@postgresql.kr>; pgsql-hackers

Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> +1 to strftime("%c").  If we wanted to provide additional flexibility we
> could have a \pset option to change the strftime format string to
> something other than %c, but I don't think there's enough demand to
> justify it.

Agreed, that seems like something for later (or never).  Pushed that way.

I also widened the buffer a bit in the back branches, to address the
original complaint.

			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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: increase message string buffer size of watch command of psql
@ 2016-06-16 00:40  Ioseph Kim <pgsql-kr@postgresql.kr>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 9+ messages in thread

From: Ioseph Kim @ 2016-06-16 00:40 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Robert Haas <robertmhaas@gmail.com>; pgsql-hackers

Thanks, I agree that strftime() is better then asctime().

regards, Ioseph

2016³â 06¿ù 16ÀÏ 08:37¿¡ Tom Lane ÀÌ(°¡) ¾´ ±Û:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
>> +1 to strftime("%c").  If we wanted to provide additional flexibility we
>> could have a \pset option to change the strftime format string to
>> something other than %c, but I don't think there's enough demand to
>> justify it.
> Agreed, that seems like something for later (or never).  Pushed that way.
>
> I also widened the buffer a bit in the back branches, to address the
> original complaint.
>
> 			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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2016-06-16 00:40 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-06-12 14:55 increase message string buffer size of watch command of psql Ioseph Kim <pgsql-kr@postgresql.kr>
2016-06-13 01:20 ` Robert Haas <robertmhaas@gmail.com>
2016-06-13 01:52   ` Tom Lane <tgl@sss.pgh.pa.us>
2016-06-14 16:56     ` Tom Lane <tgl@sss.pgh.pa.us>
2016-06-15 00:37       ` Ioseph Kim <pgsql-kr@postgresql.kr>
2016-06-15 02:56         ` Tom Lane <tgl@sss.pgh.pa.us>
2016-06-15 20:38       ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-06-15 23:37         ` Tom Lane <tgl@sss.pgh.pa.us>
2016-06-16 00:40           ` Ioseph Kim <pgsql-kr@postgresql.kr>

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