Re: [HACKERS] New version of money type
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Sep 29, 2006 at 10:43:53PM -0700, David Fetter wrote: On Sat, Sep 30, 2006 at 04:42:13AM +, [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Sep 29, 2006 at 12:19:07PM +0200, Martijn van Oosterhout wrote: On Thu, Sep 28, 2006 at 06:32:11PM -0500, Jim C. Nasby wrote: [15 bit for three upcase ASCII] I feel silly for even mentioning this, but there are less than 256 countries in the UN, and as far as I know, each has at most one currency, so you could use 8 bits instead of 15. Hm. But then you'd have to cope with a mapping (currency-id - description) which changes over time. Maybe it'd suffice to postulate that no id be reused. That leaves forty-eightish bits for the number or about 10^14. By the above calculation, 56 bits or about 7.2 * 10^16. Yes, way more useful than 10^14 (about a hundred times ;) It's not just dependent on time. Exchange rates vary in such a way that the relationships are not always transitive :P :-) Regards - -- tomas -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFFHilyBcgs9XrR2kYRAg+mAJ96+TTAjqEJK7J1nbI7EwVibYFoxwCfWElO VJCskdQThqxI90gzTX+gR8A= =OCN0 -END PGP SIGNATURE- ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [HACKERS] Backup and restore through JDBC
Hi, Tom, Tom Dunstan wrote: On a unix box, when you're really crazy, and want to ignore all security restrictions, you could even install pg_dump via inetd, and then everyone connecting via TCP on the appropriate port gets a dump of the database. :-) Oh, man, my head just exploded reading that. That's taking evil and being *creative* with it. :) Well, combine that with some firewall / hosts.allow rules, and sslwrap with certificate based 2-way authentication, if you insist on security. :-) Keep on lauging, Markus -- Markus Schaber | Logical TrackingTracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org signature.asc Description: OpenPGP digital signature
Re: [HACKERS] New version of money type
I feel silly for even mentioning this, but there are less than 256 countries in the UN, and as far as I know, each has at most one currency, so you could use 8 bits instead of 15. That's not always true, e.g. China has RMB and HKD. Also Taiwan is not a member country of UN but I don't think one would exclude TWD. There'll also times a country may transit from one currency to another. Even a currency (currency of most continental European countries before Euro) is no more being used, it may still need to be supported. xz ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [HACKERS] New version of money type
On Sat, Sep 30, 2006 at 11:36:04AM -0400, Xiaofeng Zhao wrote: I feel silly for even mentioning this, but there are less than 256 countries in the UN, and as far as I know, each has at most one currency, so you could use 8 bits instead of 15. That's not always true, e.g. China has RMB and HKD. Also Taiwan is not a member country of UN but I don't think one would exclude TWD. Right. There are several countries whose currency is USD, so I still contend that at any given instant, there are fewer than 256 currencies, so we're back to 8 bits. There'll also times a country may transit from one currency to another. Even a currency (currency of most continental European countries before Euro) is no more being used, it may still need to be supported. The money type is far too simplistic to model this kind of thing. A really sophisticated representation of money would have to take time, inflation/deflation, pairwise exchange rates, etc. into account. It would look more like a schema with a large data set and a large body of code loaded into it than it would a data type. Cheers, D -- David Fetter [EMAIL PROTECTED] http://fetter.org/ phone: +1 415 235 3778AIM: dfetter666 Skype: davidfetter Remember to vote! ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [HACKERS] New version of money type
David Fetter [EMAIL PROTECTED] writes: The money type is far too simplistic to model this kind of thing. A really sophisticated representation of money would have to take time, inflation/deflation, pairwise exchange rates, etc. into account. It would look more like a schema with a large data set and a large body of code loaded into it than it would a data type. I don't think that's the appropriate functionality for a data type. I used to be in the currency trading game (before I decided hacking Postgres was more fun), and if you ask me, the people who want this functionality are specifically interested in those exchange rates and time variations --- it's exactly the purpose of their databases to store, search, and manipulate that data, so burying it behind the scenes in a datatype is exactly the wrong approach. At least for what I was doing back then, a tagged type is exactly the right thing: all we'd have wanted is for it to keep us from thinking that adding 2 USD and 2 EUR directly was a sane computation. Oh BTW: 10^14 is not enough dynamic range --- those guys push around *serious* amounts of money. Bill Gates' net wealth is somewhere north of 10^13 cents, and he's just a private citizen not a bank. regards, tom lane ---(end of broadcast)--- TIP 1: 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: [HACKERS] PostgreSQL 8.2beta1 w/ VALUES
Stephen Frost [EMAIL PROTECTED] writes: When loading a rather large data set I started getting errors along these lines: psql:/home/sfrost/school/cs750/reality/dump-anonymized.postgres.sql:262: WARNING: nonstandard use of escape in a string literal LINE 1: ...XX ,9:9:999'),(9,'',0,'X XXX... ^ HINT: Use the escape string syntax for escapes, e.g., E'\r\n'. Which, by themselves, aren't really an issue *except* for the fact that I got an *insane* number of them. I don't think it was quite one for every row (of which there were 20,795, you'll note) but it was more than enough to drive me insane. Additionally, cancel requests were ignored. That's not too surprising because I don't believe there are any CHECK_FOR_INTERRUPTS calls in the basic lex/parse loop. That wouldn't normally be a problem because that phase is pretty quick, but it is a problem if the system is spitting tons of messages at you. It seems like a reasonable thing to do would be to add a CHECK_FOR_INTERRUPTS in elog.c just after sending a notice/warning message to the client. Comments? regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [HACKERS] [PATCHES] Bad bug in fopen() wrapper code
Claudio Natoli [EMAIL PROTECTED] writes: Magnus Hagander writes: Now, I still twist my head around the lines: if ((fd = _open_osfhandle((long) h, fileFlags O_APPEND)) 0 || (fileFlags (O_TEXT | O_BINARY) (_setmode(fd, fileFlags (O_TEXT | O_BINARY)) 0))) Without having studied it closely, it might also highlight a bug on failure of the second clause -- if the _setmode fails, shouldn't _close be called instead of CloseHandle, and -1 returned? (CloseHandle would still be called on failure of the _open_osfhandle, obviously) I agree that this code is both wrong and unreadable (although in practice the _setmode will probably never fail, which is why our attention hasn't been drawn to it). Is someone going to submit a patch? I'm hesitant to change the code myself since I'm not in a position to test it. regards, tom lane ---(end of broadcast)--- TIP 1: 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
[HACKERS] libedit broke in head
Hello, It seems I am unable to compile libedit support in -HEAD t -lpgport -L../../../src/interfaces/libpq -lpq -L../../../src/port -Wl,-rpath,'/usr/local/pgsql/lib' -lpgport -lz -lcrypt -ldl -lm -o psql input.o: In function `pg_send_history': input.c:(.text+0x10d): undefined reference to `add_history' input.o: In function `gets_interactive': input.c:(.text+0x23d): undefined reference to `readline' input.o: In function `initializeInput': input.c:(.text+0x27a): undefined reference to `initialize_readline' input.c:(.text+0x286): undefined reference to `using_history' input.c:(.text+0x2ca): undefined reference to `read_history' input.c:(.text+0x2d1): undefined reference to `history_set_pos' input.c:(.text+0x2d6): undefined reference to `current_history' input.c:(.text+0x311): undefined reference to `next_history' input.o: In function `saveHistory': input.c:(.text+0x409): undefined reference to `write_history' input.c:(.text+0x43b): undefined reference to `history_set_pos' input.c:(.text+0x440): undefined reference to `current_history' input.c:(.text+0x481): undefined reference to `next_history' input.o: In function `finishInput': input.c:(.text+0x4df): undefined reference to `stifle_history' collect2: ld returned 1 exit status make[3]: *** [psql] Error 1 make[3]: Leaving directory `/home/jd/pgsql/src/bin/psql' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/jd/pgsql/src/bin' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/jd/pgsql/src' make: *** [all] Error 2 Configured with: ./configure --with-libedit-preferred --without-readline -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/ ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [HACKERS] [PATCHES] adminpack
Joshua D. Drake [EMAIL PROTECTED] writes: Here is adminpack... Applied with minor corrections (the .sql file is DATA not DATA_built, as you'd have found out if you'd tried make clean). Likewise for the pgrowlocks script. regards, tom lane ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [HACKERS] [PATCHES] adminpack
Tom Lane wrote: Joshua D. Drake [EMAIL PROTECTED] writes: Here is adminpack... Applied with minor corrections (the .sql file is DATA not DATA_built, as you'd have found out if you'd tried make clean). Likewise for the pgrowlocks script. Noted, thanks. regards, tom lane -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/ ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] PostgreSQL 8.2beta1 w/ VALUES
That seems right, there won't be a performance impact unless the warnings are issued. - Luke Msg is shrt cuz m on ma treo -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Saturday, September 30, 2006 01:48 PM Eastern Standard Time To: Stephen Frost Cc: pgsql-hackers@postgresql.org Subject:Re: [HACKERS] PostgreSQL 8.2beta1 w/ VALUES Stephen Frost [EMAIL PROTECTED] writes: When loading a rather large data set I started getting errors along these lines: psql:/home/sfrost/school/cs750/reality/dump-anonymized.postgres.sql:262: WARNING: nonstandard use of escape in a string literal LINE 1: ...XX ,9:9:999'),(9,'',0,'X XXX... ^ HINT: Use the escape string syntax for escapes, e.g., E'\r\n'. Which, by themselves, aren't really an issue *except* for the fact that I got an *insane* number of them. I don't think it was quite one for every row (of which there were 20,795, you'll note) but it was more than enough to drive me insane. Additionally, cancel requests were ignored. That's not too surprising because I don't believe there are any CHECK_FOR_INTERRUPTS calls in the basic lex/parse loop. That wouldn't normally be a problem because that phase is pretty quick, but it is a problem if the system is spitting tons of messages at you. It seems like a reasonable thing to do would be to add a CHECK_FOR_INTERRUPTS in elog.c just after sending a notice/warning message to the client. Comments? regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] New version of money type
There'll also times a country may transit from one currency to another. Even a currency (currency of most continental European countries before Euro) is no more being used, it may still need to be supported. The money type is far too simplistic to model this kind of thing. A really sophisticated representation of money would have to take time, inflation/deflation, pairwise exchange rates, etc. into account. It would look more like a schema with a large data set and a large body of code loaded into it than it would a data type. The statement of my bank account does not contain any of the quantities you mentioned. But when some body open a statement from year 2000, most likely he expect to see the balance and transcations are in, say, German Marks, not in Euros. xz ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
[HACKERS] Select for update with outer join broken?
All, Some change which was made in the last couple weeks broke select for update with an outer join: Please examine the SQLException for more information. NestedException: org.postgresql.util.PSQLException: ERROR: SELECT FOR UPDATE/SHARE cannot be applied to the nullable side of an outer join at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.throwJDOSql Exception(SQLStoreManager.java:632) This was working per SQL spec before beta ... what happened? Error above is from Thursday's snapshot. -- Josh Berkus PostgreSQL @ Sun San Francisco ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [HACKERS] libedit broke in head
Tom Lane wrote: Joshua D. Drake [EMAIL PROTECTED] writes: It seems I am unable to compile libedit support in -HEAD On what platform, and with what version of libedit? I built HEAD just yesterday on a vanilla Darwin/Intel 10.4.7 machine with Apple's libedit. we have (a bit of) buildfarm coverage of that too - at least emu is building with --with-libedit-preferred for a while now. Configured with: ./configure --with-libedit-preferred --without-readline Not sure that combination of switches is sensible. Try it with just the first, or even without either if you don't have readline present. I agree - using both flags together looks just wrong ... Stefan ---(end of broadcast)--- TIP 1: 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: [HACKERS] Select for update with outer join broken?
Josh Berkus josh@agliodbs.com writes: Some change which was made in the last couple weeks broke select for update with an outer join: NestedException: org.postgresql.util.PSQLException: ERROR: SELECT FOR UPDATE/SHARE cannot be applied to the nullable side of an outer join What SQL query is it complaining about, exactly? That error message has been there right along, but I seem to recall having moved the place where it's checked for since 8.1. regards, tom lane ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [HACKERS] libedit broke in head
Stefan Kaltenbrunner wrote: Tom Lane wrote: Joshua D. Drake [EMAIL PROTECTED] writes: It seems I am unable to compile libedit support in -HEAD On what platform, and with what version of libedit? I built HEAD just yesterday on a vanilla Darwin/Intel 10.4.7 machine with Apple's libedit. we have (a bit of) buildfarm coverage of that too - at least emu is building with --with-libedit-preferred for a while now. Configured with: ./configure --with-libedit-preferred --without-readline Not sure that combination of switches is sensible. Try it with just the first, or even without either if you don't have readline present. I agree - using both flags together looks just wrong ... I think the switches are confusing ... when you are using libedit, you certainly don't want readline as well, so it seems natural to disable it. I understand that what --without-readline really does is turn the line-editing capability off in general rather than just readline, which is confusing. -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [HACKERS] libedit broke in head
Alvaro Herrera [EMAIL PROTECTED] writes: I think the switches are confusing ... when you are using libedit, you certainly don't want readline as well, so it seems natural to disable it. I understand that what --without-readline really does is turn the line-editing capability off in general rather than just readline, which is confusing. The documentation could be improved perhaps: $ ./configure --help | grep -i edit --with-libedit-preferred prefer BSD Libedit over GNU Readline --without-readline do not use GNU Readline / BSD Libedit line editing $ ISTM the second line would be clearer if it read --without-readline do not use GNU Readline nor BSD Libedit for editing Also, we probably ought to see if we can make the libedit-preferred line come out second. regards, tom lane ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
[HACKERS] Still need GUC update_process_title?
We added GUC update_process_title (default is 'on') in 8.2 based on tests Tom ran showing that there was a performance impact for the process title. With the new use of strlcpy(), is there still an impact from process title? Tom, would you run your tests again? Thanks. -- Bruce Momjian [EMAIL PROTECTED] EnterpriseDBhttp://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [HACKERS] libedit broke in head
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: I think the switches are confusing ... when you are using libedit, you certainly don't want readline as well, so it seems natural to disable it. I understand that what --without-readline really does is turn the line-editing capability off in general rather than just readline, which is confusing. Just to verify. With removing the second switch, were good. It tested and ran clean. The documentation could be improved perhaps: $ ./configure --help | grep -i edit --with-libedit-preferred prefer BSD Libedit over GNU Readline --without-readline do not use GNU Readline / BSD Libedit line editing $ ISTM the second line would be clearer if it read --without-readline do not use GNU Readline nor BSD Libedit for editing Also, we probably ought to see if we can make the libedit-preferred line come out second. I really don't get the libedit-preferred syntax? Why not just: --with-libedit use BSD Libedit not GNU Readline --with-readline use GNU Readline not BSD Libedit --without-readline do not use GNU Readline nor BSD Libedit Of course --without-readline is really a misnomer too. But --without-edit doesn't sound right. Sincerely, Joshua D. Drake regards, tom lane -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/ ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [HACKERS] New version of money type
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sat, Sep 30, 2006 at 01:00:05PM -0400, Tom Lane wrote: David Fetter [EMAIL PROTECTED] writes: [...] Oh BTW: 10^14 is not enough dynamic range --- those guys push around *serious* amounts of money. Bill Gates' net wealth is somewhere north of 10^13 cents, and he's just a private citizen not a bank. I do agree that a range in the 10^14 is too small. Even 10^16 seems to be uncomfortably near to existing values. And thensome like to do things with (decimal) sub-cent accuracy (think percents and prices per weight unit). May be 64 bit is just not enough for a tagged money type? Regards - -- tomas -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFFH0cDBcgs9XrR2kYRAhBfAJ9xvi1z8N73VpoiPSczZCUgBENKrgCdHGOd fEY52y+um4jgW1oUkb8YQ64= =0UGx -END PGP SIGNATURE- ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [HACKERS] Still need GUC update_process_title?
Bruce Momjian [EMAIL PROTECTED] writes: We added GUC update_process_title (default is 'on') in 8.2 based on tests Tom ran showing that there was a performance impact for the process title. With the new use of strlcpy(), is there still an impact from process title? Tom, would you run your tests again? Thanks. I don't really need to: the platforms on which it counts are the ones where a kernel call is involved. It's sheer folly to suppose that strlcpy eliminates that issue. regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend