Re: [SQL] Arbitrary precision arithmatic with pgsql

2004-08-31 Thread Rajesh Kumar Mallah
Michael Glaesemann wrote: On Aug 31, 2004, at 8:55 PM, Rajesh Kumar Mallah wrote: The docs says that numeric type supports numbers upto any precision However tradein_clients=# SELECT cast(2^100 as numeric); 1. Does the specs not require pgsql to print a warning or info , will it not be

Re: [SQL] Arbitrary precision arithmatic with pgsql

2004-08-31 Thread Rajesh Kumar Mallah
aesemann grzm myrealbox com !DSPAM:4134745e87571738116768! -- regds Mallah. Rajesh Kumar Mallah +---+ | Tradeindia.com (3,11,246) Registered Users | | Indias' Leading B2B eMarketPlace

[SQL] Tsearch2 headline usage

2005-06-04 Thread Rajesh Kumar Mallah
Hi There, We are using tsearch2 for FTS implementation. For highlighting the search term in the result we are displaying the output of headline function which is supposed to tag (mark up) those stemmed words in the text that match any of the stemmed words in search term. The problem is that some

Re: [SQL] plpgsql dynamic record access

2005-06-08 Thread Rajesh Kumar Mallah
Ganesh, Did you have a look at example Example 35-2. A PL/pgSQL http://www.postgresql.org/docs/current/static/plpgsql-trigger.html Regds maLLAH ---(end of broadcast)--- TIP 8: explain analyze is your friend

[SQL] partial index on non default tablespace syntax

2005-06-18 Thread Rajesh Kumar Mallah
the TODO Regds Rajesh Kumar Mallah. ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

Re: [SQL] partial index on non default tablespace syntax

2005-06-18 Thread Rajesh Kumar Mallah
Fuhr,Tom and Everyone Extremely sorry for not consulting the docs. I was doing this: CREATE INDEX foo_name_idx ON foo (name) WHERE name IS NOT NULL TABLESPACE testspace ; Regds Rajesh Kumar Mallah. On 6/18/05, Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Sat, Jun 18, 2005 at 10:24:0

Re: [SQL] Help with a view

2005-09-22 Thread Rajesh Kumar Mallah
> Basically, what I've got is the first person and the tag_type. I can do > it with a function from PHP: > > function get_spouses($p) { > $handle = pg_query("select person from principals >where event in (select event from principals >where person

Re: [SQL] Issue with UPDATE statement on v8

2005-09-22 Thread Rajesh Kumar Mallah
On 9/23/05, Kenneth Hutchinson <[EMAIL PROTECTED]> wrote: > Hello, > > I'm sorry if this has been sent to the community multiple times. I am > not able to determine whether my posts have gotten through. If you have > rec'd this multiple times, please let me know. > > We have recently migrated to

[SQL] converting epoch to timestamp

2005-10-26 Thread Rajesh Kumar Mallah
Hi, Can anyone tell me how to convert epoch to timestamp ? ie reverse of : SELECT EXTRACT( epoch FROM now() ); +--+ |date_part | +--+ | 1130317518.61997 | +--+ (1 row) Regds mallah. ---(end of broadcast)--

Re: [SQL] converting epoch to timestamp

2005-10-27 Thread Rajesh Kumar Mallah
On 10/26/05, Richard Huxton wrote: > Rajesh Kumar Mallah wrote: > > Hi, > > > > Can anyone tell me how to convert epoch to timestamp ? > > > > ie reverse of : > > > > SELECT EXTRACT( epoch FROM now() ); > > I'd start with either Googl

[SQL] schema proxying virtual database

2009-09-13 Thread Rajesh Kumar Mallah
[ sorry if it is a repost, i am not sure if i am subscribed in -general ] Dear List, There are many opensource applications that support postgresql (eg , gforge , bricolage , dspam ..) but does not use schemas(namespaces) as a result of which you are forced to use/create a new database and loose

[SQL] transactional shared variable in postgresql

2006-11-18 Thread Rajesh Kumar Mallah
Hi , Is there any way to set a variable from a web application (using dbi/perl , libpq etc), and access the same variable from a C trigger inside a transaction ? the %_SHARED hash available in plperl provides only session level isolation and does not suit the requirement. Original problem: we

Re: [SQL] transactional shared variable in postgresql

2006-11-18 Thread Rajesh Kumar Mallah
hi, We do not want to modify our apps for doing auditing. we are considering table level auditing auditrail http://gborg.postgresql.org/project/audittrail/projdisplay.php seems to be doing a good job. i just need to access the "username" that starts the transaction in webapp from the trigger in a

Re: [SQL] Random()

2006-11-18 Thread Rajesh Kumar Mallah
On 11/17/06, A. Kretschmer <[EMAIL PROTECTED]> wrote: am Thu, dem 16.11.2006, um 16:31:14 -0200 mailte Ezequias Rodrigues da Rocha folgendes: > Hi list, > > I have a bigint collumn and I would like to generate a random number within the > numbers of my column. select from order by random()

Re: [SQL] transactional shared variable in postgresql

2006-11-18 Thread Rajesh Kumar Mallah
On 11/18/06, Volkan YAZICI <[EMAIL PROTECTED]> wrote: Hi, On Nov 18 06:00, Rajesh Kumar Mallah wrote: > Is there any way to set a variable from a web application (using > dbi/perl , libpq etc), and access the same variable from a C trigger > inside a transaction ? Why don't

Re: [SQL] Random()

2006-11-18 Thread Rajesh Kumar Mallah
On 11/18/06, A. Kretschmer <[EMAIL PROTECTED]> wrote: am Sat, dem 18.11.2006, um 23:02:33 +0530 mailte Rajesh Kumar Mallah folgendes: > >select from order by random() limit 1; > > This query will tend to get slower as the table grows because of the > sorting. Right. &

Re: [SQL] transactional shared variable in postgresql

2006-11-18 Thread Rajesh Kumar Mallah
On 11/19/06, Tom Lane <[EMAIL PROTECTED]> wrote: "Rajesh Kumar Mallah" <[EMAIL PROTECTED]> writes: > In our webapps, we use the same username to connect to the database > for all kind of updates. Hence we are not able to makeout whoo modified > what . Howev

[SQL] calling elog possibly causing problem in DirectFunctionCall1

2006-12-01 Thread Rajesh Kumar Mallah
Hi , In certain C trigger function following code snippet causes ERROR: --- elog (NOTICE , "before calling DirectFunctionCall1"); data->time_stamp = DirectFunctionCall1(timestamptz_in, CStringGetDatum("now")); elog (NOTICE , "after calling Direct

Re: [SQL] calling elog possibly causing problem in DirectFunctionCall1

2006-12-01 Thread Rajesh Kumar Mallah
On 12/1/06, Tom Lane <[EMAIL PROTECTED]> wrote: "Rajesh Kumar Mallah" <[EMAIL PROTECTED]> writes: > data->time_stamp = > DirectFunctionCall1(timestamptz_in, CStringGetDatum("now")); This code is incorrect, as timestamptz_in takes three arguments

Re: [SQL] calling elog possibly causing problem in DirectFunctionCall1

2006-12-01 Thread Rajesh Kumar Mallah
On 12/1/06, Tom Lane <[EMAIL PROTECTED]> wrote: "Rajesh Kumar Mallah" <[EMAIL PROTECTED]> writes: > data->time_stamp = > DirectFunctionCall1(timestamptz_in, CStringGetDatum("now")); This code is incorrect, as timestamptz_in takes three argument

[SQL] Proper way of iterating over the column names in a trigger function.

2006-12-06 Thread Rajesh Kumar Mallah
Hi, I am trying to interate over column names of a table on which a C trigger function is called on UPDATE/DELETE and INSERT. SPI function char * SPI_fname(TupleDesc rowdesc, int colnumber) is being used. looks like the function is returning column names like "pg.dropped.2" for d

Re: [SQL] Proper way of iterating over the column names in a trigger function. [ SOLVED]

2006-12-06 Thread Rajesh Kumar Mallah
On 12/6/06, Tom Lane <[EMAIL PROTECTED]> wrote: "Rajesh Kumar Mallah" <[EMAIL PROTECTED]> writes: > what is the proper way for iterating over column names of a table using > SPI_* functions. You need to pay attention to the attisdropped field of the TupleDesc entri

Re: [SQL] subquery abnormal behavior

2006-12-10 Thread Rajesh Kumar Mallah
On 12/11/06, Shoaib Mir <[EMAIL PROTECTED]> wrote: I just noticed an abnormal behavior for the subquery: create table myt1 (a numeric); create table myt2 (b numeric); select a from myt1 where a in (select a from myt2); This should be giving an error that column 'a' does not exist in myt2 b

[SQL] ordering of selected rows from an ordered subselect

2007-02-17 Thread Rajesh Kumar Mallah
Hi, we know that rows in a table are not stored in any particular order and explicit order by clause is required to get data in any particular order. but does it apply to select queries from ordered subselects also ? eg select id , name , expensive_func(name) from ( select id , name f

Re: [SQL] selecting random row values in postgres

2007-02-23 Thread Rajesh Kumar Mallah
On 2/24/07, Sumeet <[EMAIL PROTECTED]> wrote: Hi all, I'm trying to write a query to select random values from a set of 'GROUP BY' see the scenario below to understand the problem here (the actual problem cannot be discussed here so i'm taking an example scenario) Assume there is a table

Re: [SQL] selecting random row values in postgres

2007-02-23 Thread Rajesh Kumar Mallah
L PROTECTED]> wrote: > > Thanks Buddy, really appreciate ur help on this > > problem solved... > > Is there any way this query can be optimized...i'm running it on a huge > table with joins > > - Sumeet > > > On 2/23/07, Rajesh Kumar Mallah <[E

