[SQL] schema proxying virtual database

2009-09-13 Thread Rajesh Kumar Mallah
database that links to existing maindb databases' rt3 namespace then any DDL / DML done to public schema of rt3 database is redirected to rt3 namespace of the existing database maindb's rt3 schema. regds mallah.

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

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] (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-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

[SQL] (possible) bug with constraint exclusion

2008-01-10 Thread Rajesh Kumar Mallah
; SELECT * from x where id is null; id (0 rows) tradein_clients=> SET constraint_exclusion to off; SET tradein_clients=> SELECT * from x where id is null; id -- NULL (1 row) tradein_clients=> Regds mallah. ---(end of broadcast)-

Re: [SQL] Track query status

2007-03-29 Thread Rajesh Kumar Mallah
ve the system calls , see if anything awkward there shoud be a lot of writes 4. iostat ofcourse, unless the above sql is the only sql(update) running running in server . my 4cents regds mallah. On 3/29/07, Andrew Sullivan <[EMAIL PROTECTED]> wrote: On Wed, Mar 28, 2007 at 04:59:24PM

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] 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
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] selecting random row values in postgres

2007-02-23 Thread Rajesh Kumar Mallah
ed. usually same row keeps getting selected. but if you want a really random rows to come order by is required. if you need certainty about the particular row being selected order by a non random() column is required. regds mallah. Thanks for all you help -Sumeet. On 2/23/07, Sumeet <[EMAI

Re: [SQL] selecting random row values in postgres

2007-02-23 Thread Rajesh Kumar Mallah
) Assume there is a table id | name | year_of_birth query: I want to select for each year_of_birth a random name. Dear Sumeet postgresql DISTINCT ON may be of help , but its not standard sql. regds mallah. tradein_clients=> SELECT * from temp.test; ++--+-+ | id | name | yob |

[SQL] ordering of selected rows from an ordered subselect

2007-02-17 Thread Rajesh Kumar Mallah
from tab order by c1 desc limit 15) as foo ; is it guaranteed that the final result is order by c1 ? Regds mallah. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] subquery abnormal behavior

2006-12-10 Thread Rajesh Kumar Mallah
ot exist in myt2 but it runs with any error... I had been trying it on 8.2! Even in 8.1.5 it does not complain. (its not 8.2 specific at least) Regds mallah. Can someone please comment? Thank you, - Shoaib Mir EnterpriseDB (www.enterprisedb.com) ---(

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

[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] 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

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

[SQL] calling elog possibly causing problem in DirectFunctionCall1

2006-12-01 Thread Rajesh Kumar Mallah
ecision must be between 0 and 6 ROLLBACK If the elog before DirectFunctionCall1 is removed the code works fine. begin work;INSERT INTO audittest.test_table (name,foo) values ('test','test'); rollback; BEGIN NOTICE: after calling DirectFunctionCall1 INSERT 0 1 ROLLBACK Can anyone please explain how removing a elog makes a difference? Regds Mallah.

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

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/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
m order by random() limit 1; This query will tend to get slower as the table grows because of the sorting. it possible to get a row from a random offset how about select from limit 1 offset 2*random() ; ? regds mallah. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242

Re: [SQL] transactional shared variable in postgresql

2006-11-18 Thread Rajesh Kumar Mallah
s it is an internal stuff. regds mallah. ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

[SQL] transactional shared variable in postgresql

2006-11-18 Thread Rajesh Kumar Mallah
ow and single column to store the userid but we are concerned over the performance due to locking issues. Regds Mallah.

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] 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] Issue with UPDATE statement on v8

2005-09-22 Thread Rajesh Kumar Mallah
w which pid corresponds to which sql. http://www.postgresql.org/docs/8.0/interactive/monitoring-stats.html#MONITORING-STATS-SETUP Hope it helps regds mallah. If the UPDATE is turned into a SELECT, the query > works just fine. For some reason, the UPDATE is just not working. This >

