Re: [SQL] Calculating relative time/distance from CURRENT_TIMESTAMP

2011-08-04 Thread Amitabh Kant
Have you looked into the date time functions already ? http://www.postgresql.org/docs/9.0/static/functions-datetime.html Amitabh Kant On Thu, Aug 4, 2011 at 1:24 PM, Gnanakumar wrote: > Hi, > > Is there any built-in function/add-on module available in PostgreSQL, that > conv

Re: [SQL] Storage of Indian Language text in postgresql through PHP

2011-06-14 Thread Amitabh Kant
On Tue, Jun 14, 2011 at 12:47 PM, INDER wrote: > Hello Everyone. I am new to this group and as well as to the Postgres > also. Can anybody tell me that how to insert hindi text into postgres > that a user has entered from html input with the use of PHP. Please I > am waiting for the reply. > > No

Re: [SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Amitabh Kant
On Fri, Jan 28, 2011 at 2:57 AM, Scott Marlowe wrote: > On Thu, Jan 27, 2011 at 10:50 AM, Amitabh Kant > wrote: > > Hi > > > > I am trying to write a function which is being called from a trigger used > > for partitioning a large table. The partitioning is to happen

Re: [SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Amitabh Kant
#x27;||quote_literal(Field2)||')'; > exec(sql); > > On Thu, Jan 27, 2011 at 6:50 PM, Amitabh Kant wrote: > >> Hi >> >> I am trying to write a function which is being called from a trigger used >> for partitioning a large table. The partitioning is to hap

[SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Amitabh Kant
Hi I am trying to write a function which is being called from a trigger used for partitioning a large table. The partitioning is to happen based on an integer field (testing_id). A simplified structure of what I am trying to do is written below. Create Table tbltesting( testing_id int not null,

Re: [SQL] Automating PostgreSql table partition using triggers

2011-01-27 Thread Amitabh Kant
On Thu, Jan 27, 2011 at 11:20 PM, Amitabh Kant wrote: > Hi > > I am trying to write a function which is being called from a trigger used > for partitioning a large table. The partitioning is to happen based on an > integer field (testing_id). A simplified structure of what I am tr

Re: [SQL] Referencing external table in update/insert triggers

2010-02-18 Thread Amitabh Kant
On Thu, Feb 18, 2010 at 2:53 PM, Richard Huxton wrote: > On 17/02/10 15:18, Amitabh Kant wrote: > >> >> CREATE OR REPLACE FUNCTION update_data() RETURNS TRIGGER AS $update_data$ >> BEGIN >> IF NEW.t1f4> t2.t2f4 >> UPDATE t2 set t2f2=NEW.t

[SQL] Referencing external table in update/insert triggers

2010-02-17 Thread Amitabh Kant
Hi I have the following table structure for which I am trying to set a AFTER INSERT or UPDATE trigger: CREATE OR REPLACE FUNCTION update_data() RETURNS TRIGGER AS $update_data$ BEGIN IF NEW.t1f4 > t2.t2f4 UPDATE t2 set t2f2=NEW.t1f2, t2f3=NEW.t1f3, t2f4=NEW.t1f4 where t2f1=NEW.d1;