Re: [GENERAL] The rule question before, request official documentation on the problem

2007-04-10 Thread Stuart Cooper
My request at this point is to officially and clearly document this as a substantial limitation of rules. It is not obvious that this is how rules are supposed to behave in this case, and even assuming that the current behavior is desired, it would be nice to let us know this :-) It's documente

[GENERAL] The rule question before, request official documentation on the problem

2007-04-10 Thread Chris Travers
Hi all; Sorry to follow up so soon on my own post. I did find that there was some discussion about this problem back in 2003. However, the big issue is that sequences are wrapped by serial data types and so this is likely to be a common issue (using an insert rule on a serial, causing the s

Re: [GENERAL] Is this a bug? Sequences and rules

2007-04-10 Thread A. Kretschmer
am Tue, dem 10.04.2007, um 22:49:27 -0700 mailte Chris Travers folgendes: > Hi; > > I noticed that rules were not behaving properly. I created a test case, > and it looks like the sequence is getting double-incrimented. Is this > the way this is supposed to work? > > I know triggers would be

Re: [GENERAL] Is this a bug? Sequences and rules

2007-04-10 Thread Tommy Gildseth
Chris Travers wrote: Hi; I noticed that rules were not behaving properly. I created a test case, and it looks like the sequence is getting double-incrimented. Is this the way this is supposed to work? I know triggers would be better for something like this but I find these results... surp

[GENERAL] Is this a bug? Sequences and rules

2007-04-10 Thread Chris Travers
Hi; I noticed that rules were not behaving properly. I created a test case, and it looks like the sequence is getting double-incrimented. Is this the way this is supposed to work? I know triggers would be better for something like this but I find these results... surprising Version i

Re: [GENERAL] plperl "set-valued function" problem

2007-04-10 Thread Tom Lane
"sami jan" <[EMAIL PROTECTED]> writes: > I checked out the files from: pgsql/src/pl/plperl/sql/ and > pgsql/src/pl/plperl/expected and compared the results > I still found a difference in 2 functions : > ERROR: error from Perl function: type "integer" does not exist at line 2. Apparently you're

Re: [GENERAL] Versioning

2007-04-10 Thread Jonathan Vanasco
On Apr 10, 2007, at 3:18 PM, Sean Davis wrote: 4) Maintain a shadow table with only diffs from the original and metadata on when the changes took place Thats what I do. Table artist id serial primary key version_id serial version_date name unique key artist

Re: [GENERAL] Do I need serializable for this query?

2007-04-10 Thread Peter Eisentraut
William Garrison wrote: > I have a table that keeps running totals. It is possible that this > would get called twice simultaneously for the same UserID. Do I need > to put this in a serializable transaction? Transaction isolation is only a question of interest if you have more than one stateme

Re: [GENERAL] Do I need serializable for this query?

2007-04-10 Thread Jeff Davis
On Tue, 2007-04-10 at 14:45 -0400, William Garrison wrote: > I have a table that keeps running totals. It is possible that this > would get called twice simultaneously for the same UserID. Do I need to > put this in a serializable transaction? Since this gets called often, > could it be a per

Re: [GENERAL] Do I need serializable for this query?

2007-04-10 Thread Florian G. Pflug
William Garrison wrote: I have a table that keeps running totals. It is possible that this would get called twice simultaneously for the same UserID. Do I need to put this in a serializable transaction? Since this gets called often, could it be a performance problem if I make it serializable

Re: [GENERAL] passing arrays to shared object functions

2007-04-10 Thread Florian G. Pflug
Jason Nerothin wrote: I've been attempting for a while to figure out how to pass arrays of integers back and forth from a custom c-library that I'd like to plug into my server instance. Although I'm able to usefully pass single integers to a functions I've written, the best I've been able to acco

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-10 Thread John D. Burger
SELECT min(x) FROM ( SELECT min(datecol1) AS x FROM table1 UNION ALL SELECT min(datecol2) AS x FROM table2 UNION ALL SELECT min(datecol3) AS x FROM table3 ) ss; Exercise for newbie: which of the AS clauses are redundant? Um, all of them? Yah, but only if you do this: SELECT min(*) FROM (

Re: [GENERAL] plperl "set-valued function" problem

2007-04-10 Thread sami jan
Thanks Alvaro I checked out the files from: pgsql/src/pl/plperl/sql/ and pgsql/src/pl/plperl/expected and compared the results I still found a difference in 2 functions : Function 1 - Expected: CREATE OR REPLACE FUNCTION perl_spi_prepared(INTEGER) RETURN

[GENERAL] storing checksums in a database

2007-04-10 Thread Reece Hart
I'd like to store several kinds of checksums in a database and would appreciate some advice about the best way to do this. I will use these checksums for uniqueness constraints and for searching. I currently store md5s as text and I could store other checksums as text also, but it occurs to me tha

Re: [GENERAL] Postgres Crash Running PLPGSQL Function on 8.2.3

2007-04-10 Thread Gary Winslow
I need to extract the necessary database components to repro the problem and find out how much data it will require. I will need some time to prepare that for sending. I should be able to prepare something today, or tomorrow. My Thanks for giving this problem attention. Until this is fixed, I

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Listmail
I love Open Source XD http://ethan.tira-thompson.com/cvslog2web/ Note that this is overkill (but it would look SEXY on the site). However, the original poster probably wants to know when to update his servers, so he won't care about CVS commits... If there was a RSS

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-10 Thread Lorenzo Thurman
Tom Lane wrote: "Dann Corbit" <[EMAIL PROTECTED]> writes: [EMAIL PROTECTED] On Behalf Of Lorenzo Thurman I have three tables using date fields. I want to retrieve the oldest date contained in the tables. Can someone show me an example of a query that would do that? Just do a union and return

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-10 Thread Lorenzo Thurman
Lorenzo Thurman wrote: I have three tables using date fields. I want to retrieve the oldest date contained in the tables. Can someone show me an example of a query that would do that? TIA I think I have it, but if anyone has any comments, I'd appreciate it: select min(old) as oldest from (se

[GENERAL] Do I need serializable for this query?

2007-04-10 Thread William Garrison
I have a table that keeps running totals. It is possible that this would get called twice simultaneously for the same UserID. Do I need to put this in a serializable transaction? Since this gets called often, could it be a performance problem if I make it serializable? CREATE FUNCTION Updat

[GENERAL] Tomcat question/problem

2007-04-10 Thread Marc
Hi there. I've written an applet that connects to a PostgreSQL database which works fine in development. I'm now trying to deploy it and having some trouble. I'm running on a windows XP Pro box with an Apache Tomcat/5.5.23 web server and am using PostgreSQL 8.2.

Re: [GENERAL] NEWBIE: How do I get the oldest date contained in 3 tables

2007-04-10 Thread Lorenzo Thurman
Brent Wood wrote: Lorenzo Thurman wrote: I have three tables using date fields. I want to retrieve the oldest date contained in the tables. Can someone show me an example of a query that would do that? You could write a custom function doing the same sort of thing, or (perhaps more portable) u

[GENERAL] passing arrays to shared object functions

2007-04-10 Thread Jason Nerothin
I've been attempting for a while to figure out how to pass arrays of integers back and forth from a custom c-library that I'd like to plug into my server instance. Although I'm able to usefully pass single integers to a functions I've written, the best I've been able to accomplish passing in point

[GENERAL] Versioning

2007-04-10 Thread Sean Davis
I can think of several ways of "versioning" objects (modeled as rows of a table). 1) parent-child based model, where each edit of a row results in a child row 2) date-based model, where each row is stored with a date and no updates are performed, only inserts 3) Maintain a shadow table with

[GENERAL] Do I need serializable for this query?

2007-04-10 Thread William Garrison
I have a table that keeps running totals. It is possible that this would get called twice simultaneously for the same UserID. Do I need to put this in a serializable transaction? Since this gets called often, could it be a performance problem if I make it serializable? CREATE FUNCTION Updat

[GENERAL] Re: programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Peter Wilson
Jorge Godoy wrote: > Listmail <[EMAIL PROTECTED]> writes: > Yeah yeah, but terminology aside, having 2 or three digits in each attribute is just wrong! >>> Terminology aside, why? The unit is "8.1" not "8" and "1". It makes no >>> sense to say you're on version 8, in the given context, s

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Jorge Godoy
Listmail <[EMAIL PROTECTED]> writes: >>> Yeah yeah, but terminology aside, having 2 or three digits in each >>> attribute is just wrong! >> >> Terminology aside, why? The unit is "8.1" not "8" and "1". It makes no >> sense to say you're on version 8, in the given context, so why should the >> XML