Re: [SQL] Help with a view

2005-09-22 Thread Rajesh Kumar Mallah
by p1 and p2. might consider grouping by all other columns except person and use an aggregate function over person , CREATE VIEW blah AS select list(person) as persons , event , place , sort_date , tag_type from principals group by event , place , sort_date , tag_type ; (list is a custom function

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

[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] 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] Tsearch2 headline usage

2005-06-04 Thread Rajesh Kumar Mallah
lants in various capacities. Pasteuriser, Homogenizer, Surface Cooler, Plate Chiller, Ageing Vat, Ice Cream (1 row) Regds Mallah.

Re: [SQL] Significance of Database Encoding

2005-05-15 Thread Rajesh Mallah
)) > break > except UnicodeError: > pass > else: > print "No suitable encoding for line..." This may not work . Becuase ,conversion to utf-8 can be successfull (no runtime error) even for an incorre

Re: [SQL] Significance of Database Encoding

2005-05-15 Thread Rajesh Mallah
accomplised reliably. Also my database may contain data in multiple encodings like WINDOWS-1251 and WINDOWS-1256 in various places as data has been inserted by different peoples using different sources and client software. Regds Rajesh Kumar Mallah. > Using SQL ASCII to sto

Re: [SQL] Significance of Database Encoding [ update ]

2005-05-15 Thread Rajesh Mallah
I am not sure why the characters did not display properly in the mailling list archives. http://archives.postgresql.org/pgsql-sql/2005-05/msg00102.php but when i do the select in my screen (xterm -u8) i do see the japanese glyphs properly. Regds Mallah. --- Rajesh Mallah <[EM

[SQL] Significance of Database Encoding

2005-05-15 Thread Rajesh Mallah
migrating databases from SQL_ASCII to UNICODE, given the above observation what significance does a migration have. Regards Rajesh Kumar Mallah. __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http

Re: [SQL] Arbitrary precision arithmatic with pgsql

2004-08-31 Thread Rajesh Kumar Mallah
arning or info message were appropriate at some stage so that people do not confuse it with sielent loss of accuracy . I know this example is *not* a case of where postgresql is truncating data at the insert level (like mysql does) but at the calculation level. regds mallah. regds mallah. Michael Gl

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

[SQL] Arbitrary precision arithmatic with pgsql

2004-08-31 Thread Rajesh Kumar Mallah
any way to do such calculation using pgsql, i understand bc is a better tool for it. Warm Regards Rajesh Kumar Mallah. -- regds Mallah. Rajesh Kumar Mallah +---+ | Tradeindia.com (3,11,246) Registered Users | | Indias' Leading B2B eMarket

Re: [SQL] Comparing tsearch2 vectors.

2004-07-12 Thread Rajesh Kumar Mallah
Achilleus Mantzios wrote: O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : Achilleus Mantzios wrote: O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : Dear Mantzios, I have to get set of banners from database in response to a search term. I want that the search term

Re: [SQL] Secure DB Systems - How to

2004-07-12 Thread Rajesh Kumar Mallah
his functionality by default? Slony and many other replication solution exists for asyncronous replication. Hope it helps a bit. Regds Mallah. d) Other secure method that I have not yet mentioned. Anyone has good ideas on how to implement such a systems? Thanks

Re: [SQL] Comparing tsearch2 vectors.

2004-07-12 Thread Rajesh Kumar Mallah
Achilleus Mantzios wrote: O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : Dear Mantzios, I have to get set of banners from database in response to a search term. I want that the search term be compared to the keyword corresponding to the banners stored in database. current i am doing

Re: [SQL] Comparing tsearch2 vectors.

2004-07-12 Thread Rajesh Kumar Mallah
and keywords). So that the banners for the adword say 'incense exporter' is shown even if 'incenses exporter' or 'incense exporters' is searched. I hope i am able to clarify. Regds Mallah. Achilleus Mantzios wrote: O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 20

[SQL] Comparing tsearch2 vectors.

