Re: [SQL] mail alert

2009-08-11 Thread Shoaib Mir
> - Original Message - > *From:* Jan Verheyden > *To:* 'pgsql-sql@postgresql.org' <%27pgsql-...@postgresql.org%27> > *Sent:* Tuesday, August 11, 2009 6:31 PM > *Subject:* [SQL] mail alert > > Hi All, > > > > I was looking in what way it’s possible to alert via mail when some > conditions

Re: [SQL] mail alert

2009-08-11 Thread ramasubramanian
Hi, Can you just tell me whether your database is place on which server(linux/or windows or..)? - Original Message - From: Jan Verheyden To: 'pgsql-sql@postgresql.org' Sent: Tuesday, August 11, 2009 6:31 PM Subject: [SQL] mail alert Hi All, I was looking in wha

Re: [SQL] Month/year between two dates

2009-08-11 Thread ramasubramanian
Dear Bor, How you will 1 record for 2009/05 (if you use 2009/05 ) it will fetch all the records as it is not having month 05 am i correct? - Original Message - From: "Bor" To: Sent: Tuesday, August 11, 2009 6:43 PM Subject: [SQL] Month/year between two dates Hi to all, I hav

Re: [SQL] mail alert

2009-08-11 Thread Rob Sargent
Denis BUCHER wrote: Hello, Jan Verheyden a écrit : I was looking in what way it’s possible to alert via mail when some conditions are true in a database. a) If the alert is not "very urgent" i.e. you can alter some minutes later I would do it like this : 1. Create a function that ret

Re: [SQL] mail alert

2009-08-11 Thread Denis BUCHER
Hello, Jan Verheyden a écrit : > I was looking in what way it’s possible to alert via mail when some > conditions are true in a database. a) If the alert is not "very urgent" i.e. you can alter some minutes later I would do it like this : 1. Create a function that returns what you need, most imp

Re: [SQL] Month/year between two dates

2009-08-11 Thread Steve Crawford
Bor wrote: Hi to all, I have a very simple question. Let's say that I have three records (id, date from, date to): 1 2009-01-01 2009-08-31 2 2009-08-01 2009-08-10 3 2009-08-11 2009-08-31 Now I want to get records, "related" to a single month/year data (two integers). Fo

[SQL] Month/year between two dates

2009-08-11 Thread Bor
Hi to all, I have a very simple question. Let's say that I have three records (id, date from, date to): 1 2009-01-01 2009-08-31 2 2009-08-01 2009-08-10 3 2009-08-11 2009-08-31 Now I want to get records, "related" to a single month/year data (two integers). For 2009/08 (i

[SQL] mail alert

2009-08-11 Thread Jan Verheyden
Hi All, I was looking in what way it's possible to alert via mail when some conditions are true in a database. Thanks in advance! Jan

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Peter Headland
> Unfortunately, there is no single column that provides a unique id. Correction - I did not understand what ctid was, but now I do, so I will try your tip. -- Peter Headland Architect Actuate Corporation -Original Message- From: Peter Headland Sent: Tuesday, August 11, 2009 10:05 To

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Pavel Stehule
2009/8/11 Peter Headland : >> there are one fast trick >> http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks#Fast_first_n_rows_removing > > Thanks - that's a very useful page! > > Unfortunately, there is no single column that provides a unique id, and I am > reluctant to add one (for example,

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Peter Headland
> there are one fast trick > http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks#Fast_first_n_rows_removing Thanks - that's a very useful page! Unfortunately, there is no single column that provides a unique id, and I am reluctant to add one (for example, using a sequence and a new index) for

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Peter Headland
>Assuming that there is a unique identifier on queue Alas, there is not. The PK is made up of 4 columns. -- Peter Headland Architect Actuate Corporation -Original Message- From: D'Arcy J.M. Cain [mailto:da...@druid.net] Sent: Tuesday, August 11, 2009 03:25 To: Peter Headland Cc: pgsql-

Re: [SQL] Determining logically unique entities across many partially complete rows where at least one column matches

2009-08-11 Thread Rob Sargent
Seems to me that if you can safely identify which snippets correspond to a given entity you want a single id for the entity. An entity-snippet relationship seems a must. I would not lean too heavily on a single table solution unless you're considering arrays for openid,email and phone. (And g

[SQL] Re: Determining logically unique entities across many partially complete rows where at least one column matches

2009-08-11 Thread Jasen Betts
On 2009-08-11, Jamie Tufnell wrote: > Hi, > > I am faced with a modeling problem and thought I'd see if anyone has run > into something similar and can offer some advice. > > Basically my problem domain is cataloguing "snippets of information" about > "entities" which are loosely identified. > > E

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Pavel Stehule
2009/8/11 D'Arcy J.M. Cain : > On Mon, 10 Aug 2009 17:52:36 -0700 > "Peter Headland" wrote: >> I can get the rows I want to update like this: >> >>   SELECT * >>    FROM queue >>    WHERE id = p_queue_id >>    ORDER BY rank >>    LIMIT p_number_of_items; >> >> Of course, there may not be p_number_

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread D'Arcy J.M. Cain
On Mon, 10 Aug 2009 17:52:36 -0700 "Peter Headland" wrote: > I can get the rows I want to update like this: > > SELECT * >FROM queue >WHERE id = p_queue_id >ORDER BY rank >LIMIT p_number_of_items; > > Of course, there may not be p_number_of_items available in the queue. > > I