Re: [SQL] Empty Table

2007-03-29 Thread Rajesh Kumar Mallah
psql> TRUNCATE TABLE ; if you have too many tables , generate the above commands by using a query on tables information schema table. hope it helps. On 3/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi list, I have many tables with many constraints and I would like to empty all my table

Re: [SQL] Empty Table

2007-03-29 Thread Rajesh Kumar Mallah
se (the database I used to make the backup). I think that's why pgAdmin does not work with plain backups on Restore. What does occurs with the information schema when I restore from one database with a name to other with another name ? Regards Ezequias Em Thu, 29 Mar 2007 23:46:31 +0530

Re: [SQL] Empty Table

2007-03-29 Thread Rajesh Kumar Mallah
>I dont think i clearly understand your requirement. > >Are you wanting to restore the "PLAIN" backup of a database >with a different database name ? > Yes Are you getting any particular error? what platform are you in ? >what do you mean "deleting information of current database ..." > Clear

Re: [SQL] Track query status

2007-03-29 Thread Rajesh Kumar Mallah
more methods: 1. select * from pg_stat_activity; see what all running and pid of your current query also. 2. SELECT h.pid AS blocker, w.pid AS blockee FROM ONLY pg_locks h, ONLY pg_locks w WHERE h."granted" AND NOT w."granted" AND (h.relation = w.relation AND h."database" = w."database" OR h.

[SQL] (possible) bug with constraint exclusion

2008-01-10 Thread Rajesh Kumar Mallah
Hi , looks like constraint exclusion is being too aggressive in excluding null values although its well known that check constraints apply on not null values only. Hope the minimal test session below explains the problem we facing. BTW: we are very impressed with the performance gains we achieved

Re: [SQL] (possible) bug with constraint exclusion

2008-01-10 Thread Rajesh Kumar Mallah
Update the phenomenon does not exists in 8.2.0 but exists in 8.2.5. On Jan 11, 2008 12:28 PM, Rajesh Kumar Mallah <[EMAIL PROTECTED]> wrote: > Hi , > > looks like constraint exclusion is being too aggressive in excluding null > values > although its well known that check

Re: [SQL] (possible) bug with constraint exclusion

2008-01-11 Thread Rajesh Kumar Mallah
On Jan 12, 2008 1:26 AM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Rajesh Kumar Mallah" <[EMAIL PROTECTED]> writes: > > looks like constraint exclusion is being too aggressive in excluding null > > values > > Hmm, you're right. Looks like I broke

Re: [SQL] (possible) bug with constraint exclusion

2008-01-12 Thread Rajesh Kumar Mallah
On Jan 12, 2008 10:54 AM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Rajesh Kumar Mallah" <[EMAIL PROTECTED]> writes: > > Am I correct in understanding that the current behavior is inappropriate > > and shall be corrected at some point of time in future versions ?

Re: [SQL] Must I use DISTINCT?

2009-02-05 Thread Rajesh Kumar Mallah
have you tried Join using , eg SELECT e.eid, e.name FROM entry e join access a ON( e.eid = 120 AND (e.ownid = 66 OR e.aid = a.aid) ) ; some sample data might also help in understanding the prob more clrearly. regds rajesh kumar mallah. On Fri, Feb 6, 2009 at 3:27 AM, Michael B Allen

<    1   2