Re: [SQL] NULL becomes default

2006-08-20 Thread Julian Scarfe
Thus I would like NULLs in such INSERTs to be treated as DEFAULT rather than violating the constraint. Is there an easy way to do that at the database level? From: "Markus Schaber" <[EMAIL PROTECTED]> Did you try a "before insert" trigger that checks new_id for null values, and replaces it wi

[SQL] NULL becomes default

2006-08-17 Thread Julian Scarfe
A surrogate key has been introduced on a table with modifiers: Column|Type | Modifiers -+-+ new_id| integer | not null default nextval(('som

Re: [SQL] Negative lookbehind assertions in regexs

2005-09-03 Thread Julian Scarfe
I'd like a regex that matches 'CD' but not 'ABCD' in any part of the regex. From: "Bruno Wolff III" <[EMAIL PROTECTED]> Something like: (^.?CD)|([^B]CD)|([^A]BCD) Thanks to Bruno, and to Dawid who replied offline. The above does the job nicely. Any plans for a Perl Compatible Regular Exp

[SQL] Negative lookbehind assertions in regexs

2005-08-29 Thread Julian Scarfe
I'd like a regex that matches 'CD' but not 'ABCD' in any part of the regex. In Perl I'd use a negative lookbehind assertion (?Julian ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] Ordering in an aggregate -- points to paths

2003-06-16 Thread Julian Scarfe
ering by seq_no in the re-sort. Most grateful for the rapid response Tom. Knowing that, I can work around by iterating through the firs at the application level. Regards Julian Scarfe PS: you shouldn't be working on a Sunday, it's bad for you ;-) ---(end of

[SQL] Ordering in an aggregate -- points to paths

2003-06-15 Thread Julian Scarfe
87107,0.816959534037679), (0.244753338771338,0.849015414632642),(0.298204047113664,0.838528894710242), (0.277478262246232,0.852418806674031),... The ordering has gone awry. And since I'm going to draw the fir by 'joining the dots' that's a Bad Thing. Is

Re: [SQL] TIME vs. TIMESTAMP data type

2003-02-06 Thread Julian Scarfe
time, so TIMESTAMP is more appropriate. Since event timing is a much more frequent requirement than a time-of-day, it's not surprising that the facilities may be better developed for dealing with that type. Julian Scarfe ---(end of broadcast)---

Re: [SQL] sum(time) problem

2003-01-17 Thread Julian Scarfe
your second field. Interval is a time difference between two timestamps, for example the time between the start and the finish of a race. If you check out the available aggregates with \da you'll find that you can sum an interval, but not a time. Julian Scarfe ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Ordering with GROUPs

2002-08-19 Thread Julian Scarfe
declare location.ident properly. That makes a lot of sense, though I imagine there are higher priorities. Thanks for your help. Julian Scarfe ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

[SQL] Ordering with GROUPs

2002-08-18 Thread Julian Scarfe
2 | (2,1) | 1 | (2,2) | 0 (4 rows) For the test that works fine, but for my real life situation, the nested query seems to be very inefficient, taking vastly longer than the first query illustrated above. Since the information required is clearly contained in the r

Re: [SQL] Indexes with LIKE

2002-07-15 Thread Julian Scarfe
n indexes aren't used with LIKE, I've added a DocNote under Pattern Matching. Julian Scarfe ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[SQL] Indexes with LIKE

2002-07-13 Thread Julian Scarfe
appreciated. If the above doesn't ring any bells, I'll put together an example. Many thanks Julian Scarfe ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] RTREE on points

2001-04-16 Thread Julian Scarfe
Julian Scarfe wrote: > > > > explain select * from nodes where box(node,node) @ '((1,1),(3,3))'::box; > > NOTICE: QUERY PLAN: > > Seq Scan on nodes (cost=0.00..1.10 rows=1 width=28) From: "Jeff Hoffmann" <[EMAIL PROTECTED]> > this s

[SQL] RTREE on points

2001-04-15 Thread Julian Scarfe
RTREE (box(node,node)); CREATE but then: explain select * from nodes where node @ '((1,1),(3,3))'::box; NOTICE: QUERY PLAN: Seq Scan on nodes (cost=0.00..1.09 rows=4 width=28) and even: explain select * from nodes where box(node,node) @ '((1,1),(3,3))'::box; NOTICE: QUERY PLAN: Seq Scan on nodes (cost=0.00..1.10 rows=1 width=28) Thanks for any help Julian Scarfe ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster