Re: [SQL] Last day of month

2004-02-25 Thread Joe Conway
Greg Sabino Mullane wrote: How to find the last sunday/mon/sat of any given month. There is probably a smoother way to do it, but here is a quick little function to do what you ask. Feed it a date and a number, where 0 is Sunday, 1 is Monday, etc. oops...forget my last reply...I was a bit too

[SQL] updating remote database

2004-02-25 Thread Kenneth Gonsalves
i have a database on a local machine, and another on a remote machine. I have a dialup connection between the two - so band width is a problem. What is the most efficient way of updating the remote from the local? Does SQL or postgres have simple commands for this? -- regards kg -- http://www.

Re: [SQL] Last day of month

2004-02-25 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > How to find the last sunday/mon/sat of any given month. There is probably a smoother way to do it, but here is a quick little function to do what you ask. Feed it a date and a number, where 0 is Sunday, 1 is Monday, etc. CREATE OR REPLACE

Re: [SQL] Scalar in a range (but textual not numeric)

2004-02-25 Thread Tom Lane
I wrote: > try writing > WHERE 'ABCDE' >= pr_min AND 'ABCDE' <= pr_max > AND pr_min < (SELECT pr_min FROM table > WHERE pr_min > 'ABCDE' > ORDER BY pr_min LIMIT 1) > The idea here is to add an upper bound on pr_min to the index s

Re: [SQL] Scalar in a range (but textual not numeric)

2004-02-25 Thread Richard Huxton
On Wednesday 25 February 2004 21:32, Tom Lane wrote: > Richard Huxton <[EMAIL PROTECTED]> writes: > > Large table representing non-overlapping blocks: > > blocks(id int4, min varchar, max varchar) > > > > SELECT * FROM blocks WHERE 'ABCDE' BETWEEN min AND max; > > > > The estimator gets the wrong p

Re: [SQL] Scalar in a range (but textual not numeric)

2004-02-25 Thread Richard Huxton
On Wednesday 25 February 2004 20:56, Joe Conway wrote: > Richard Huxton wrote: > > That's not quite the same though, because it means I need to split > > ABCAA..ABDBB into ABCAA..ABCZZ and ABDAA..ABDZZ but it's close enough > > unless someone is feeling clever this evening. > > Would (a series of)

Re: [SQL] Scalar in a range (but textual not numeric)

2004-02-25 Thread Joe Conway
Richard Huxton wrote: That's not quite the same though, because it means I need to split ABCAA..ABDBB into ABCAA..ABCZZ and ABDAA..ABDZZ but it's close enough unless someone is feeling clever this evening. Would (a series of) partial indexes help? Joe ---(end of broadca

Re: [SQL] Scalar in a range (but textual not numeric)

2004-02-25 Thread Richard Huxton
On Wednesday 25 February 2004 19:18, Richard Huxton wrote: > Large table representing non-overlapping blocks: > > blocks(id int4, min varchar, max varchar) > > SELECT * FROM blocks WHERE 'ABCDE' BETWEEN min AND max; > > The estimator gets the wrong plan because it doesn't realise there's (at > most

[SQL] Scalar in a range (but textual not numeric)

2004-02-25 Thread Richard Huxton
Large table representing non-overlapping blocks: blocks(id int4, min varchar, max varchar) SELECT * FROM blocks WHERE 'ABCDE' BETWEEN min AND max; The estimator gets the wrong plan because it doesn't realise there's (at most) only one block that can match. Can't use any of the geometry related

Re: [PERFORM] [HACKERS] [SQL] Materialized View Summary

2004-02-25 Thread Robert Treat
On Wed, 2004-02-25 at 03:19, Jonathan M. Gardner wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > I'm not sure if my original reply made it through. Ignore the last one if > it did. But I liked the last one :-) > > On Tuesday 24 February 2004 1:48 pm, Robert Treat wrote: > > On Tue

Re: [SQL] [HACKERS] Materialized View Summary

2004-02-25 Thread Mark Gibson
Jonathan M. Gardner wrote: You can view my summary at http://jonathangardner.net/PostgreSQL/materialized_views/matviews.html Comments and suggestions are definitely welcome. Fantastic, I was planning on a bit of materialized view investigations myself when time permits, I'm pleased to see you've

Re: [HACKERS] [SQL] Materialized View Summary

2004-02-25 Thread Jonathan M. Gardner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm not sure if my original reply made it through. Ignore the last one if it did. On Tuesday 24 February 2004 1:48 pm, Robert Treat wrote: > On Tue, 2004-02-24 at 12:11, Richard Huxton wrote: > > On Tuesday 24 February 2004 16:11, Jonathan M. Gardner