Re: [HACKERS] Parser emits mysterious error message for very long tokens

2015-09-14 Thread Kyotaro HORIGUCHI
Hello, thank you for the opinion.

At Fri, 11 Sep 2015 09:31:30 -0400, Tom Lane  wrote in 
<884.1441978...@sss.pgh.pa.us>
> Kyotaro HORIGUCHI  writes:
> > Hello, this is a problem on an extreme situation.
> > When parser encounters very long tokens, it returns an error
> > message which should be mysterious for users.
> 
> >> $ perl -e "print \"select '\" . \"x\"x(512*1024*1024) . \"'\"" | psql 
> >> postgres
> >> ERROR:  invalid memory alloc request size 1073741824
> 
> I can't get terribly excited about that, because there is not that
> much daylight between there and where the query fails because the
> entire input string exceeds 1GB.  Moreover, anyone who tries working
> with literals in this size range will soon learn not to ;-).  So
> it seems quite an artificial example to me ...
> 
>   regards, tom lane

Yes, so 'an extreme situation'. I wanted to know what to think
about this kind of situation.

Thanks for the comment, I'm confident that fixing it and the
similars in clean way should be too-much for the necessity.

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



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


Re: [HACKERS] Parser emits mysterious error message for very long tokens

2015-09-11 Thread Tom Lane
Kyotaro HORIGUCHI  writes:
> Hello, this is a problem on an extreme situation.
> When parser encounters very long tokens, it returns an error
> message which should be mysterious for users.

>> $ perl -e "print \"select '\" . \"x\"x(512*1024*1024) . \"'\"" | psql 
>> postgres
>> ERROR:  invalid memory alloc request size 1073741824

I can't get terribly excited about that, because there is not that
much daylight between there and where the query fails because the
entire input string exceeds 1GB.  Moreover, anyone who tries working
with literals in this size range will soon learn not to ;-).  So
it seems quite an artificial example to me ...

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