Re: [GENERAL] Errors during recovery of a postgres. Need some help understanding them...

2007-04-10 Thread Dhaval Shah
I am still learning the ropes, I guess. I am not able to understand the following: The attempt to back up to the last checkpoint isn't going to happen if you keep it from crashing at the REDO DONE point. Does the above statement mean that I am crashing my primary server at the REDO DONE point

Re: [GENERAL] Debian upgrade and PGSQL pid file

2007-04-10 Thread tom
OK, I can do some reading and such. But first I will run pg_dump just in case... On 4/10/2007, "Martijn van Oosterhout" wrote: >On Tue, Apr 10, 2007 at 06:01:34AM -0400, Tom Allison wrote: >> A while back I threw together a postgresql installation on a computer with >> a RAID disk for perform

Re: [pgsql-www] Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Dave Page
Alvaro Herrera wrote: > It makes sense to store things separately when they have a semantic > difference. What we call "major" is the first two digits and dot. We > call "minor" to the third digit, and that's all. We don't have > "revisions". This is how it has ever been and we even document it

Re: [pgsql-www] Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > It makes sense to store things separately when they have a semantic > difference. What we call "major" is the first two digits and dot. We > call "minor" to the third digit, and that's all. We don't have > "revisions". This is how it has ever been an

[GENERAL] EXECUTE in a funtion to return a VIEW object ID

2007-04-10 Thread Wilkinson, Jim
Hi there, I have tried many ideas to get this working but no luck. Can some show me or explain what is happening EXAMPLE == I am trying to read to 2 text fields to combine them togther to form the name of a VIEW. example SELECT * FROM ( 'april'||'may') ; I have tried the EXECUTE i

Re: [pgsql-www] Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Alvaro Herrera
Dave Page escribió: > Alvaro Herrera wrote: > > Dave Page escribió: > >> Magnus Hagander wrote: > >>> That is actually precisely my point. It makes *no sense* to filter based > >>> on > >>> 8.x. 8.0 is no more a major release than 7.4. > >> Yes it is - that's precisely why it was 8.0 and not 7.5.

Re: [pgsql-www] Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Dave Page
Alvaro Herrera wrote: > Dave Page escribió: >> Magnus Hagander wrote: >>> That is actually precisely my point. It makes *no sense* to filter based on >>> 8.x. 8.0 is no more a major release than 7.4. >> Yes it is - that's precisely why it was 8.0 and not 7.5. > > That was merely a marketing artif

Re: [pgsql-www] Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Alvaro Herrera
Dave Page escribió: > Magnus Hagander wrote: > > That is actually precisely my point. It makes *no sense* to filter based on > > 8.x. 8.0 is no more a major release than 7.4. > > Yes it is - that's precisely why it was 8.0 and not 7.5. That was merely a marketing artifact; it was called 7.5 unti

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Dave Page
Magnus Hagander wrote: > That is actually precisely my point. It makes *no sense* to filter based on > 8.x. 8.0 is no more a major release than 7.4. Yes it is - that's precisely why it was 8.0 and not 7.5. /D ---(end of broadcast)--- TIP 1: if pos

Re: [GENERAL] Pg schema diff tools Was: [ANNOUNCE] == PostgreSQL Weekly News - April 08 2007 ==

2007-04-10 Thread Merlin Moncure
On 4/10/07, Markus Schiltknecht <[EMAIL PROTECTED]> wrote: Robert Treat wrote: > Theres this one which uses tcl: > https://sourceforge.net/projects/pgdiff Seems outdated: 2002, PostgreSQL 7.2, ~1500 lines of code. (which I don't really understand, I simply don't know TCL, sorry.) > And this one

Re: [pgsql-www] Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Peter Eisentraut
Am Dienstag, 10. April 2007 13:35 schrieb Dave Page: > Imagine wanting to display only the details of the 8.x releases on a > site for example. In your schema, you'd have to use a substring match on > an attribute value to filter out 6.x and 7.x. That use case is just as valid as wanting to show o

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Magnus Hagander
On Tue, Apr 10, 2007 at 02:44:42PM +0200, Martijn van Oosterhout wrote: > On Tue, Apr 10, 2007 at 12:18:52PM +0200, Magnus Hagander wrote: > > But given that we might want to add things like this, having our own custom > > XML format certainly makes a bit more sense, it might be harder to try to >

Re: [GENERAL] Kill session in PostgreSQL

2007-04-10 Thread Martijn van Oosterhout
On Tue, Apr 10, 2007 at 01:01:30PM +0100, Ashish Karalkar wrote: > Hello all, > is there any command just like ORACLE Uses kill session to kill a > particular session . > tried withh linux kill -9 PID but it also kills all other sessions or am I > just giving wrong signal to command kill? U

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Martijn van Oosterhout
On Tue, Apr 10, 2007 at 12:18:52PM +0200, Magnus Hagander wrote: > But given that we might want to add things like this, having our own custom > XML format certainly makes a bit more sense, it might be harder to try to > trick it into RSS. I'd say do it in the format you're most comfortable with.

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Magnus Hagander
On Tue, Apr 10, 2007 at 12:35:38PM +0100, Dave Page wrote: > Magnus Hagander wrote: > > Terminology aside, why? The unit is "8.1" not "8" and "1". It makes no > > sense to say you're on version 8, in the given context, so why should the > > XML data pretend there is? > > Because serving the data i

[GENERAL] Kill session in PostgreSQL

2007-04-10 Thread Ashish Karalkar
Hello all, is there any command just like ORACLE Uses kill session to kill a particular session . tried withh linux kill -9 PID but it also kills all other sessions or am I just giving wrong signal to command kill? Thanks in advance With Regards ashish

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Listmail
Yeah yeah, but terminology aside, having 2 or three digits in each attribute is just wrong! Terminology aside, why? The unit is "8.1" not "8" and "1". It makes no sense to say you're on version 8, in the given context, so why should the XML data pretend there is? //Magnus Just prete

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Dave Page
Magnus Hagander wrote: > Terminology aside, why? The unit is "8.1" not "8" and "1". It makes no > sense to say you're on version 8, in the given context, so why should the > XML data pretend there is? Because serving the data in the decomposed format gives the consumer the maximum flexibility to d

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Magnus Hagander
On Tue, Apr 10, 2007 at 12:03:44PM +0100, Dave Page wrote: > Magnus Hagander wrote: > > On Tue, Apr 10, 2007 at 09:52:52AM +0100, Dave Page wrote: > >> Magnus Hagander wrote: > >>> 2) Create a new file with a specific schema. Something like: > >>> > >>> > >>> > >>> > >>> This is the most ligh

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Dave Page
Magnus Hagander wrote: > On Tue, Apr 10, 2007 at 09:52:52AM +0100, Dave Page wrote: >> Magnus Hagander wrote: >>> 2) Create a new file with a specific schema. Something like: >>> >>> >>> >>> >>> This is the most lightweight solution. >> More like: >> >> >> >> >> > > But that doesn't

Re: [GENERAL] Bad plan using join on VALUES (and now on temp table too)

2007-04-10 Thread Listmail
Well, the planner probably guessed that in your case it's faster to scan the table than to use the index (indexes are not free). Did it choose wrong? Yes, see the other query in my post... id IN ( 60 values ) => 0.582 ms (bitmap scan on the index : perfect) join with V

Re: [GENERAL] Debian upgrade and PGSQL pid file

2007-04-10 Thread Martijn van Oosterhout
On Tue, Apr 10, 2007 at 06:01:34AM -0400, Tom Allison wrote: > A while back I threw together a postgresql installation on a computer with > a RAID disk for performance reasons. I never got it working 100% since it > was just a quick weekend adventure and I never expected much to come of it. Fir

Re: [GENERAL] Bad plan using join on VALUES

