[SQL] Appending to an array[] feild...[ ltree ]

2002-09-20 Thread Rajesh Kumar Mallah.
Hi , We are undergoing a data consolidation process wherein we are making a common repository of business profiles from various sources. I require to store label paths like 1.1.1 , 1.1.2,1.1.3 etc in a feild and i use ltree[] for fast searching. The problem is in the ltree[] feild in need to

Re: [SQL] Performance w/ multiple WHERE clauses

2002-09-20 Thread Josh Berkus
Aaron, > # SET enable_seqscan to FALSE ; > forced the use of an Index and sped things up greatly. > > I am not sure why it made the switch. The load on the server seems to > affect the performance, but I am seeing it more on the production server > with 100 million rows as oppose

Re: [SQL] [GENERAL] Getting acces to MVCC version number

2002-09-20 Thread Tom Lane
Jean-Luc Lachance <[EMAIL PROTECTED]> writes: > How about making available the MVCC last version number just like oid is > available. This would simplify a lot of table design. You know, having > to add a field "updated::timestamp" to detect when a record was updated > while viewing it (a la pga

Re: [SQL] [GENERAL] Monitoring a Query

2002-09-20 Thread Aaron Held
There are some good views and functions you can use to get at the SQL query being executed try turning on the stats collector and running select * from pg_stat_activity; (See http://www.postgresql.org/idocs/index.php?monitoring-stats.html ) You can also see the procID. From Python I can use t

Re: [SQL] [GENERAL] Monitoring a Query

2002-09-20 Thread Bruce Momjian
Uh, no, not yet. There is a non-X version of tcl but I don't think pgaccess will work under that. --- [EMAIL PROTECTED] wrote: > > I just downloaded and installed pgmonitor on my dev. machine after seeing > your post, and

[SQL] Getting acces to MVCC version number

2002-09-20 Thread Jean-Luc Lachance
Hi all developpers, This is just a idea. How about making available the MVCC last version number just like oid is available. This would simplify a lot of table design. You know, having to add a field "updated::timestamp" to detect when a record was updated while viewing it (a la pgaccess). Th

Re: [SQL] [GENERAL] Monitoring a Query

2002-09-20 Thread Bruce Momjian
There is pgmonitor: http://gborg.postgresql.org/project/pgmonitor --- Aaron Held wrote: > Is there any way to monitor a long running query? > > I have stats turned on and I can see my queries, but is there any bet

Re: [SQL] [GENERAL] Monitoring a Query

2002-09-20 Thread Bruce Momjian
Aaron Held wrote: > Is there any way to monitor a long running query? > > I have stats turned on and I can see my queries, but is there any better > measure of the progress? Oh, sorry, you want to know how far the query has progressed. Gee, I don't think there is any easy way to do that. Sorr

Re: [SQL] help w/ constructing a SELECT

2002-09-20 Thread Josh Berkus
Charles, > > 3. All contigs where all clones have read = 'x' SELECT * FROM contigs WHERE NOT EXISTS ( SELECT contig_id FROM clones WHERE clones.contig_id = contigs.contig_id AND read <> 'x'); i.e. "Select all contigs not having any clone whose read is something other than 'x' "

[SQL] Monitoring a Query

2002-09-20 Thread Aaron Held
Is there any way to monitor a long running query? I have stats turned on and I can see my queries, but is there any better measure of the progress? Thanks, -Aaron Held select current_query from pg_stat_activity; current_query in transaction FETCH ALL FROM PgSQL_470AEE94 in transaction s

Re: [SQL] [GENERAL] timestamp parse error

2002-09-20 Thread Tom Lane
"Tomas Lehuta" <[EMAIL PROTECTED]> writes: > could somebody tell me what's wrong with this timestamp query example? > select timestamp(date '1998-02-24', time '23:07') > PostgreSQL said: ERROR: parser: parse error at or near "date" > example is from PostgreSQL help >From where exactly? I don't

Re: [SQL] query concat

2002-09-20 Thread Stephan Szabo
On Fri, 20 Sep 2002, [iso-8859-1] Ricardo Javier Aranibar León wrote: > Hi List, > First, Thanks for your colaboration Richard Huxton "Do a search on aggregate > functions and "concat" in the mailing list archives, > also see the Postgresql Cookbook on techdocs.postgresql.org, I think there > mig

Re: [SQL] query concat

2002-09-20 Thread Andreas Schmitz
On Friday 20 September 2002 16:46, Ricardo Javier Aranibar León wrote: > Hi List, Hello > > The Table "result"(I like this information) > numtti | numorden | tt | usuario | estado | > --+---++-+-+ > TTI0206| OR

[SQL] query concat

2002-09-20 Thread Ricardo Javier Aranibar León
Hi List, First, Thanks for your colaboration Richard Huxton "Do a search on aggregate functions and "concat" in the mailing list archives, also see the Postgresql Cookbook on techdocs.postgresql.org, I think there might be something there for you." I have been written this mail because I din't

Re: [SQL] [GENERAL] timestamp parse error

2002-09-20 Thread Stephan Szabo
On Fri, 20 Sep 2002, Tomas Lehuta wrote: > Hello! > > i'm using PostgreSQL 7.2.1 and got strange parse errors.. > could somebody tell me what's wrong with this timestamp query example? > > PostgreSQL said: ERROR: parser: parse error at or near "date" > Your query: > > select timestamp(date '1998-

Re: [SQL] Performance w/ multiple WHERE clauses

2002-09-20 Thread Aaron Held
Thanks, Changing '0/19/01' to '0/19/01'::date gave me a subjective 50% speedup. A ran a bunch of queries w/ explain and I noticed that some combinations did not use the indexes and went right to seq scan. All of the where clause args are indexed. # SET enable_seqscan

Re: [SQL] Query Freeze

2002-09-20 Thread alexandre :: aldeia digital
> "alexandre :: aldeia digital" <[EMAIL PROTECTED]> writes: >> I have 3 applications in windows and they >> starts 3 postgres backends. >> The 1st app. call the 2nd and this call the 3rd. >> In the same place of the 3rd backend, the query freeze. >> If I kill the second backend(or app.), the query

[SQL] timestamp parse error

2002-09-20 Thread Tomas Lehuta
Hello! i'm using PostgreSQL 7.2.1 and got strange parse errors.. could somebody tell me what's wrong with this timestamp query example? PostgreSQL said: ERROR: parser: parse error at or near "date" Your query: select timestamp(date '1998-02-24', time '23:07') example is from PostgreSQL help an

Re: [SQL]

2002-09-20 Thread Richard Huxton
On Thursday 19 Sep 2002 9:30 pm, Ricardo Javier Aranibar León wrote: > Hi list, Hi Ricardo > I need your colaboration,I like a table or view with this information > from 2 tables "ticket" and "orden_respuesta". > > numtti | numorden | tt | usuario | estado | > -

Re: [SQL] check source of trigger

2002-09-20 Thread Richard Huxton
On Friday 20 Sep 2002 9:25 am, wit wrote: > I have trigger and procedure on table B to capture any change and insert > into table logB: > create trigger trigger_b before insert or update or delete on B for > each row execute procedure log_change(); > > When I update e_codeA in table A, the co

[SQL] check source of trigger

2002-09-20 Thread wit
Hello, I have a question about trigger. I have tables with the following structure: create table A ( e_codeA char(5) default '' not null, n_codeA varchar(20) default '' not null, constraint A_pkey primary key ( e_codeA ) ); create table B ( e_codeB char(5) default '' not null, e_