Re: [GENERAL] Why does this SQL work?

2015-05-12 Thread Anil Menon
Thank you very much - looks like I will have to prefix all cols. Regards AK On Tue, May 12, 2015 at 3:05 AM, Victor Yegorov vyego...@gmail.com wrote: 2015-05-11 19:26 GMT+03:00 Anil Menon gakme...@gmail.com: manualscan= select count(*) From public.msgtxt where msgid in (select msgid From

[GENERAL] Why does this SQL work?

2015-05-11 Thread Anil Menon
Hi, I have the following setup : manualscan= set search_path=ver736,public; SET manualscan= \d courier; Table ver736.courier Column | Type |Modifiers

Re: [GENERAL] [SQL] function to send email with query results

2015-04-19 Thread Anil Menon
Using Apache camel Listen/notify -PGEvent Component (http://camel.apache.org/pgevent.html) - Mail Component (http://camel.apache.org/mail.html) You can also then handle all the exceptions of the email server easily. On Sun, Apr 19, 2015 at 6:42 AM, Jim Nasby jim.na...@bluetreble.com wrote: On

Re: [GENERAL] schema or database

2015-04-13 Thread Anil Menon
In addition to all these comments - If you use multiple databases, if you want to keep some common tables (example counties_Table, My_company_details), its going to be a pain - if you want to access tables across databases - you might need to start using FDWs (which is going to be a

[GENERAL] Strange behavior of insert CTE with trigger

2015-03-31 Thread Anil Menon
Hi, I am trying to wrap my head around a strange problem I am having. I have double checked the documentation but I could not find anything on this. I am attaching a simplified version of my problem. I my TEST 4 I expect 1 row but I get nothing. The test is with I(id) as ( insert into

Re: [GENERAL] Performance question

2014-11-22 Thread Anil Menon
) there is no impact on business Yours Anil On Fri, Nov 21, 2014 at 5:16 PM, Albe Laurenz laurenz.a...@wien.gv.at wrote: Anil Menon wrote: I would like to ask from your experience which would be the best generic method for checking if row sets of a certain condition exists in a PLPGSQL function

Re: [GENERAL] Performance question

2014-11-20 Thread Anil Menon
Thanks Adrian On Thu, Nov 20, 2014 at 3:46 AM, Adrian Klaver adrian.kla...@aklaver.com wrote: On 11/19/2014 08:26 AM, Anil Menon wrote: Hello, I would like to ask from your experience which would be the best generic method for checking if row sets of a certain condition exists

[GENERAL] Performance question

2014-11-19 Thread Anil Menon
Hello, I would like to ask from your experience which would be the best generic method for checking if row sets of a certain condition exists in a PLPGSQL function. I know of 4 methods so far (please feel free to add if I missed out any others) 1) get a count (my previous experience with ORCL

Re: [GENERAL] Basic question regarding insert

2014-11-03 Thread Anil Menon
Thank you John. That perfectly answered by question. Regards Anil On Sat, Nov 1, 2014 at 2:43 AM, John R Pierce pie...@hogranch.com wrote: On 10/31/2014 3:24 AM, Anil Menon wrote: I have a very basic question on inserts - I tried to get a good authoritative answer but could not really find

[GENERAL] Basic question regarding insert

2014-10-31 Thread Anil Menon
Hi, I have a very basic question on inserts - I tried to get a good authoritative answer but could not really find one to my satisfaction in the usual places. TLDR : can (after) insert trigger be run in parallel? Assume an OLTP environment were a lots of inserts are happening to a transaction

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-23 Thread Anil Menon
. Regards ​,​ A ​nil​ On 24 Jul 2014 02:03, Francisco Olarte fola...@peoplecall.com wrote: Hi Anil: On Tue, Jul 22, 2014 at 6:46 PM, Anil Menon gakme...@gmail.com wrote: Am a bit confused -which one comes first? 1) the 'data'||currval('id01_col1_seq') is parsed first : which means

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-22 Thread Anil Menon
Am a bit confused -which one comes first? 1) the 'data'||currval('id01_col1_seq') is parsed first : which means it takes the current session's currval 2) then the insert is attempted which causes a sequence.nextval to be performed which means that 'data'||currval('id01_col1_seq')will be different

[GENERAL] Referencing serial col's sequence for insert

2014-07-21 Thread Anil Menon
Hi, I have a question on the right/correct practice on using the serial col's sequence for insert. Best way of explanation is by an example: create table id01 (col1 serial, col2 varchar(10)); insert into id01(col2) values ( 'data'||currval('id01_col1_seq')::varchar); while I do get what I