Re: [SQL] catch an 'update where false' ?

2005-08-14 Thread santiago
Hi thanks all for your answers ! to Lane Van Ingen: my purpose is to write a trigger on update so that 'users' might then us update without having to perform the if found. I don't know if I was clear about that idea, but the checks on where update will or not succeed, is what I'm trying to hide

[SQL] How to encrypt a column

2005-08-14 Thread Jeff Lu
Hi, I'm interested in encrypting column in table. Are there any example using "C" to create the encrypted column, inserting and retreiving data to/from it? Thank you __Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around

[SQL] sql function: using set as argument

2005-08-14 Thread Akshay Mathur
Hi, I have a function that returns a set. Looks like: Select a_column from a_table where some_condition; I want to use output of this function as an argument of another function Second looks like: Get_count(result_set_of_function_1, int) Select count(b_column) from

[SQL] insert into / select from / serial problem

2005-08-14 Thread tgh002
I am using a insert statement like: INSERT INTO newtable SELECT field1, field2 FROM anothertable newtable structure is: serial, varchar, varchar What syntax do I use to insert the serial field? Ive tried something like: INSERT INTO newtable SELECT nextval('newtable_id_seq'), field1, field2

[SQL] Select problems

2005-08-14 Thread Lucas Grijander
Hi: I've just migrated from Linux/PostgreSQL 7.2 to Windows/PostgreSQL 8.0.3. I have a large view. When I make: Select . WHERE mydate = 'anydate' the view lasts 19 seconds to complete. But, when I make: Select . WHERE mydate = 'anydate' the view lasts 7 minutes. With PostgreSQL 7.2

[SQL] Parentheses in FROM clause and evaluation order.

2005-08-14 Thread dario . mx
Hi, I thought that the parenthesis in the table expression (FROM clause), could be used to indicate the desired evaluation order. But, I tried with a couple of samples and the explain command returned me the same result; no matter what parentheses association I used. I am using only INNER

[SQL] trigger between to different database

2005-08-14 Thread Haris Saybasili
Hi everybody, I have two databasese: database1 and database2. I want to set a trigger on a table of database1 which will insert some values to a table of database2. Is it possible with postgresql? How can I find detailed information about that? Thanks in advance, haris

Re: [SQL] sum but not grouped by?

2005-08-14 Thread Luca Rasconi Master
let ff your table... try this: select a.id, a.date, a.hours, (select sum(b.hours) from ff as b where a.id = b.id group by b.id ) as a from ff as a; bye, Luca Henry Ortega ha scritto: I have the ff data: id | date | hours AAA07-01-2005

Re: [SQL] insert into / select from / serial problem

2005-08-14 Thread Tom Lane
tgh002 [EMAIL PROTECTED] writes: I am using a insert statement like: INSERT INTO newtable SELECT field1, field2 FROM anothertable newtable structure is: serial, varchar, varchar What syntax do I use to insert the serial field? I think you want to just let it default, which you'd do with,

Re: [SQL] trigger between to different database

2005-08-14 Thread Kenneth Gonsalves
On Tuesday 09 Aug 2005 12:11 am, Haris Saybasili wrote: Hi everybody, I have two databasese: database1 and database2. I want to set a trigger on a table of database1 which will insert some values to a table of database2. Is it possible with postgresql? How can I find detailed information

Re: [SQL] catch an 'update where false' ?

2005-08-14 Thread Alvaro Herrera
On Sun, Aug 14, 2005 at 03:13:15PM +0200, santiago wrote: according to my book, triggers are only implemented whit the FOR EACH ROW clause in postgres, and not available in the FOR EACH STATEMENT case. has this changed in some new version ? which shall I use then ? Yes, it was added in