2004-07-12 Thread Rajesh Kumar Mallah
Hi, We want to compare strings after stemming. Can anyone tell me what is the best method. I was thinking to compare the tsvector ,but there is no operator for that. Regds Mallah. tradein_clients=# SELECT to_tsvector('handicraft exporters'); +---+ |t

Re: [SQL] Problem in Stored Procedures

2004-07-10 Thread Rajesh Kumar Mallah
Pradeepkumar, Pyatalo (IE10) wrote: Hi all, I m using Postgresql version 7.1.3-2. The create type and create function does work in PostgreSQL 7.4 without any modification. I guess the features you are trying to use are not supported in 7.1.x Regds Mallah. I have written a function which accepts

Re: [SQL] Query becoming slower on adding a primary key [ SOLVED

2004-06-10 Thread Rajesh Kumar Mallah
HI, The problem was solved by reducing the effective_cache_size from 102400 to 10240 my total RAM is 4GB. Regds mallah. Tom Lane wrote: [EMAIL PROTECTED] writes: tradein_clients=# explain analyze select email_id ,email ,contact from t_a a join email_source f using(email_id

Re: [SQL] Query becoming slower on adding a primary key

2004-06-08 Thread Rajesh Kumar Mallah
Hi, Is there any solution to this issue ? I am facing it every week. Warm Regds Mallah. Rajesh Kumar Mallah wrote: Tom Lane wrote: [EMAIL PROTECTED] writes: tradein_clients=# explain analyze select email_id ,email ,contact from t_a a join email_source f using(email_id) join email_subscriptions

Re: [SQL] Query becoming slower on adding a primary key

2004-06-02 Thread Rajesh Kumar Mallah
Even the first query used to run fine before but one fine day it changed plans i think. Regds Mallah. Rajesh Kumar Mallah wrote: Tom Lane wrote: [EMAIL PROTECTED] writes: tradein_clients=# explain analyze select email_id ,email ,contact from t_a a join email_source f using(email_id) join

Re: [SQL] assistance on self join pls

2004-06-02 Thread Rajesh Kumar Mallah
: select inside_ip,outside_ip , sum(outbound_bytes) as total_traffic from connection_data group by inside_ip,outside_ip ; Hope it helps. Regds Mallah. email lists wrote: Hi all, I have the following firewall connection data. datetime | protocol | port | inside_ip| outside_ip

Re: [SQL] Query becoming slower on adding a primary key

2004-06-02 Thread Rajesh Kumar Mallah
n using email_source_pkey on email_source f  (cost=0.00..52602.59 rows=324994 width=4) | | Filter: (source_id = 1)   | +---+ (10 rows) Time: 2436.551 ms tradein_clients=# Regds Mallah. regards, tom lane

[SQL] Query becoming slower on adding a primary key

2004-06-01 Thread mallah
table it does not work. Can anyone please help me with this problem? below are the details. thanks in advance. Regds Mallah. explain analyze select email_id ,email ,contact from t_a a join email_source f using(email_id) join email_subscriptions h using(email_id) where 1=1 and f.source_id =1 and

Re: [SQL] Problem in SQL Trigger

2004-04-30 Thread Rajesh Kumar Mallah
Can you tell us about the postgresql versions in 7.3 and 9.0 also post the actuall error message from postgresql. regds mallah. Ramesh Patel wrote: Hi i have one problem in Trigger. this trigger alread work on Red Hat Linux 7.3 but now i shift to RHL9.0 in RHL 9.0 not working . in this problem

Re: [SQL] Logical comparison on Strings

2004-04-27 Thread Rajesh Kumar Mallah
kumar wrote: Dear Friends, Postgres 7.3.2 on Linux 7. I want to compare to columns and get the logical result as follows. C1 is 'YNYNY' . C2 is 'NNYYY'. I want to compare like AND and OR operators. C1 AND C2 should give result like NNYNY. C1 OR C2 should give result like YNYYY. Bit Strin

Re: [SQL] Querying two databases

2004-04-16 Thread Rajesh Kumar Mallah
hi, its not possible to join cross database tables . you may keep tables in different schemas instead of databases. you may also try contrib/dblink to use tables from different database. Regds mallah. Pallav Kalva wrote: Hi, I am new to postgres and I need to do a query which joins two

[SQL] Tsearch2 question: getting histogram of the vector elements

2004-03-10 Thread Rajesh Kumar Mallah
ernate / better solution to this problem. Regds Mallah. SAMPLE DATA. +-+--+ | co_name

Re: [ADMIN] [SQL] Database diagram

2004-01-23 Thread Rajesh Kumar Mallah
Dear Ganesan, pgautodoc (for dot output) + dot (from graphviz.org , creates postscript) + epssplit ( splits the postscript into multipage so that one can create poster size diagrams) works well for me. I have 45 tables in the database though. Regds mallah. Chris Travers wrote: There is a

[SQL] array_lower /array_prepend doubt

2004-01-21 Thread Rajesh Kumar Mallah
=# SELECT array_lower( ARRAY[0,1,2,3],1 ); +-+ | array_lower | +-+ | 1 | +-+ (1 row) Time: 402.614 ms Regds Mallah. ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate

[SQL] Adding a column to a VIEW which has dependent objects.

2004-01-10 Thread Rajesh Kumar Mallah
of a given object. Does information_schema helps here. Regds mallah. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] transaction processing after error in statement

2003-11-10 Thread Rajesh Kumar Mallah
not a violation of above defination of transaction ? Regds Mallah. The "execution result is completely successful" could certainly be used to back up PostgreSQLs choice to force a rollback. However, it doesn't differentiate between execution of what the user requested, and e

Re: [SQL] Joined deletes but one table being a subquery.

2003-08-23 Thread Rajesh Kumar Mallah
ECT userid,category_id from eyp_listing where userid=21742 and size ilike '%WEBFL%' EXCEPT SELECT userid,category_id from company_export_profile where userid=21742 ) regds mallah. On Friday 22 Aug 2003 3:53 pm, Tomasz Myrta wrote: > > Hi Folks, > > > > DELETE from e

[SQL] Joined deletes but one table being a subquery.

2003-08-22 Thread Rajesh Kumar Mallah
Hi Folks, DELETE from eyp_listing where userid=t_a.userid and category_id=t_a.category_id; such queries work perfectly. but if t_a is a subquery how to accomplish the delete. Regds Mallah. ---(end of broadcast)--- TIP 5: Have you checked our

Re: [SQL] ALTER TABLE ... DROP CONSTRAINT

2003-07-30 Thread Rajesh Kumar Mallah
if the constraint are named $1 $2 etc you will need to quote them eg ALTER TABLE xyz DROP CONSTRAINT "$1" ; in some version you may require ALTER TABLE xyz DROP CONSTRAINT "$1" RESTRICT; What is ur version btw? try to post the table structure also. regds mallah. Elie

Re: [SQL] relevance

2003-07-17 Thread Rajesh Kumar Mallah
then sort by the most matches, > >>or am I going to have to write a script to do the sorting for me? > > You could probably write a function in postgres (say, "matchcount()") > which returns the match count (possibly using perl and a regex). Why reinvent the wheel when

Re: [SQL] help yourself by helping others

2003-07-13 Thread Rajesh Kumar Mallah
the frontend language for formatting it. note that it will not display the days for which there has been no withdrawls. If u need to report them also 0 then create a table that holds 1 year of dates and left or right join the output of first query with it. exact query is not being provided , its ju

Re: [SQL] Recursive request ...

2003-07-12 Thread Rajesh Kumar Mallah
Dear Bournon, There are already good implementation of Tree structures in databases ranging from using pure SQL to PostgreSQL specfic methods , less point in revinting wheel unless u really need. Some Pointers: "Tree-structure functions" http://www.brasileiro.net:8080/postgres/cookbook/ Gist

