Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2006-10-09 Thread Josh Berkus
Jim, > I agree in general, except most languages have terrible support for > time/date data, so I can see a much bigger case for the database being > able to do it (and it's not like we'll be removing justify_*). Be that > as it may, there are probably apps out there that will break if this is >

Re: [SQL] deleting rows in specific order

2006-10-09 Thread Frank Bax
At 04:14 PM 10/9/06, Daniel Drotos wrote: What is the best way to do something like: delete from tablename where something order by somefield... You cannot, because it doesn't make sense. The "order by" clause is not valid on delete statement. Queries from other processes that start while

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2006-10-09 Thread Jim C. Nasby
On Mon, Oct 09, 2006 at 02:57:28PM -0500, Aaron Bono wrote: > On 10/5/06, Jim Nasby <[EMAIL PROTECTED]> wrote: > > > >On Oct 5, 2006, at 11:50 AM, Tom Lane wrote: > >> regression=# select ('2006-09-15 23:59:00'::timestamp - '2006-09-01 > >> 09:30:41'::timestamp); > >> ?column? > >> ---

[SQL] deleting rows in specific order

2006-10-09 Thread Daniel Drotos
Hi, What is the best way to do something like: delete from tablename where something order by somefield... Daniel ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [HACKERS] timestamp subtraction (was Re: [SQL] formatting intervals with to_char)

2006-10-09 Thread Aaron Bono
On 10/5/06, Jim Nasby <[EMAIL PROTECTED]> wrote: On Oct 5, 2006, at 11:50 AM, Tom Lane wrote:> regression=# select ('2006-09-15 23:59:00'::timestamp - '2006-09-01> 09:30:41'::timestamp);>  ?column?> -->  14 days 14:28:19 > (1 row)>> should be reporting '350:28:19' instead.>> Thi

Re: [SQL] i have table

2006-10-09 Thread Aaron Bono
On 10/5/06, Andrew Sullivan <[EMAIL PROTECTED]> wrote: On Wed, Oct 04, 2006 at 11:20:07AM -0500, Aaron Bono wrote:>> So do it as needed and convert your application slowly.You don't even need to do that.ALTER TABLE tablename RENAME TO tablename_real; CREATE VIEW tablename [&c.]Now the view looks to

Re: [SQL] PG 8.2beta reordering working for this case?

2006-10-09 Thread Tom Lane
Kyle Bateman <[EMAIL PROTECTED]> writes: > BTW, explain analyze still says 10 seconds of run time (and takes 10 > seconds to run), but when I remove the explain analyze, the query runs > in about a second. What's that all about? Instrumentation overhead ... you're probably running this on a PC