Re: [GENERAL] regclass and format('%I')

2015-03-19 Thread Jason Dusek
On 15 March 2015 at 08:44, Tom Lane t...@sss.pgh.pa.us wrote: David G. Johnston david.g.johns...@gmail.com writes: ​IOW, as long as the output string matches: ^(?:{2})*$ I do not see how it is possible ​for format to lay in a value at %I that is any more insecure than the current

Re: [GENERAL] regclass and format('%I')

2015-03-15 Thread David G. Johnston
On Sunday, March 15, 2015, Tom Lane t...@sss.pgh.pa.us wrote: David G. Johnston david.g.johns...@gmail.com javascript:; writes: ​IOW, as long as the output string matches: ^(?:{2})*$ I do not see how it is possible ​for format to lay in a value at %I that is any more insecure than the

Re: [GENERAL] regclass and format('%I')

2015-03-15 Thread Tom Lane
David G. Johnston david.g.johns...@gmail.com writes: ​IOW, as long as the output string matches: ^(?:{2})*$ I do not see how it is possible ​for format to lay in a value at %I that is any more insecure than the current behavior. If the input string already matches that pattern then it

Re: [GENERAL] regclass and format('%I')

2015-03-15 Thread David G. Johnston
On Sat, Mar 14, 2015 at 8:29 AM, Tom Lane t...@sss.pgh.pa.us wrote: Jason Dusek jason.du...@gmail.com writes: It honestly seems far more reasonable to me that %s and %I should do the exact same thing with regclass. You're mistaken. The operation of format() is first to convert the

Re: [GENERAL] regclass and format('%I')

2015-03-14 Thread Jason Dusek
On 14 March 2015 at 09:17, David G. Johnston david.g.johns...@gmail.com wrote: On Saturday, March 14, 2015, Jason Dusek jason.du...@gmail.com wrote: It honestly seems far more reasonable to me that %s and %I should do the exact same thing with regclass. My reasoning is as follows: ‘%I’

Re: [GENERAL] regclass and format('%I')

2015-03-14 Thread Pavel Stehule
2015-03-15 3:09 GMT+01:00 Jason Dusek jason.du...@gmail.com: On 14 March 2015 at 09:17, David G. Johnston david.g.johns...@gmail.com wrote: On Saturday, March 14, 2015, Jason Dusek jason.du...@gmail.com wrote: It honestly seems far more reasonable to me that %s and %I should do the exact

Re: [GENERAL] regclass and format('%I')

2015-03-14 Thread Jason Dusek
It honestly seems far more reasonable to me that %s and %I should do the exact same thing with regclass. My reasoning is as follows: ‘%I’ formats a something such that it is a valid identifier, regclass is already a valid identifier, therefore, do nothing. Another line of reasoning: If you

Re: [GENERAL] regclass and format('%I')

2015-03-14 Thread Pavel Stehule
2015-03-14 10:09 GMT+01:00 Jason Dusek jason.du...@gmail.com: It honestly seems far more reasonable to me that %s and %I should do the exact same thing with regclass. My reasoning is as follows: ‘%I’ formats a something such that it is a valid identifier, regclass is already a valid

Re: [GENERAL] regclass and format('%I')

2015-03-14 Thread David G. Johnston
On Saturday, March 14, 2015, Jason Dusek jason.du...@gmail.com wrote: It honestly seems far more reasonable to me that %s and %I should do the exact same thing with regclass. My reasoning is as follows: ‘%I’ formats a something such that it is a valid identifier, regclass is already a valid

Re: [GENERAL] regclass and format('%I')

2015-03-14 Thread Tom Lane
Jason Dusek jason.du...@gmail.com writes: It honestly seems far more reasonable to me that %s and %I should do the exact same thing with regclass. You're mistaken. The operation of format() is first to convert the non-format arguments to text strings, using the output functions for their data

[GENERAL] regclass and format('%I')

2015-03-13 Thread Jason Dusek
Hi All, The difference in how format handles `regclass` and `name` seems like an inconsistency: WITH conversions(casts, format, result) AS ( VALUES (ARRAY['name']::regtype[], '%I', format('%I', name('select'))), (ARRAY['name']::regtype[], '%L',

Re: [GENERAL] regclass and format('%I')

2015-03-13 Thread David G. Johnston
On Fri, Mar 13, 2015 at 12:18 PM, Jason Dusek jason.du...@gmail.com wrote: Hi All, The difference in how format handles `regclass` and `name` seems like an inconsistency: WITH conversions(casts, format, result) AS ( VALUES (ARRAY['name']::regtype[], '%I', format('%I',