Re: [BUGS] BUG #1517: SQL interval syntax is accepted by the parser,

2005-03-19 Thread Roy Badami
Tom> No, it shouldn't; read the SQL spec. AFAICS the syntax Tom> select interval '1' month is perfectly spec-compliant. The Tom> variant select interval '1 month' is *not* per-spec, it is a Tom> Postgres-ism. That is my understanding, though I don't have a copy of the spec (my r

Re: [BUGS] BUG #1518: Conversions to (undocumented) SQL year-month and

2005-03-19 Thread Roy Badami
> "Bruce" == Bruce Momjian writes: Bruce> First, the fundamental issue with intervals is that they Bruce> are not tied to a particular date, meaning there is no way Bruce> to map a specific number of days to a number of months. Bruce> (Some days are also 23 or 25 hours but tha

Re: [BUGS] BUG #1518: Conversions to (undocumented) SQL year-month and

2005-03-19 Thread Roy Badami
Roy> I don't have a copy of the spec, but according to "A guide to Roy> the SQL standard" conversions like this that would discard Roy> data are supposed to raise an exception. Just to clarify, my understanding is that in ANSI SQL it is valid to convert from the data type INTERVAL YEAR

Re: [BUGS] BUG #1517: SQL interval syntax is accepted by the parser,

2005-03-19 Thread Roy Badami
Tom> AFAICS the syntax Tom> select interval '1' month Tom> is perfectly spec-compliant. Well, it's not _perfectly_ spec compliant, because AIUI SELECTs without FROM clauses are a postgres-ism, too. But I'm just nitpicking... -roy ---(end of br

Re: [BUGS] BUG #1546: Temp table isn't deleted at the end of a

2005-03-19 Thread Roy Badami
> Given the error message, this seems to be the whole plpgsql caches > query plans but we don't invalidate those plans when there are schema > changes. In all currently released versions you pretty much need to > use EXECUTE on any queries where the table may go away, for example, > any use of te

Re: [BUGS] BUG #1546: Temp table isn't deleted at the end of a

2005-03-19 Thread Roy Badami
> "Roy" == Roy Badami <[EMAIL PROTECTED]> writes: Roy> FWIW, this is documented behaviour (section 35.1 of the Roy> manual). That's 35.1 in the 8.0 doc, BTW. It's 37.1 in the 7.4 doc. Roy> -roy ---(end of broadcast)--- TIP

Re: [BUGS] BUG #1517: SQL interval syntax is accepted by the parser,

2005-03-19 Thread Bruce Momjian
Roy Badami wrote: > > Tom> No, it shouldn't; read the SQL spec. AFAICS the syntax > Tom> select interval '1' month is perfectly spec-compliant. The > Tom> variant select interval '1 month' is *not* per-spec, it is a > Tom> Postgres-ism. > > That is my understanding, though I don

Re: [BUGS] BUG #1517: SQL interval syntax is accepted by the parser,

2005-03-19 Thread Roy Badami
Bruce> So, we have a few major problems with intervals. Let me Bruce> think a little and I will summarize. FWIW, AFAICT the problems I reported in bug 1517 and 1518 all relate to undocumented features of PostgreSQL. All the documented interval functionality works fine. The undocumented

Re: [BUGS] BUG #1517: SQL interval syntax is accepted by the parser,

2005-03-19 Thread Tom Lane
Roy Badami <[EMAIL PROTECTED]> writes: > All the documented interval functionality works fine. The > undocumented support for ANSI SQL interval data types and litereals > doesn't :-/ I think the reason it's not documented is precisely that Tom never finished it. It may not be very far away thoug

Re: [BUGS] BUG #1541: Unusually long INSERT times after fresh

2005-03-19 Thread Stephan Szabo
On Fri, 18 Mar 2005, Tom Lane wrote: > Andrew - Supernews <[EMAIL PROTECTED]> writes: > > It turns out that the scenario above is trivial to hit in 8.0 using > > referential constraints; RI triggers cache their plans, and on 8.0 the RI > > query is planned as a seqscan if the tables are freshly cr

Re: [BUGS] BUG #1518: Conversions to (undocumented) SQL year-month

2005-03-19 Thread Stephan Szabo
On Sat, 19 Mar 2005, Roy Badami wrote: > Roy> I don't have a copy of the spec, but according to "A guide to > Roy> the SQL standard" conversions like this that would discard > Roy> data are supposed to raise an exception. > > Just to clarify, my understanding is that in ANSI SQL it is

Re: [BUGS] BUG #1517: SQL interval syntax is accepted by the parser,

2005-03-19 Thread Roy Badami
Tom> Feel like hacking the code? Hmm, in principle I might take a look some time; in reality it's unlikely I'll have time any time soon... There are some design issues involved, though. If you have the type modifier, do you isnist on SQL syntax in the string? ie do you accept interval '

Re: [BUGS] BUG #1517: SQL interval syntax is accepted by the parser,

2005-03-19 Thread Tom Lane
Roy Badami <[EMAIL PROTECTED]> writes: > ie do you accept >interval '1 day 1 hour' day to second I think we have to, and the reason is that this isn't different under the hood from reading the external value '1 day 1 hour' and storing it into a column that has the DAY TO SECOND typmod. If we

Re: [BUGS] BUG #1541: Unusually long INSERT times after fresh

2005-03-19 Thread Andrew - Supernews
On 2005-03-19, Stephan Szabo <[EMAIL PROTECTED]> wrote: > On Fri, 18 Mar 2005, Tom Lane wrote: >> Hm. One thing we could do is to throw in some default values when we >> see the table has exactly zero pages --- perhaps ye olde traditional >> 1000/10, or possibly something else, but anyway not exac

Re: [BUGS] BUG #1517: SQL interval syntax is accepted by the parser,

2005-03-19 Thread Roy Badami
> "Tom" == Tom Lane <[EMAIL PROTECTED]> writes: >> ie do you accept interval '1 day 1 hour' day to second Tom> I think we have to, and the reason is that this isn't Tom> different under the hood from reading the external value '1 Tom> day 1 hour' and storing it into a column t

Re: [BUGS] BUG #1517: SQL interval syntax is accepted by the parser,

2005-03-19 Thread Roy Badami
Similary the undocumented postgresism of interpreting INTERVAL '1:02' as 1 hour 2 minutes is consistent with the ANSI INTERVAL '1:02' HOUR TO MINUTE but not with the ANSI INTERVAL '1:02' MINUTE TO SECOND which of course means 1 minute 2 seconds. The fact is that AN

Re: [BUGS] BUG #1517: SQL interval syntax is accepted by the parser,

2005-03-19 Thread Tom Lane
Roy Badami <[EMAIL PROTECTED]> writes: > Similary the undocumented postgresism of interpreting >INTERVAL '1:02' > as 1 hour 2 minutes is consistent with the ANSI > INTERVAL '1:02' HOUR TO MINUTE > but not with the ANSI >INTERVAL '1:02' MINUTE TO SECOND > which of course mea