2007-04-10 Thread Martijn van Oosterhout
On Tue, Apr 10, 2007 at 10:57:43AM +0200, Listmail wrote: > > Table definition and problem query is below. I'm surprised... Well, the planner probably guessed that in your case it's faster to scan the table than to use the index (indexes are not free). Did it choose wrong? If you disable th

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Magnus Hagander
On Tue, Apr 10, 2007 at 11:09:50AM +0200, Listmail wrote: > > I love Open Source XD > > http://ethan.tira-thompson.com/cvslog2web/ Hmm. Don't tell people about my secret plans :) (Though I hadn't looked at that piece of software in particylar) > Note that this is overkill (bu

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Magnus Hagander
On Tue, Apr 10, 2007 at 09:52:52AM +0100, Dave Page wrote: > Magnus Hagander wrote: > > 2) Create a new file with a specific schema. Something like: > > > > > > > > > > This is the most lightweight solution. > > More like: > > > > > But that doesn't reflect our terminology. Per our

[GENERAL] Debian upgrade and PGSQL pid file

2007-04-10 Thread Tom Allison
A while back I threw together a postgresql installation on a computer with a RAID disk for performance reasons. I never got it working 100% since it was just a quick weekend adventure and I never expected much to come of it. Famous last words... I'm not trying to upgrade the database via deb

Re: [GENERAL] Pg schema diff tools Was: [ANNOUNCE] == PostgreSQL Weekly News - April 08 2007 ==

2007-04-10 Thread Markus Schiltknecht
Hi, thanks for the links. I've had a quick look at the first two and comment my findings: Robert Treat wrote: Theres this one which uses tcl: https://sourceforge.net/projects/pgdiff Seems outdated: 2002, PostgreSQL 7.2, ~1500 lines of code. (which I don't really understand, I simply don't

[GENERAL] Bad plan using join on VALUES

2007-04-10 Thread Listmail
Table definition and problem query is below. I'm surprised... caillaudangers=> \d relations Table « public.relations » Colonne | Type | Modificateurs +-+ pare

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Dave Page
Magnus Hagander wrote: > 2) Create a new file with a specific schema. Something like: > > > > > This is the most lightweight solution. More like: But I can't help thinking that we should have some additional values for release notes, download sub-URLs (to be appended to the mirror

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Magnus Hagander
On Tue, Apr 10, 2007 at 08:36:10AM +0100, Dave Page wrote: > Andrew Hammond wrote: > > On 4/9/07, CAJ CAJ <[EMAIL PROTECTED]> wrote: > >> On 9 Apr 2007 14:47:20 -0700, Andrew Hammond > >> <[EMAIL PROTECTED]> wrote: > >> > I'm writing a script that wants to know the latest release for a given > >> >

Re: [GENERAL] No of triggers of one single table

2007-04-10 Thread Alban Hertroys
Harpreet Dhaliwal wrote: > Hi, > Can i have more than one trigger on one single table. Actually I want 2 > different events to take place simultaneously and independently after > insert. You can, but they won't run simultaneously. They'll run in alphabetical order. -- Alban Hertroys [EMAIL PROTE

Re: [GENERAL] PlPg/SQL mulit-array as a parameter?

2007-04-10 Thread A. Kretschmer
am Sat, dem 07.04.2007, um 6:27:27 -0700 mailte Simon István folgendes: > How can i use multi-array parameter in PlPg/SQL? > > This array want to put in parameter. > [[0, 1, 3, 0, 3, 4], [7, 12, 1, 9, 1, 2], [12, 24, 20, 42, 43, 44], > [24, 103, 65, 113, 72, 25], [179, 357, 335, 348, 309, 138],

Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

2007-04-10 Thread Dave Page
Andrew Hammond wrote: > On 4/9/07, CAJ CAJ <[EMAIL PROTECTED]> wrote: >> On 9 Apr 2007 14:47:20 -0700, Andrew Hammond >> <[EMAIL PROTECTED]> wrote: >> > I'm writing a script that wants to know the latest release for a given >> > major.minor version. Is there some better way than parsing >> > http:/

Re: [GENERAL] Problem with copying data

2007-04-10 Thread Klaas Dellschaft
Are there indexes or foreign keys in the tables? Check constraints? Other things we should know about? I think I found the problem. There were indexes on the tables which I wanted to copy. I remembered the performance tip to add indexes after copying the data when I saw the activity of my har