Re: [SQL] trigger proceedures in sql

2003-07-12 Thread Rajesh Kumar Mallah
Yes of course! contrib/dbmirror does execute a procedure written in 'C' called recordchange() ON update , insert , delete. If you need help in getting its source lemme know. regds Mallah. On Thursday 10 Jul 2003 11:10 am, adivi wrote: > hi, > > can trigger proceedures

Re: [SQL] Blobs

2003-07-12 Thread Rajesh Kumar Mallah
net. Rajesh Mallah. On Thursday 10 Jul 2003 4:40 pm, sri devi wrote: > hi > > we have to download url files in to oracle using BLOBs how to create oracle > table stucture how to write the query,we are using oracle9i,and > javaswings,reply me to this id. [EMAIL PROTECTE

Re: [SQL] substr_count

2003-07-11 Thread Rajesh Kumar Mallah
attempting to search text in a feild and sort it by relevence then contrib/tsearch V2 is for you. http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/ regds mallah. > Of course the substr_count function does not exist. Is there anyway to > do this? > > I had a thought char_count

Re: [SQL] max length of sql select statement ?

2003-07-07 Thread mallah
limit. May be someone else can answer it accurately. But you could produce the list within IN using a subselect that again depends on the exact problem. regds Mallah. > > And what means efficient? Goes the DB only once through the table? > > Cheers, Markus > > > > >

Re: [SQL] max length of sql select statement ?

2003-07-07 Thread mallah
Depending on ur original problem EXISTS or IN may be usable EXISTS is efficient and IN can be used efficiently in 7.4 version of postgresql regds mallah. > Hi All! > > I was searching the archive and was wondering why nobody asked this > strange(!) question (or I

Re: [SQL] disabling triggers

2003-06-17 Thread mallah
> Mallah, > >> >> Is setting reltriggers=0 on pg_class an accepatble way of >> >> disabling triggers on a table temporarily? >> >> Ok , but someone on list was scary few months back. > > I've done it many times without a problem. The trick i

[SQL] disabling triggers

2003-06-17 Thread mallah
we feel the trigger execution to be unneccessary. regds mallah. - Get your free web based email at trade-india.com. "India's Leading B2B eMarketplace.!" http://www.trade-india.com/ ---(e

Re: [SQL] disabling triggers

2003-06-17 Thread mallah
> Mallah, > >> Is setting reltriggers=0 on pg_class an accepatble way of >> disabling triggers on a table temporarily? Ok , but someone on list was scary few months back. > > Yes. pg_dump does this. > >> secondly is it worth having commands like >> al

[SQL] simulating partial fkeys..

2003-06-06 Thread mallah
hi , Is there any way to enforce fkeys only on subset of the table something on the lines of unique partial indexes or any work around ? (on update or insert trigger is the only thing i can think of) regds mallah. - Get your free web based email at

Re: [SQL] Getting rid of accents..

2003-05-27 Thread mallah
y text into database. Regds Mallah. > On Tuesday 27 May 2003 22:55, [EMAIL PROTECTED] wrote: >> Is there any easy way for converting accented text to >> closest text without accents in postgresql ? >> >> eg: >> >> BÂLÂ MORGHÂB to BALA MORGHAB > > Have

[SQL] Getting rid of accents..

2003-05-27 Thread mallah
Is there any easy way for converting accented text to closest text without accents in postgresql ? eg: BÂLÂ MORGHÂB to BALA MORGHAB Regds Mallah. - Get your free web based email at trade-india.com. "India's Leading B2B eMarketpla

Re: [SQL] Off topic : world database

2003-03-31 Thread Rajesh Kumar Mallah
application similar to you which shud be able to get all the places within certaint radius of the place in question. Any hint on how i shud be proceeding? Regds mallah. On Monday 31 Mar 2003 6:02 am, Rudi Starcevic wrote: > Hi all, > > A quick email to let you know where I'

Re: [SQL] FUNCTIONS PROBLEM

2003-03-23 Thread Rajesh Kumar Mallah
CREATE TYPE can be used as well i think in that case "as (val1 int, val2 int, val3 real, val4 char);" need not be done while selecting. regds mallah On Monday 24 Mar 2003 4:48 am, David Witham wrote: > Hi Mario, > > I have used a record type to do this: > > create m

Re: [SQL] explain

2003-03-21 Thread Rajesh Kumar Mallah
Dear Marian, in postgresql 7.3 explain commands retruns as set of rows. The result of EXPLAIN can just be fecthed as result of any other SELECT query and manipulated further. i hope it helps. sorry if i did not get ur problem rite. regds mallah. On Friday 21 Mar 2003 11:51 am

Re: [SQL] Novice needs help

2003-03-11 Thread Rajesh Kumar Mallah
shud use NOT EXISTS instead of NOT IN as others have suggested . becoz NOT IN is not very efficient at the moment except the case on there are small number of items in IN( ... ) regds mallah. On Wednesday 12 Mar 2003 2:16 am, Terry Lee Tucker wrote: > I answered my own question. Yes,

[SQL] sql question regarding count(*)

2003-03-06 Thread Rajesh Kumar Mallah
s=# tradein_clients=# tradein_clients=# SELECT count(*) from public.users where userid=-1; count --- 0 (1 row) tradein_clients=# -- Regds Mallah ---- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(

Re: [SQL] Help with query involving aggregation and joining.

2003-02-24 Thread Rajesh Kumar Mallah
ERROR: SELECT DISTINCT ON expressions must match initial ORDER BY expressions may be gotten over by wrapping the first query result in a subselect. not sure though if its proper. regds mallah. test=# SELECT * from ( SELECT distinct on (a.id) b.id ,courseid,name,submission from course a

Re: [SQL] function defination help ..

2003-02-22 Thread Rajesh Kumar Mallah
Thank you i will look into its source code. and try to find some solution for myself. regds mallah. On Saturday 22 February 2003 07:40 am, Peter Eisentraut wrote: > Rajesh Kumar Mallah writes: > > is it possible to get the function creation defination as produced by > > pg_d

[SQL] function defination help ..

2003-02-21 Thread Rajesh Kumar Mallah
Hi, is it possible to get the function creation defination as produced by pg_dump by some SQL queries on system catalogs? pg_func stores procsrc but i am trying to get RETURNS and the arg part also. -- Regds Mallah Rajesh Kumar Mallah, Project

Re: [SQL] good style?

2003-02-21 Thread Rajesh Kumar Mallah
Guide.) The genetic search takes less time, but it won't necessarily find the best possible plan. regds mallah. On Friday 21 February 2003 07:00 pm, Rafal Kedziorski wrote: > hi, > > I have 8 tables and this query: > > select u.users_id, m.name as mandant_n

Re: [SQL] " Adding missing FROM-clause entry for table .... " problem.

2003-02-21 Thread Rajesh Kumar Mallah
Hmmm i forgot to follow up. Thanks for pointing out the relevent Docs. Regds Mallah. On Tuesday 18 February 2003 04:04 pm, Christoph Haller wrote: > > We find that if we alias a tablename and refer to that tablename in > > where cluase instead of reffering > > > to the al

Re: [SQL] cannot EXPLAIN query...

2003-02-03 Thread mallah
Hi , This is to confirm that the EXPLAIN problem does not occur anymore after successfully upgrading to 7.3.1 from 7.3.0 Thanks everyone. Regards Mallah. explain select * from shippers1 where city='

Re: [SQL] cannot EXPLAIN query...

2003-02-03 Thread Rajesh Kumar Mallah.
ome to psql 7.3.1, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit tradein_clients=> regds mallah. On Monday

Re: [SQL] cannot EXPLAIN query...

2003-02-03 Thread Rajesh Kumar Mallah.
ef) > > Did you ever try > > SELECT * FROM pg_views ; i thing when you do a \d it uses that only. in any case i have verified that the content in them are equally messed up. regds mallah. > > It defini

