Re: [GENERAL] Aggregate in Correlated SubQuery

2006-10-15 Thread Andrew - Supernews
On 2006-10-15, Niederland [EMAIL PROTECTED] wrote: Before postgresql 8.1.5, I could do the following to find the first lead that created a prospect in my application. SELECT Lead.LeadID, Prospect.ProspectID FROM Prospect INNER JOIN Lead USING (ProspectID) WHERE Lead.CreationDate

Re: [GENERAL] BEGIN WORK READ ONLY;

2006-10-15 Thread Peter Eisentraut
David Fetter wrote: It would be handy for things like pgpool and Continuent, which could reliably distinguish up front the difference between a transaction that can write and one that can safely be sliced up and dispatched to read-only databases. Yes, I think that would be the use case. I

[GENERAL] Triggers

2006-10-15 Thread Germán Hüttemann Arza
Hello, I have this doubt since I started using PostgreSQL, a few months ago.Why triggers are defined that way? I mean, in others DBMS you simply write:CREATE TRIGGER trigger_name ... bla bla bla BEGIN END;Why you should write a function first and then the trigger, which must call that

Re: [GENERAL] Triggers

2006-10-15 Thread Chris Mair
Why you should write a function first and then the trigger, which must call that function? What are the advantages/disadvantages of that? Where can I find more information? The PG way seems very natural to me: you can write functions that do something and then have many triggers call that

[GENERAL] How to make a copy of schema

2006-10-15 Thread Andrus
I have a five company Postgres 8.1 database. Each company data is stored in a different schema named Company1, Company2, ..., Company5 There is also public schema which contains common data. Now customer wants to add sixth company to database. In need to add some routine to my application

Re: [GENERAL] more anti-postgresql FUD

2006-10-15 Thread Merlin Moncure
On 10/14/06, Chris Mair [EMAIL PROTECTED] wrote: The interesting part is the graph that shows updates / sec real time vs. running total of updates: http://www.1006.org/misc/20061014_pgupdates_bench/results.png one small thing: the variances inside the trendline are caused by using integer

Re: [GENERAL] How to make a copy of schema

2006-10-15 Thread A. Kretschmer
am Sun, dem 15.10.2006, um 19:10:53 +0300 mailte Andrus folgendes: I have a five company Postgres 8.1 database. Each company data is stored in a different schema named Company1, Company2, ..., Company5 There is also public schema which contains common data. Now customer wants to add

Re: [GENERAL] Triggers

2006-10-15 Thread Tom Lane
Chris Mair [EMAIL PROTECTED] writes: Why you should write a function first and then the trigger, which must call that function? ... there's not just PL/PGSQL: you might want to define a function in C or Perl and then have a trigger call it. Right, that's the real reason: this approach

Re: [GENERAL] more anti-postgresql FUD

2006-10-15 Thread Alvaro Herrera
Merlin Moncure wrote: On 10/14/06, Chris Mair [EMAIL PROTECTED] wrote: The interesting part is the graph that shows updates / sec real time vs. running total of updates: http://www.1006.org/misc/20061014_pgupdates_bench/results.png one small thing: the variances inside the trendline are

Re: [GENERAL] more anti-postgresql FUD

2006-10-15 Thread Tom Lane
Andrew Sullivan [EMAIL PROTECTED] writes: On Fri, Oct 13, 2006 at 01:35:51PM -0400, Tom Lane wrote: looked reasonably robust --- ie, both safe and not full of unsupportable assumptions about knowing exactly where everything actually is on the disk platter. It'd still be interesting if anyone

[GENERAL] Aggregate in Correlated SubQuery

