Re: [HACKERS] ORDER BY and DISTINCT ON

2003-12-13 Thread Neil Conway
Greg Stark <[EMAIL PROTECTED]> writes: > Do you really want: > > select distinct on (b,c,a) a,b,c from abc order by b,c,a; > > or is that you want > > select * from (select distinct on (a) a,b,c order by a) order by > b,c,a; If I understand you correctly, I don't think I would expect either. -

Re: [HACKERS] Walker/mutator prototype.

2003-12-13 Thread Greg Stark
Kurt Roeckx <[EMAIL PROTECTED]> writes: > I'm trying to change all the walkers and mutators to have a more > strict prototype. I had to do this with lots of casts. > > I don't really like the idea of having all those generic pointer > types (Node * and void *), but currently see no better way to

Re: [HACKERS] ORDER BY and DISTINCT ON

2003-12-13 Thread Greg Stark
Neil Conway <[EMAIL PROTECTED]> writes: > We reject the following query: > > nconway=# create table abc (a int, b int, c int); > CREATE TABLE > nconway=# select distinct on (a) a, b, c from abc order by b, c, a; > ERROR: SELECT DISTINCT ON expressions must match initial ORDER BY > expressions W

Re: [HACKERS] WITH clause

2003-12-13 Thread Greg Stark
Hannu Krosing <[EMAIL PROTECTED]> writes: > SELECT x.* > FROM x, > (select match (x.foo, '([0-9]+)x([0-9]+)') > from x innerx >where innerx.pk = x.pk >) as res > HAVING y = get_match_group(res, 2) > OR y = get_match_group(res, 3) > ; Well you don't need to go

Re: [HACKERS] ORDER BY and DISTINCT ON

2003-12-13 Thread Bruno Wolff III
On Fri, Dec 12, 2003 at 18:39:20 -0500, Neil Conway <[EMAIL PROTECTED]> wrote: > /* >* If the user writes both DISTINCT ON and ORDER BY, then the >* two expression lists must match (until one or the other >* runs out). Otherwise the O

Re: [HACKERS] WITH clause

2003-12-13 Thread Hannu Krosing
David Fetter kirjutas L, 13.12.2003 kell 23:17: > On Sat, Dec 13, 2003 at 10:58:59PM +0200, Hannu Krosing wrote: > > David Fetter kirjutas R, 12.12.2003 kell 20:13: > > > Kind people, > > > > I'm looking to the SQL WITH clause as a way to get better regex > > > support in PostgreSQL. I've been ch

Re: [HACKERS] WITH clause

2003-12-13 Thread David Fetter
On Sat, Dec 13, 2003 at 10:58:59PM +0200, Hannu Krosing wrote: > David Fetter kirjutas R, 12.12.2003 kell 20:13: > > Kind people, > > I'm looking to the SQL WITH clause as a way to get better regex > > support in PostgreSQL. I've been chatting a little bit about > > this, and here's an idea for a

Re: [HACKERS] WITH clause

2003-12-13 Thread Hannu Krosing
David Fetter kirjutas R, 12.12.2003 kell 20:13: > Kind people, > > I'm looking to the SQL WITH clause as a way to get better regex > support in PostgreSQL. I've been chatting a little bit about this, > and here's an idea for a behavior. Implementation details TBD. > > WITH res = match (x.foo, '

Re: [HACKERS] WITH clause

2003-12-13 Thread Dennis Bjorklund
On Sat, 13 Dec 2003, Christopher Browne wrote: > Unfortunately, this doesn't seem to fit with the way WITH is defined > in SQL. How is the WITH construct defined in SQL? -- /Dennis ---(end of broadcast)--- TIP 7: don't forget to increase your fr