Re: [SQL] Identifying which column matches a full text search

2008-07-30 Thread Richard Huxton
Ryan Wallace wrote: Richard Huxton wrote: Failing that, where I've had many (a dozen) different sources but want to search them all I've built a textsearch_blocks table with columns to identify the source and have triggers that keep it up to date. Once you've built the text search blocks tabl

Re: [SQL] Identifying which column matches a full text search

2008-07-30 Thread Ryan Wallace
Richard Huxton wrote: > > Failing that, where I've had many (a dozen) different sources but want > to search them all I've built a textsearch_blocks table with columns to > identify the source and have triggers that keep it up to date. Once you've built the text search blocks table, how do you s

Re: [SQL] order function in aggregate

2008-07-30 Thread Tom Lane
Richard Huxton <[EMAIL PROTECTED]> writes: > Michael Toews wrote: >> This is where I get confused, since in the aggregate function, I have >> specified `SORTOP="<"`, which according to the documentation >> (http://www.postgresql.org/docs/8.3/interactive/sql-createaggregate.html) >> "must be equi

Re: [SQL] order function in aggregate

2008-07-30 Thread Richard Huxton
Michael Toews wrote: Now, I would like to group a summary of the strings in "sub", but they must be ordered alphabetically. Here I attempt the SQL: select commacat(sub), grp from aggr_test group by grp; However, on my system it will output the "commacat" column as: "one, two, three";"pom

[SQL] order function in aggregate

2008-07-30 Thread Michael Toews
Hi, I'm relatively new to object oriented databases and postgres (~ 4 months), so I'm not sure what is wrong with my custom aggregate function. I'm using Postgres 8.3.3 (results are same on Windows and Ubuntu versions). Here is my data required to explain my problem:

Re: [SQL] Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date

2008-07-30 Thread Emi Lu
I am expecting something like: sql> select data_part('day name', current_date); sql> Monday sql> select data_part('day number', current_date); sql> 1 (Mon =1 ... Sun =7?) Thanks a lot! http://www.postgresql.org/docs/current/static/functions-formatting.html This is exactly what I am look

Re: [SQL] Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date

2008-07-30 Thread Bricklen Anderson
Emi Lu wrote: Good morning, Could someone tell me the command to get the weekly day name and day number please. I am expecting something like: sql> select data_part('day name', current_date); sql> Monday sql> select data_part('day number', current_date); sql> 1 (Mon =1 ... Sun =7?) Thank

Re: [SQL] Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date

2008-07-30 Thread Pavel Stehule
Hello use to_char function postgres=# select to_char(current_date, 'day'); to_char --- wednesday (1 row) postgres=# select extract(dow from current_date); date_part --- 3 (1 row) regards Pavel 2008/7/30 Emi Lu <[EMAIL PROTECTED]>: > Good morning, > > Could someone

[SQL] Re: Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date

2008-07-30 Thread Milen A. Radev
Emi Lu написа: Good morning, Could someone tell me the command to get the weekly day name and day number please. I am expecting something like: sql> select data_part('day name', current_date); sql> Monday sql> select data_part('day number', current_date); sql> 1 (Mon =1 ... Sun =7?) You

[SQL] Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date

2008-07-30 Thread Emi Lu
Good morning, Could someone tell me the command to get the weekly day name and day number please. I am expecting something like: sql> select data_part('day name', current_date); sql> Monday sql> select data_part('day number', current_date); sql> 1 (Mon =1 ... Sun =7?) Thanks a lot! -- Se