[SQL] get all online user?

2001-04-05 Thread guard
hi How to get all online user name? thanks ---(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 clea

Re: [SQL] very very slow .....

2001-04-05 Thread J.Fernando Moyano
El Jueves 05 Abril 2001 04:10, escribiste: > > You would probably have better luck if you cast the date restriction > as a range, for example > > where fecha_factura >= '2001-03-01' > and fecha_factura < '2001-04-01' True It runs 10 times faster !!! You are a genius ;-)) Thanks

Re: [SQL] Index on View ?

2001-04-05 Thread Keith Gray
Richard Huxton wrote: > > Indexes on underlying tables should be used though. Difficult to suggest > what indices you might need without knowing the view/tables/queries > involved. As an example I may have an "Invoice" table with several thousand invoices. I could design a query/view "Aged" to g

Re: [SQL] please help

2001-04-05 Thread Peter Eisentraut
Loïc Bourgeois writes: > What is the equivalent of the oracle request: SELECT ... FOR UPDATE > NOWAIT, under PostGreSQL I don't know Oracle, but there doesn't seem to be such a command in PostgreSQL. If the table is already locked, the SELECT FOR UPDATE has to wait. -- Peter Eisentraut [

[SQL] Double-nesting quotes?

2001-04-05 Thread Josh Berkus
Folks, I'm writing some functions that make serious use of the EXECUTE functionality. However, I need to do some string comparisons inside the execute statements ... how do I double-nest the single quote marks? EXAMPLE: where_string := ''WHERE client_name ~* || s_client || ;

[SQL] please help

2001-04-05 Thread Loïc Bourgeois
What is the equivalent of the oracle request: SELECT ... FOR UPDATE NOWAIT, under PostGreSQL Thanks a lot ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

FW: [SQL] RE: serial type; race conditions

2001-04-05 Thread Jeff Eckermann
OK, I'll wake up now. Transaction 2 will actually wait for transaction 1 to complete, before updating "seed". But that drops you on the other horn of the dilemma, i.e. loss of concurrency (partial at least). That may not matter for your application, but for very high traffic, this will become a pr

[SQL] Re: Project Development

2001-04-05 Thread Joel Burton
On Thu, 5 Apr 2001, Kyle wrote: > I've done some work on a solution to allow you to drop and rebuild your > db from scratch relatively painlessly. It enables you to munge portions > of the database, drop columns, undermine RI, clobber views, etc. and > then put the whole thing back together clea

RE: [SQL] RE: serial type; race conditions

2001-04-05 Thread Jeff Eckermann
OK: * Transaction 1 commences, sets seed to seed + 1 * Transaction 2 commences, sets seed to seed + 1 * Transaction 1 inserts into some_table, selects seed (sequence now has a hole) * Transaction 2 inserts into some_table, selects seed (same value as just used by transactio

[SQL] Re: Re: UNION in a VIEW?

2001-04-05 Thread Gordon A. Runkle
In article <[EMAIL PROTECTED]>, "Josh Berkus" <[EMAIL PROTECTED]> wrote: > Tom ... and I realize that we're talking about features for version 7.3 > or later ... a direct way to approach it would be to do a push-down on > simple UNION views, and to do output filtering on UNION views wich > contain

Re: [SQL] Memory and performance

2001-04-05 Thread Tim Perdue
On Thu, Apr 05, 2001 at 10:46:07AM -0400, Tom Lane wrote: > Tim Perdue <[EMAIL PROTECTED]> writes: > > Our database is about 1GB in total size, the machine has 4GB, but the entire > > system is only using 1.2 GB, even during vacuum or a daily, extremely large > > query that requires a lot of grou

Re: [SQL] Memory and performance

2001-04-05 Thread Tom Lane
Tim Perdue <[EMAIL PROTECTED]> writes: > Our database is about 1GB in total size, the machine has 4GB, but the entire > system is only using 1.2 GB, even during vacuum or a daily, extremely large > query that requires a lot of grouping and sorting. What have you got the SortMem parameter (backen

Re: [SQL] Re: UNION in a VIEW?

2001-04-05 Thread Josh Berkus
Gordon, > Like I said, I'm not a backend guru. However, SQL Server and DB2 > both *appear* to be pushing down the WHERE clause. They may not be, > but they both process the query nearly instantaneously on large > tables, which leads me to speculate that they do. PostgreSQL goes > off and munch

[SQL] Project Development

2001-04-05 Thread Kyle
Josh Berkus writes: >That does bring up a related question: when are we gonna get DROP >COLUMN capability? Currently my tables are littered with unused columns >because I can't remove them without blowing my referential integrity and >views to heck. Josh: I've done some work on a solu

[SQL] Re: UNION in a VIEW?

2001-04-05 Thread Gordon A. Runkle
In article <[EMAIL PROTECTED]>, "Josh Berkus" <[EMAIL PROTECTED]> wrote: > Tom, Gordon, > Hmmm ... I'm pretty used an external WHERE clause being applied to the > output of the view, rather than pushed down into the member selects of > the UNION, in the same way as if the UNION query were a subse

Re: [SQL] Memory and performance

2001-04-05 Thread Tim Perdue
I thought this was an interesting thread because we're running into problems with IO under 7.1 during vacuum and a couple of scheduled aggregation jobs. Our database is about 1GB in total size, the machine has 4GB, but the entire system is only using 1.2 GB, even during vacuum or a daily, extreme

[SQL] SELECT ... FOR UPDATE

2001-04-05 Thread Loïc Bourgeois
I have to create a program to use the lastest version of PostgreSQL. Many processes of this program must run in parallele. In a table I have to select some specific row next insert a new row with the same search carateristiques and commit. But between the select and the insert action none other

Re: [SQL] Index on View ?

2001-04-05 Thread Richard Huxton
From: "Keith Gray" <[EMAIL PROTECTED]> > Is it possible (feasible) to create an index on a view. > > We have a large table and a defined sub-set (view) > from this table, would it be possible to keep an index > of the sub-set. I don't think so - the view is basically just a select rule that rewr

Re: [SQL] performance of functions - or rather lack of it

2001-04-05 Thread Peter Galbavy
On Wed, Apr 04, 2001 at 01:01:15PM -0400, Tom Lane wrote: > Without knowing which PG version you're using, what plans you're > getting, or even whether you've VACUUM ANALYZEd lately, it's difficult > to say more than that. I followed that up quickly - server 7.0.2, client 7.1RC1. VACUUMed etc pri