Re: [GENERAL] Favorite Tom Lane quotes
Robert Treat wrote: http://archives.postgresql.org/pgsql-hackers/2006-04/msg00288.php I remember after reading this post wondering whether Tom uses caffeinated soap... Reading that link, I'm reminded of the tertiary storage code that somebody (at UCB?) grafted onto the PostgreSQL server. IIRC There were still hooks for it in v6 although they've since been removed. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
On Thu, 2008-12-04 at 10:47 -0500, Robert Treat wrote: http://archives.postgresql.org/pgsql-hackers/2006-04/msg00288.php I remember after reading this post wondering whether Tom uses caffeinated soap My RHCE course book is still at WC -- I read it on some days ;) -- Devrim GÜNDÜZ, RHCE devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org signature.asc Description: This is a digitally signed message part
Re: [GENERAL] Favorite Tom Lane quotes
On Monday 01 December 2008 22:09:08 Scott Marlowe wrote: On Mon, Dec 1, 2008 at 7:49 PM, Grzegorz Jaśkiewicz [EMAIL PROTECTED] wrote: which reminds me, of my favourite recent quote: Think I'll go fix this while I'm watching the football game ... We really need a favorite Tom Lane quotes thread. Mine is (roughly): http://archives.postgresql.org/pgsql-hackers/2006-04/msg00288.php I remember after reading this post wondering whether Tom uses caffeinated soap... -- Robert Treat Conjecture: http://www.xzilla.net Consulting: http://www.omniti.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
2008/12/4 Robert Treat [EMAIL PROTECTED]: http://archives.postgresql.org/pgsql-hackers/2006-04/msg00288.php I remember after reading this post wondering whether Tom uses caffeinated soap... well, some ppl come up with ideas on wc-thone ;) What do you suggest they do there ... ; -- GJ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
On Thu, Dec 4, 2008 at 8:49 AM, Grzegorz Jaśkiewicz [EMAIL PROTECTED] wrote: 2008/12/4 Robert Treat [EMAIL PROTECTED]: http://archives.postgresql.org/pgsql-hackers/2006-04/msg00288.php I remember after reading this post wondering whether Tom uses caffeinated soap... well, some ppl come up with ideas on wc-thone ;) What do you suggest they do there ... ; One of my favorite tinwhistle tunes is named Dusty Windowsill. It's so named because Johnny Harling (sp?) was sitting on the toilet when the tune came to him, and having nothing else to write on, he wrote it out on a dusty windowsill. Genius strikes when it strikes. I've woken up at two in the morning with the answer to a complex programming problem at work, grabbed my laptop, pounded out a hundred or so lines, then spent the next two days trying to figure out how it worked. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
On Mon, 2008-12-01 at 22:51 -0500, justin wrote: On idiotic benchmark comparisons Try to carry 500 people from Los Angeles to Tokyo in an F-15. No? Try to win a dogfight in a 747. No? But they both fly, so it must be useful to compare them... especially on the basis of the most simplistic test case you can think of. For extra points, use *only one* test case. Perhaps this paper can be described as comparing an F-15 to a 747 on the basis of required runway length We used that analogy for comparing database benchmarks as far back as 1989-90 at Teradata. My memory is it was invented to counter claims that DB2 was faster after some disastrous initial benchmark results while attempting a straight database migration. The contrast was that the client/server overhead of each request *was* higher, though the parallel database could perform actions much faster when it eventually got started. The original analogy was a comparison of the passenger carrying capacity, since a jet fighter could only carry ~1 person while the airliner could carry 100s, yet the jet fighter could obviously deliver 1 person much faster to a destination. (At the time, the concept of client/server was widely laughed at). Joke - Threat - Obvious. That thought led to the development at BA of a system specifically designed to offload large SQL queries from the mainframe DB2 system. BA knew how to judge database systems and use them for what they were good at. (They continued to use TPF also, because of its speed of hash index implementation, amongst other optimisations). -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
On Tue, Dec 2, 2008 at 9:51 AM, Picavet Vincent [EMAIL PROTECTED] wrote: That seems to be kind of a joke, but I heard that the french CNES (spatial agency) is doing some huge database replication between two sites thanks to big trucks carrying the data once a month, because current network devices transfer rates do not allow them to do remote replication through the network. Or maybe the reasons to this method are not only technical but economical. I have no detailed information on this, and it's more a rumour than a verified information, but should somebody know more on the subject, i'd be interested in hearing it. but than you have to add cost of backing up and restoring labour time, and that's going to be a massive latency - if you ask me. -- GJ
Re: [GENERAL] Favorite Tom Lane quotes
Klint Gore írta: Scott Marlowe wrote: On Mon, Dec 1, 2008 at 10:42 PM, Joshua D. Drake [EMAIL PROTECTED] wrote: On Tue, 2008-12-02 at 00:37 -0500, Greg Smith wrote: Tom on things that might ruin his tape backups: Then of course there are the *other* risks, such as the place burning to the ground, or getting drowned by a break in the city reservoir that's a couple hundred yards up the hill...Or maybe being burgled by Oracle employees who are specifically after my backup tapes. What is a tape? Apparently something to do with backups. But I don't know what those are either... :-P Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. —Tanenbaum, Andrew S. (1996). Computer Networks. New Jersey: Prentice-Hall, 83. ISBN 0-13-349945-6. But the latency of a truck is awful :-) A modern chrysler town and country(1) has a cargo capacity of 140.1 cubic feet(2) letting it carry 17163 LTO4 (3) tapes at 800GB each. Thats 13730TB. Say it has to get from San Francisco to LA (about 6 hrs according to google maps directions(4)), that gives 2288TB/hour, or 5.1 terabit/second. klint. 1. its more of a minivan than a station wagon these days but close enough. halve the number of tapes if you're thinking of the classic woodie http://www.allpar.com/old/townandcountry.html 2. http://www.chrysler.com/hostc/vsmc/vehicleSpecModels.do?modelYearCode=CUC200908 3. dimensions from http://en.wikipedia.org/wiki/Linear_Tape-Open 4. http://maps.google.com/maps?f=dsaddr=san+franciscodaddr=los+angeleshl=engeocode=mra=lssll=37.0625,-95.677068sspn=58.598104,116.542969ie=UTF8ll=35.939855,-120.330885spn=7.601811,14.567871z=7 -- -- Zoltán Böszörményi Cybertec Schönig Schönig GmbH http://www.postgresql.at/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
Hi, Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. -Tanenbaum, Andrew S. (1996). Computer Networks. New Jersey: Prentice-Hall, 83. ISBN 0-13-349945-6. A modern chrysler town and country(1) has a cargo capacity of 140.1 cubic feet(2) letting it carry 17163 LTO4 (3) tapes at 800GB each. Thats 13730TB. Say it has to get from San Francisco to LA (about 6 hrs according to google maps directions(4)), that gives 2288TB/hour, or 5.1 terabit/second. That seems to be kind of a joke, but I heard that the french CNES (spatial agency) is doing some huge database replication between two sites thanks to big trucks carrying the data once a month, because current network devices transfer rates do not allow them to do remote replication through the network. Or maybe the reasons to this method are not only technical but economical. I have no detailed information on this, and it's more a rumour than a verified information, but should somebody know more on the subject, i'd be interested in hearing it. Vincent -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
Scott Marlowe wrote: What is a tape? Apparently something to do with backups. But I don't know what those are either... :-P From The Top Of My Head Dictionary - Backup Tapes noun Thin flimsy strip of plastic with a fine coating of iron oxide or similar compound which is then wound up around a small plastic wheel, stretched over a little head and onto another small plastic wheel. Normally used as a means of translating digital computer talk into an ear piercing noise that humans can then listen to to ensure that the computers aren't plotting to overthrow the earth. Legend has it that computers can use these tapes to reconstruct some piece of information as it was at some historic moment. While it has often been attempted to prove that this process is possible, the mixed reports about it's success leave most in doubt as to whether it can really be done and believing it is all just mythology. Of course the true believers will argue endlessly about the wonders of what can be done and how important it is, but they tend to have a low conversion rate among the listeners. ;-) -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
[EMAIL PROTECTED] (Tom Lane) writes: Scott Marlowe [EMAIL PROTECTED] writes: We really need a favorite Tom Lane quotes thread. Mine is (roughly): We don't support that, but you're free to try it, you just get to keep both pieces if it breaks. Hate to disillusion you, but that's a standard comment around Red Hat. I have no idea who said it first, but twasn't me. There's a license that has that as its main clause. See the end of the document.. http://man.he.net/man8/chat An authoritative source for the original seems to have evaporated, but here's a direct inheritor implemented in Expect: http://expect.nist.gov/scripts/chat A quick web search indicates that ucLinux seems to include old style chat as also does DragonflyBSD... -- select 'cbbrowne' || '@' || 'linuxdatabases.info'; http://linuxfinances.info/info/linux.html The chat program is in public domain. This is not the GNU public license. If it breaks then you get to keep both pieces. (Copyright notice for the chat program) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
On Tue, 2008-12-02 at 10:40 +, Grzegorz Jaśkiewicz wrote: but than you have to add cost of backing up and restoring labour time, and that's going to be a massive latency - if you ask me. Of course it is, but really latency probably isn't the key issue - more that the data itself isn't lost. -Mark -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
2008/12/1 Scott Marlowe [EMAIL PROTECTED]: On Mon, Dec 1, 2008 at 7:49 PM, Grzegorz Jaśkiewicz [EMAIL PROTECTED] wrote: which reminds me, of my favourite recent quote: Think I'll go fix this while I'm watching the football game ... We really need a favorite Tom Lane quotes thread. Mine is (roughly): We have a little joke here in the office. Really, really bad code is 'horrid'. :-) merlin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
[GENERAL] Favorite Tom Lane quotes
On Mon, Dec 1, 2008 at 7:49 PM, Grzegorz Jaśkiewicz [EMAIL PROTECTED] wrote: which reminds me, of my favourite recent quote: Think I'll go fix this while I'm watching the football game ... We really need a favorite Tom Lane quotes thread. Mine is (roughly): We don't support that, but you're free to try it, you just get to keep both pieces if it breaks. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
Scott Marlowe [EMAIL PROTECTED] writes: We really need a favorite Tom Lane quotes thread. Mine is (roughly): We don't support that, but you're free to try it, you just get to keep both pieces if it breaks. Hate to disillusion you, but that's a standard comment around Red Hat. I have no idea who said it first, but twasn't me. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
Tom Lane wrote: Scott Marlowe [EMAIL PROTECTED] writes: We really need a favorite Tom Lane quotes thread. Mine is (roughly): We don't support that, but you're free to try it, you just get to keep both pieces if it breaks. Hate to disillusion you, but that's a standard comment around Red Hat. I have no idea who said it first, but twasn't me. i took this off Wikipedia http://en.wikipedia.org/wiki/Tom_Lane_(Open_Source_Software_Developer) On idiotic benchmark comparisons Try to carry 500 people from Los Angeles to Tokyo in an F-15. No? Try to win a dogfight in a 747. No? But they both fly, so it must be useful to compare them... especially on the basis of the most simplistic test case you can think of. For extra points, use *only one* test case. Perhaps this paper can be described as comparing an F-15 to a 747 on the basis of required runway length
Re: [GENERAL] Favorite Tom Lane quotes
Tom on things that might ruin his tape backups: Then of course there are the *other* risks, such as the place burning to the ground, or getting drowned by a break in the city reservoir that's a couple hundred yards up the hill...Or maybe being burgled by Oracle employees who are specifically after my backup tapes. -- * Greg Smith [EMAIL PROTECTED] http://www.gregsmith.com Baltimore, MD -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
On Tue, 2008-12-02 at 00:37 -0500, Greg Smith wrote: Tom on things that might ruin his tape backups: Then of course there are the *other* risks, such as the place burning to the ground, or getting drowned by a break in the city reservoir that's a couple hundred yards up the hill...Or maybe being burgled by Oracle employees who are specifically after my backup tapes. What is a tape? -- * Greg Smith [EMAIL PROTECTED] http://www.gregsmith.com Baltimore, MD -- PostgreSQL Consulting, Development, Support, Training 503-667-4564 - http://www.commandprompt.com/ The PostgreSQL Company, serving since 1997 -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
On Mon, Dec 1, 2008 at 10:42 PM, Joshua D. Drake [EMAIL PROTECTED] wrote: On Tue, 2008-12-02 at 00:37 -0500, Greg Smith wrote: Tom on things that might ruin his tape backups: Then of course there are the *other* risks, such as the place burning to the ground, or getting drowned by a break in the city reservoir that's a couple hundred yards up the hill...Or maybe being burgled by Oracle employees who are specifically after my backup tapes. What is a tape? Apparently something to do with backups. But I don't know what those are either... :-P -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Favorite Tom Lane quotes
On Tue, Dec 2, 2008 at 5:44 AM, Scott Marlowe [EMAIL PROTECTED]wrote: Apparently something to do with backups. But I don't know what those are either... :-P well, we're all waiting for built in replication ;) About the tapes, I love that Oracle emps bit :D Sure, they write too much java code, this is equivalent of getting high on h, if you ask me. -- GJ
Re: [GENERAL] Favorite Tom Lane quotes
Scott Marlowe wrote: On Mon, Dec 1, 2008 at 10:42 PM, Joshua D. Drake [EMAIL PROTECTED] wrote: On Tue, 2008-12-02 at 00:37 -0500, Greg Smith wrote: Tom on things that might ruin his tape backups: Then of course there are the *other* risks, such as the place burning to the ground, or getting drowned by a break in the city reservoir that's a couple hundred yards up the hill...Or maybe being burgled by Oracle employees who are specifically after my backup tapes. What is a tape? Apparently something to do with backups. But I don't know what those are either... :-P Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. —Tanenbaum, Andrew S. (1996). Computer Networks. New Jersey: Prentice-Hall, 83. ISBN 0-13-349945-6. A modern chrysler town and country(1) has a cargo capacity of 140.1 cubic feet(2) letting it carry 17163 LTO4 (3) tapes at 800GB each. Thats 13730TB. Say it has to get from San Francisco to LA (about 6 hrs according to google maps directions(4)), that gives 2288TB/hour, or 5.1 terabit/second. klint. 1. its more of a minivan than a station wagon these days but close enough. halve the number of tapes if you're thinking of the classic woodie http://www.allpar.com/old/townandcountry.html 2. http://www.chrysler.com/hostc/vsmc/vehicleSpecModels.do?modelYearCode=CUC200908 3. dimensions from http://en.wikipedia.org/wiki/Linear_Tape-Open 4. http://maps.google.com/maps?f=dsaddr=san+franciscodaddr=los+angeleshl=engeocode=mra=lssll=37.0625,-95.677068sspn=58.598104,116.542969ie=UTF8ll=35.939855,-120.330885spn=7.601811,14.567871z=7 -- Klint Gore Database Manager Sheep CRC A.G.B.U. University of New England Armidale NSW 2350 Ph: 02 6773 3789 Fax: 02 6773 3266 EMail: [EMAIL PROTECTED] -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
MD5 computation (was: RE: [GENERAL] For Tom Lane)
Hi, What is the best way to calculate an MD5 Sum for a set of rows in a table, on a Postgresql server? -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Scott Marlowe Envoyé : mardi, 31. mai 2005 18:37 À : [EMAIL PROTECTED] Cc : pgsql-general Objet : Re: [GENERAL] For Tom Lane On Fri, 2005-05-27 at 09:57, [EMAIL PROTECTED] wrote: Thanks for answer Tom Consider what happens when the user leaves for lunch Well, I've already thought about it.But I'm working with VS2003 and disconnected dataset.. so when user edit data he's modifying an old disconnected row, while real updated row is in the database.. So my strategy would be (as I already written): 1. refresh data recalling current row from database to the form's fields 2. lock the row 3. update modified data in the database through stored procedure (function) 4. commit and unlock the row Have you another idea that could work better with disconnected objects ? While this ensures that the update is atomic, it doesn't ensure that no one else is trying to edit it at the same time. What you might want to do is either optimistically lock it, or use application level locking. To use optimistic locking, you'll need to do something like make an md5 of all the fields being edited, then, right before you write back the data, check to see if the md5 you created at the beginning still matches by re-reading the data and md5ing it again. If it doesn't match, then you can throw a mid air collision error, so to speak, and tell them that the record changed underneath them, or do some kind of merging / or whatnot. If you want to do application level locking, then create a field and use that for locks. Just make it a timestamp field and put in the current time value when the lock is taken. When the predetermined timeout occurs, the user lock is removed by the next person to access it, or offer them chance to, or email the original locker, etc... Handle it the way you want or need to. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster ---(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: MD5 computation (was: RE: [GENERAL] For Tom Lane)
On Wed, 2005-06-01 at 08:22 +0200, Philippe Lang wrote: What is the best way to calculate an MD5 Sum for a set of rows in a table, on a Postgresql server? The md5() builtin function. contrib/pgcrypto is available if you need more sophisticated hashing / encryption. -Neil ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [GENERAL] For Tom Lane
Scott Marlowe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 2005-05-27 at 09:57, [EMAIL PROTECTED] wrote: Thanks for answer Tom Consider what happens when the user leaves for lunch Well, I've already thought about it.But I'm working with VS2003 and disconnected dataset.. so when user edit data he's modifying an old disconnected row, while real updated row is in the database.. So my strategy would be (as I already written): 1. refresh data recalling current row from database to the form's fields 2. lock the row 3. update modified data in the database through stored procedure (function) 4. commit and unlock the row Have you another idea that could work better with disconnected objects ? While this ensures that the update is atomic, it doesn't ensure that no one else is trying to edit it at the same time. What you might want to do is either optimistically lock it, or use application level locking. To use optimistic locking, you'll need to do something like make an md5 of all the fields being edited, then, right before you write back the data, check to see if the md5 you created at the beginning still matches by re-reading the data and md5ing it again. If it doesn't match, then you can throw a mid air collision error, so to speak, and tell them that the record changed underneath them, or do some kind of merging / or whatnot. The ODBC driver uses the ctid value to check whether a record has changed; an updated row will always have a new ctid. That would probably be the most economical way to check. If you want to do application level locking, then create a field and use that for locks. Just make it a timestamp field and put in the current time value when the lock is taken. When the predetermined timeout occurs, the user lock is removed by the next person to access it, or offer them chance to, or email the original locker, etc... Handle it the way you want or need to. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[GENERAL] For Tom Lane
From : Tom Lane [EMAIL PROTECTED] To : gabriele zelasco [EMAIL PROTECTED] Cc : pgsql-general@postgresql.org Date : Thu, 26 May 2005 17:50:29 -0400 Subject : Re: [GENERAL] Locking rows gabriele zelasco [EMAIL PROTECTED] writes: I would like to start a transaction with a sql function. When user press edit button on my form, i would lock the current row. After user has modified data on form, pressing save button I would save t= he modified row by sql update function and so commit. This is widely considered a very bad way to design an application. Consider what happens when the user leaves for lunch, or otherwise lets the app sit for a long time. See the list archives for prior discussions of the issue. But in any case, the answer to your question is to use SELECT FOR UPDATE to retrieve the row. And you can't start a transaction inside a function, because by definition you'll already be in one. regards, tom lane Thanks for answer Tom Consider what happens when the user leaves for lunch Well, I've already thought about it.But I'm working with VS2003 and disconnected dataset.. so when user edit data he's modifying an old disconnected row, while real updated row is in the database.. So my strategy would be (as I already written): 1. refresh data recalling current row from database to the form's fields 2. lock the row 3. update modified data in the database through stored procedure (function) 4. commit and unlock the row Have you another idea that could work better with disconnected objects ? the answer to your question is to use SELECT FOR UPDATE to retrieve the row Well, I've created a sql function with just sql command : select * from table where condition FOR UPDATE but it doesn't lock the row ! If I write begin; before command , inside function, I get the error (begin is not allowed...) So what I have to do if I would lock a row from inside vb net code? Thanx in advance Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
[GENERAL] For Tom Lane (Msg-ID: [EMAIL PROTECTED])
gabriele zelasco [EMAIL PROTECTED] writes: I would like to start a transaction with a sql function. When user press edit button on my form, i would lock the current row. After user has modified data on form, pressing save button I would save t= he modified row by sql update function and so commit. This is widely considered a very bad way to design an application. Consider what happens when the user leaves for lunch, or otherwise lets the app sit for a long time. See the list archives for prior discussions of the issue. But in any case, the answer to your question is to use SELECT FOR UPDATE to retrieve the row. And you can't start a transaction inside a function, because by definition you'll already be in one. regards, tom lane Thanks for answer Tom Consider what happens when the user leaves for lunch Well, I've already thought about it.But I'm working with VS2003 and disconnected dataset.. so when user edit data he's modifying an old disconnected row, while real updated row is in the database.. So my strategy would be (as I already written): 1. refresh data recalling current row from database to the form's fields 2. lock the row 3. update modified data in the database through stored procedure (function) 4. commit and unlock the row Have you another idea that could work better with disconnected objects ? the answer to your question is to use SELECT FOR UPDATE to retrieve the row Well, I've created a sql function with just sql command : select * from table where condition FOR UPDATE but it doesn't lock the row ! If I write begin; before command , inside function, I get the error (begin is not allowed...) So what I have to do if I would lock a row from inside vb net code? Thanx in advance Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings ---(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: [GENERAL] For Tom Lane
On Fri, 2005-05-27 at 09:57, [EMAIL PROTECTED] wrote: Thanks for answer Tom Consider what happens when the user leaves for lunch Well, I've already thought about it.But I'm working with VS2003 and disconnected dataset.. so when user edit data he's modifying an old disconnected row, while real updated row is in the database.. So my strategy would be (as I already written): 1. refresh data recalling current row from database to the form's fields 2. lock the row 3. update modified data in the database through stored procedure (function) 4. commit and unlock the row Have you another idea that could work better with disconnected objects ? While this ensures that the update is atomic, it doesn't ensure that no one else is trying to edit it at the same time. What you might want to do is either optimistically lock it, or use application level locking. To use optimistic locking, you'll need to do something like make an md5 of all the fields being edited, then, right before you write back the data, check to see if the md5 you created at the beginning still matches by re-reading the data and md5ing it again. If it doesn't match, then you can throw a mid air collision error, so to speak, and tell them that the record changed underneath them, or do some kind of merging / or whatnot. If you want to do application level locking, then create a field and use that for locks. Just make it a timestamp field and put in the current time value when the lock is taken. When the predetermined timeout occurs, the user lock is removed by the next person to access it, or offer them chance to, or email the original locker, etc... Handle it the way you want or need to. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[GENERAL] Contacting Tom Lane :)
Hi, Tom answered a question from me and when I attemped to reply I got the following stuff... (I am running MacOSX with a postfix (output server). Most of the time after I get a complaint about non delivery I tell postfix to use my providers (Adelphia ) mail agent. This does not work for Mr Lanes mailbox ( Note I set my return address to my Incoming mailbox at the University). Is Tom's mail address output only? Jerry Begin forwarded message: From: System Administrator [EMAIL PROTECTED] Date: December 17, 2004 6:10:57 PM EST To: Levan, Jerry [EMAIL PROTECTED] Subject: Undeliverable:Re: [GENERAL] OSX 10.3.7 broke Postgresql 8.0.0b5? Your message To: Tom Lane Cc: Postgres General Subject: Re: [GENERAL] OSX 10.3.7 broke Postgresql 8.0.0b5? Sent:Fri, 17 Dec 2004 18:10:55 -0500 did not reach the following recipient(s): [EMAIL PROTECTED] on Fri, 17 Dec 2004 18:11:03 -0500 The e-mail account does not exist at the organization this message was sent to. Check the e-mail address, or contact the recipient directly to find out the correct address. mta13.adelphia.net #5.1.1 smtp; 550 5.0.0 Go away till you've fixed your virus problem Reporting-MTA: dns; FACSTAFF.facultystaff.eku.edu Final-Recipient: RFC822; [EMAIL PROTECTED] Action: failed Status: 5.1.1 X-Supplementary-Info: mta13.adelphia.net #5.1.1 smtp; 550 5.0.0 Go away till you've fixed your virus problem X-Display-Name: [EMAIL PROTECTED] From: Levan, Jerry [EMAIL PROTECTED] Date: December 17, 2004 6:10:55 PM EST To: Tom Lane [EMAIL PROTECTED] Cc: Postgres General [EMAIL PROTECTED] Subject: Re: [GENERAL] OSX 10.3.7 broke Postgresql 8.0.0b5? Well, what might be some good settings for a smallish db with the default configuration? Jerry On Dec 17, 2004, at 5:40 PM, Tom Lane wrote: Jerry LeVan [EMAIL PROTECTED] writes: Ok, I got postgres to start... I used these settings. FWIW, I just updated to 10.3.7 from 10.3.6 and compared the kern.sysv.* sysctl settings before and after. I see no indication that the default values have changed. regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend
Re: [GENERAL] Contacting Tom Lane :)
On Fri, Dec 17, 2004 at 18:29:10 -0500, Jerry LeVan [EMAIL PROTECTED] wrote: Hi, Tom answered a question from me and when I attemped to reply I got the following stuff... (I am running MacOSX with a postfix (output server). Most of the time after I get a complaint about non delivery I tell postfix to use my providers (Adelphia ) mail agent. This does not work for Mr Lanes mailbox ( Note I set my return address to my Incoming mailbox at the University). Is Tom's mail address output only? Did you read the error message? It clearly is complaining about getting viruses in the past from your ISP. ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
Re: [GENERAL] Contacting Tom Lane :)
Adelphia is not a small isp, it seems strange that all of Adelphia would be blocked... Jerry On Dec 17, 2004, at 11:49 PM, Bruno Wolff III wrote: On Fri, Dec 17, 2004 at 18:29:10 -0500, Jerry LeVan [EMAIL PROTECTED] wrote: Hi, Tom answered a question from me and when I attemped to reply I got the following stuff... (I am running MacOSX with a postfix (output server). Most of the time after I get a complaint about non delivery I tell postfix to use my providers (Adelphia ) mail agent. This does not work for Mr Lanes mailbox ( Note I set my return address to my Incoming mailbox at the University). Is Tom's mail address output only? Did you read the error message? It clearly is complaining about getting viruses in the past from your ISP. ---(end of broadcast)--- TIP 8: explain analyze is your friend
Re: [GENERAL] Contacting Tom Lane :)
Jerry LeVan [EMAIL PROTECTED] writes: Is Tom's mail address output only? No, but my spam filters have been described as possessing fangs ;-) After review of my mail logs I've unblocked your adelphia.net IP range; it looks like the spam flux from there has subsided. regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
Re: [GENERAL] Contacting Tom Lane :)
On Fri, Dec 17, 2004 at 23:46:46 -0500, Jerry LeVan [EMAIL PROTECTED] wrote: Adelphia is not a small isp, it seems strange that all of Adelphia would be blocked... I get crap from them. I had them mostly blocked for a while, but had to whitelist them because I need to get email from someone that uses them. ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings