Re: [HACKERS] Selecting a constant question: A summary

2007-06-13 Thread Chuck McDevitt
-hackers@postgresql.org; Dann Corbit; Larry McGhaw Subject: Re: [HACKERS] Selecting a constant question: A summary Chuck McDevitt [EMAIL PROTECTED] writes: Just a curiosity question: Why is the type of a literal '1' unknown instead of varchar(1)? Because, for instance, it might be intended

Re: [HACKERS] Selecting a constant question: A summary

2007-06-13 Thread Martijn van Oosterhout
On Wed, Jun 13, 2007 at 02:12:37AM -0400, Chuck McDevitt wrote: So, where x = '(1,2)' might be legal for comparing to x, but a field of type varchar(5) might not be, as in where x = y, where y is type varchar(5) containing '(1,2)'. Normally, just about every type can be converted to or from

Re: [HACKERS] Selecting a constant question: A summary

2007-06-13 Thread Gregory Stark
Chuck McDevitt [EMAIL PROTECTED] writes: Just a curiosity question: Why is the type of a literal '1' unknown instead of varchar(1)? Even if it was assigned a text datatype it would be the unconstrainted text not varchar(1). If we used varchar(1) then things like: create table foo as select

Re: [HACKERS] Selecting a constant question: A summary

2007-06-13 Thread Zeugswetter Andreas ADI SD
For some Unicode character sets, element_width can be as much as 4 In UTF8 one char can be up to 6 bytes, so 4 is not correct in general. Andreas ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate

[HACKERS] Selecting a constant question: A summary

2007-06-12 Thread Dann Corbit
First a comment: At CONNX Solutions Inc., we believe sincerely that we should do whatever is necessary to make our customers prosper. This means creation of excellent tools and being responsive to customer needs. Secondly, we believe that we should treat the customers the way that we want to be

Re: [HACKERS] Selecting a constant question: A summary

2007-06-12 Thread Joshua D. Drake
Dann Corbit wrote: First a comment: At CONNX Solutions Inc., we believe sincerely that we should do whatever is necessary to make our customers prosper. This means creation of excellent tools and being responsive to customer needs. Secondly, we believe that we should treat the customers

Re: [HACKERS] Selecting a constant question: A summary

2007-06-12 Thread Josh Berkus
Dan, Secondly, we believe that we should treat the customers the way that we want to be treated. I think that the PostgreSQL group has managed the first objective, but not the second. I just read this whole thread, and I feel that the sort of comment above is completely unjustified, and

Re: [HACKERS] Selecting a constant question: A summary

2007-06-12 Thread Tom Lane
Dann Corbit [EMAIL PROTECTED] writes: In the case of a SELECT query that selects a fixed constant of any sort, it would be a definite improvement for PostgreSQL to give some sort of upper maximum. What's the point? You keep reminding us that your code is middleware that can't assume anything

Re: [HACKERS] Selecting a constant question: A summary

2007-06-12 Thread Larry McGhaw
@postgresql.org; Larry McGhaw Subject: Re: [HACKERS] Selecting a constant question: A summary Dann Corbit [EMAIL PROTECTED] writes: In the case of a SELECT query that selects a fixed constant of any sort, it would be a definite improvement for PostgreSQL to give some sort of upper maximum

Re: [HACKERS] Selecting a constant question: A summary

2007-06-12 Thread Andrew Hammond
On 6/12/07, Josh Berkus [EMAIL PROTECTED] wrote: Tom, What's the point? You keep reminding us that your code is middleware that can't assume anything much about the queries you're dealing with. Therefore, I see no real value in fixing up one corner case. Your argument about space

Re: [HACKERS] Selecting a constant question: A summary

2007-06-12 Thread Tom Lane
Josh Berkus [EMAIL PROTECTED] writes: What's the point? You keep reminding us that your code is middleware that can't assume anything much about the queries you're dealing with. Hmmm? I thought that Dann was just talking about constants, and not column results. Am I confused? Well, the

Re: [HACKERS] Selecting a constant question: A summary

2007-06-12 Thread Tom Lane
Andrew Hammond [EMAIL PROTECTED] writes: - Implicit casting of unknown to char(n) or anything else seems rather sketchy to me, but I can't see any specific objection, except that... - I don't know when the right time to do the cast is. And doing it too early seems obviously wrong. Well, I

Re: [HACKERS] Selecting a constant question: A summary

2007-06-12 Thread Chuck McDevitt
Just a curiosity question: Why is the type of a literal '1' unknown instead of varchar(1)? Wouldn't varchar(1) cast properly to any use of the literal '1'? What is the benefit of assuming it's an unknown? ---(end of broadcast)--- TIP 7: You can

Re: [HACKERS] Selecting a constant question: A summary

2007-06-12 Thread Tom Lane
Chuck McDevitt [EMAIL PROTECTED] writes: Just a curiosity question: Why is the type of a literal '1' unknown instead of varchar(1)? Because, for instance, it might be intended as an integer or float or numeric value. Change the content a little, like '(1,2)' or '12:34', and maybe it's a point