Re: [SQL] cannot EXPLAIN query...

2003-02-03 Thread Rajesh Kumar Mallah.
Thanks , if that is so i am upgrading it right away and posting you the results. Its my live DB server :-) Regds mallah. On Monday 03 February 2003 09:15 pm, Tom Lane wrote: > "Rajesh Kumar Mallah." <[EMAIL PROTECTED]> writes: > > I think if i do that i will hve to im

Re: [SQL] cannot EXPLAIN query...

2003-02-03 Thread Rajesh Kumar Mallah.
Thank you . But i have a problem , I think if i do that i will hve to immediately upgrade all the 7.3.0 clients in other machines to 7.3.1 rite? regds Mallah. On Monday 03 February 2003 09:10 pm, Tom Lane wrote: > "Rajesh Kumar Mallah." <[EMAIL PROTECTED]> writes: > &g

Re: [SQL] cannot EXPLAIN query...

2003-02-03 Thread Rajesh Kumar Mallah.
dex), eyp_listing_company_id btree (company_id), eyp_listing_email btree (email), eyp_listing_group_id btree (group_id), eyp_listing_size btree (size), eyp_listing_sno_branch btree (branch, sno), eyp_listing_userid btree (userid) Check co

[SQL] cannot EXPLAIN query...

2003-02-03 Thread Rajesh Kumar Mallah.
in SELECT count(*) from shippers1 where city='DELHI'; ERROR: get_names_for_var: bogus varno 5 tradein_clients=# i can paste the nasty view definations if nothing is obvious till now. regds MAllah. Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New