2006-10-15 Thread Niederland
Before postgresql 8.1.5, I could do the following to find the first lead that created a prospect in my application. SELECT Lead.LeadID, Prospect.ProspectID FROM Prospect INNER JOIN Lead USING (ProspectID) WHERE Lead.CreationDate = (SELECT MIN(Lead.CreationDate) FROM Lead AS LL WHERE

[GENERAL] Same-page UPDATEs in bloated tables

2006-10-15 Thread Ian Dowse
Hi, I've been seeing an issue with 8.1.4 that seems to be caused by the way UPDATE operations prefer to place the new row version in the same page as the original row. The issue is specific to UPDATEs; it does not occur when each UPDATE is replaced by a DELETE/INSERT pair. The problem can

Re: [GENERAL] Aggregate in Correlated SubQuery

2006-10-15 Thread Niederland
Sorry working to late at night Query works just a typo the following works. WHERE Lead.CreationDate = (SELECT MIN(LL.CreationDate) FROM Lead AS LL WHERE LL.ProspectID = Lead.ProspectID) sorry for the previous post, Roger Niederland wrote: Before postgresql 8.1.5, I could do the

[GENERAL] Data visibility

2006-10-15 Thread Rafal Pietrak
Hi, I'm trying to write a trigger function, that would update an 'associated' TEBLE on INSERT to master table: CREATE TABLE master (id int not null unique, info text, ); CREATE TABLE aux (master int references master(id), info text, ...); CREATE FUNCTION adjust() RETURNS trigger AS $$ BEGIN

Re: [GENERAL] Data visibility

2006-10-15 Thread Rafal Pietrak
On Sun, 2006-10-15 at 20:01 +0200, Rafal Pietrak wrote: new.id := 1000-old.id; Sory, correction. Of cource, this ID update looks more like the following (OLD.* isn't valid at this point): new.id := 1000 - new.id; -- -R ---(end of

Re: [GENERAL] Same-page UPDATEs in bloated tables

2006-10-15 Thread Alvaro Herrera
Ian Dowse wrote: I've been seeing an issue with 8.1.4 that seems to be caused by the way UPDATE operations prefer to place the new row version in the same page as the original row. The issue is specific to UPDATEs; it does not occur when each UPDATE is replaced by a DELETE/INSERT pair. The

Re: [GENERAL] Data visibility

2006-10-15 Thread Tom Lane
Rafal Pietrak [EMAIL PROTECTED] writes: CREATE TABLE master (id int not null unique, info text, ); CREATE TABLE aux (master int references master(id), info text, ...); CREATE FUNCTION adjust() RETURNS trigger AS $$ BEGIN new.id := 1000-old.id; INSERT INTO aux (master, info)

Re: [GENERAL] Same-page UPDATEs in bloated tables

2006-10-15 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Using the same page for an updated tuple is generally a useful optimization, so I don't think you have much hopes for having it disabled. Especially not since there's no very reasonable way for anything as low-level as heap_update to know that the table

Re: [GENERAL] Data visibility

2006-10-15 Thread Rafal Pietrak
On Sun, 2006-10-15 at 15:15 -0400, Tom Lane wrote: Well, of course not: it's a BEFORE trigger, so the row insertion hasn't actually happened yet. I think you need to split this operation into a BEFORE trigger that changes the ID, and an AFTER trigger that propagates the data into the other

Re: [GENERAL] Data visibility

2006-10-15 Thread Tom Lane
Rafal Pietrak [EMAIL PROTECTED] writes: Hmm. I tried that, But I'm stuck with finding a way to propagate the 'intermediate data' between BEFORE/AFTER triggers, *outside* of a TABLE structure. That data is easily accesable inside the BEFORE TRIGGER as simple variable. Um ... what data do you

Re: [GENERAL] SPAM: Re: [SLE] SPAM: AMD Dual core clock speed

2006-10-15 Thread Susemail
On Sunday 15 October 2006 10:57, Susemail wrote: On Saturday 14 October 2006 07:19, Anders Johansson wrote: On Thu, 2006-10-12 at 18:28 -1000, Susemail wrote: With respect to the AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ are they taking two cpu's (cores) running at 1 Ghz - summing

Re: [GENERAL] Same-page UPDATEs in bloated tables

2006-10-15 Thread Ian Dowse
In message [EMAIL PROTECTED], Tom Lane writes: Alvaro Herrera [EMAIL PROTECTED] writes: Using the same page for an updated tuple is generally a useful optimization, so I don't think you have much hopes for having it disabled. Especially not since there's no very reasonable way for anything as

Re: [GENERAL] Versioning/updating schema

2006-10-15 Thread Jan Cruz
On 10/14/06, Jan Cruz [EMAIL PROTECTED] wrote: Thank you...I supposed I'll try this one if it could suits my needs.It's really hard to maintain views and functions updates.I have downloaded and read the instruction for pgdiff but I am not familiar with aol_server and it's kinda troublesome for a

[GENERAL] postgres' web site malfunctional ?

2006-10-15 Thread Gregory S. Williamson
Then I go to http://www.postgresql.org/ I get a blank page ?!? No bytes ... has lost my marbles, my browser (FireFox 1.5.0.7) lost its electrons, or ?? Thanks, Greg Williamson DBA GlobeXplorer LLC ---(end of broadcast)--- TIP 6: explain analyze

Re: [GENERAL] postgres' web site malfunctional ?

2006-10-15 Thread Chris
Gregory S. Williamson wrote: Then I go to http://www.postgresql.org/ I get a blank page ?!? No bytes ... has lost my marbles, my browser (FireFox 1.5.0.7) lost its electrons, or ?? Thanks, I get stuff now.. maybe you got it in the middle of a reboot or something? -- Postgresql php

Re: [GENERAL] postgres' web site malfunctional ?

2006-10-15 Thread Gregory S. Williamson
Nope, neither Firefox nor IE 6.0 get anything from this site. :-( G -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Sun 10/15/2006 6:53 PM To: Gregory S. Williamson Cc: pgsql-general@postgresql.org Subject:Re: [GENERAL] postgres' web site

Re: [GENERAL] postgres' web site malfunctional ?

2006-10-15 Thread Chris
Gregory S. Williamson wrote: Nope, neither Firefox nor IE 6.0 get anything from this site. Most bizarre.. it's broken for me now. I can ping the server but the webserver seems to be broken (I can telnet to port 80 but can't get a page back). -- Postgresql php tutorials

Re: [GENERAL] postgres' web site malfunctional ?

2006-10-15 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/15/06 21:35, Chris wrote: Gregory S. Williamson wrote: Nope, neither Firefox nor IE 6.0 get anything from this site. Most bizarre.. it's broken for me now. I can ping the server but the webserver seems to be broken (I can telnet to port

Re: [GENERAL] postgres' web site malfunctional ?

2006-10-15 Thread Bill Hawes
Gregory S. Williamson wrote: Then I go to http://www.postgresql.org/ I get a blank page ?!? No bytes ... has lost my marbles, my browser (FireFox 1.5.0.7) lost its electrons, or ?? http://www.postgresql.org/download/ works, as does /support, /developer, etc. but nothing is formatted

Re: [GENERAL] postgres' web site malfunctional ?

2006-10-15 Thread Joshua D. Drake
Bill Hawes wrote: Gregory S. Williamson wrote: Then I go to http://www.postgresql.org/ I get a blank page ?!? No bytes ... has lost my marbles, my browser (FireFox 1.5.0.7) lost its electrons, or ?? http://www.postgresql.org/download/ works, as does /support, /developer, etc. but

Re: [GENERAL] postgres' web site malfunctional ?

2006-10-15 Thread Gregory S. Williamson
Thanks muchly! Content is back now, formatting is whack, but I can use it again. G -Original Message- From: Joshua D. Drake [mailto:[EMAIL PROTECTED] Sent: Sun 10/15/2006 8:27 PM To: Bill Hawes Cc: Gregory S. Williamson; pgsql-general@postgresql.org; PostgreSQL WWW Subject:

[GENERAL] techdocs.2 how long has this be around?

2006-10-15 Thread Richard Broersma Jr
Is this new? Who ever spent the time to do this, thanks for the effort. Having the content organized this way makes it easy to find specific reading material. Regards, Richard Broersma Jr. ---(end of broadcast)--- TIP 1: if posting/reading

Re: [GENERAL] BEGIN WORK READ ONLY;

2006-10-15 Thread David Fetter
On Sun, Oct 15, 2006 at 11:39:20AM +0200, Peter Eisentraut wrote: David Fetter wrote: It would be handy for things like pgpool and Continuent, which could reliably distinguish up front the difference between a transaction that can write and one that can safely be sliced up and dispatched