Re: [SQL] Help with a query for charting

2003-02-02 Thread mallah
you could keep a table with list of all possible days in a month. left join that to the results you get from query below this will return NULL for days where there is no data. NULL could then easily converted to 0 using CASE or COALESCE. regds mallah. > I'm trying to do a query to c

Re: [SQL] returning table from a function

2003-02-02 Thread mallah
Hmm.. do you mean functions returning sets then http://techdocs.postgresql.org/guides/SetReturningFunctions is for you. regds mallah. - Get your free web based email at trade-india.com. "India's Leading B2B eMarketplace.!" h

Re: [SQL] Which version is this?

2003-01-31 Thread Rajesh Kumar Mallah.
your question doesnt' seem to be very clear. But the following appeared in release note of version 7.2 hope it helps regds mallah. ` A.5. Release 7.2 Release date: 2002-02-04 A.5.1. Overview This release improves PostgreSQL for use in high-volume applica

Re: [SQL] How to rename and drop a column in pg7.3?

2003-01-30 Thread mallah
Hmmm... both are supported in 7.3.x ALTER TABLE rtfm RENAME f1 to f2 ; ALTER TABLE rtfm DROP COLUMN f3; hope it helps. regds mallah. > > I need to rename and remove columns of a table. Is any new way to accomplish the two >tasks in > 7.3? I have searched the online document a

Re: [SQL] converting microsoft sql server 2000 sql-code for postgresql 7.2.1

2003-01-28 Thread Rajesh Kumar Mallah.
Only 1 small change makes it acceptable to pgsql. change datetime to timestamp . regds mallah. On Tuesday 28 January 2003 03:38 pm, william windels wrote: > Hello all, > > I a m a new member of the list and at the moment , I am studiing > informatica: sql. > > At the

Re: [SQL] Implementing automatic updating of primary keys...

2003-01-16 Thread Rajesh Kumar Mallah.
ter set id=1 where id=2 will not be accepted. regds mallah. On Wednesday 01 January 2003 06:11 pm, Tomasz Myrta wrote: > Rajesh Kumar Mallah. wrote: > >Hi we are working on re-structuring our database schemas and > >intend to implement the functionality below at database level.

  1   2   >