Re: [GENERAL] TEXT field's length limit in PostgreSQL

2001-10-18 Thread Dr. Evil
I know that my question may seem trivial, but unfortunately I haven't found any understandable info on this topic. It's about length limit of the TEXT field in PostgreSQL. I've heard that the TEXT fields in psql are limited to 4096 bytes but it's just unbelievable for me. So if I've got text

Re: [GENERAL] a plpgsql documentation and samples

2001-09-11 Thread Dr. Evil
pl/pgsql doesn't seem to be very well documented. It would be cool if it were better documented, or if there were a tutorial. It would be even cooler if there were a pl/pgsql library, and also a library of C language functions that people could use. However, in the meantime, people on this

Re: [GENERAL] How to make a REALLY FAST db server?

2001-09-10 Thread Dr. Evil
As far as disks go. You cannot have too many spindles. But the number of spindles you have available depends on which pieces of postgres get split onto dedicated spindles. But if you have enough RAM that the entire DB can be held in RAM, and if the DB acess pattern is 90% read, 10% write

[GENERAL] Solution found! was Re: Finding the number of rows affected by UPDATE or INSERT?

2001-08-30 Thread Dr. Evil
I found out how to do it: In pl/pgsql: INT nr; UPDATE GET DIAGNOSTICS SELECT PROCESSED INTO nr; will put the number of rows into nr. It's a very useful feature to have this in PG7.1. ---(end of broadcast)--- TIP 2: you can get off all

[GENERAL] Finding the number of rows affected by UPDATE or INSERT?

2001-08-29 Thread Dr. Evil
I am writing a bunch of stuff in pl/pgsql, and some of these functions do UPDATEs or INSERTs on various tables. How could I find out, from within the pl/pgsql function, how many rows were affected? This way, if the update or insert fails for some reason, I can return a failed message from the

WAL and Re: MySQL's (false?) claims... (was: Re: [GENERAL] PL/java?)

2001-08-26 Thread Dr. Evil
You guys shouldn't even be worrying about this. Five years from now, MySQL will be a much more mature product, but the way I see it now is this: MySQL: Great for message boards (Slashdot), information retrieval (an on-line phone directory that's mostly static), or other lightweight

[GENERAL] Still wondering about random numbers...

2001-08-07 Thread Dr. Evil
I am running on OpenBSD and Linux, both of which have cryptographic-quality RNGs built in. When I call RANDOM() in PG, do I get the old C library random numbers, which are not very random, or do I get high-quality random numbers from the crypto-RNG that's built in? Any sugestions for getting

[GENERAL] Good random numbers in PG? And crypto-wishlist

2001-07-25 Thread Dr. Evil
I'm writing an application that requires cryptographicly-sound random decimal digits in PG. One way to do this is with a plain old hash like SHA1. The problem is that this produces a 20 byte string, when what I want is a digit from 0 to 9. One thing I could do is take this 20 byte string, and

[GENERAL] Re: diff's between creations of tables

2001-07-25 Thread Dr. Evil
They are both the same, as far as I know. I usually make my table definition file like this: DROP SEQUENCE mytable_number_seq; DROP TABLE mytable; CREATE TABLE mytable ( number SERIAL ); ---(end of broadcast)--- TIP 1: subscribe and

[GENERAL] Changes to C interface from 7.0 to 7.1

2001-07-20 Thread Dr. Evil
I have a function like this: VARSIZE(result) = result_size - 1; sha1_init(C); sha1_write(C, VARDATA(arg), VARSIZE(arg)-VARHDRSZ); anyway, the problem is that VARSIZE is no longer defined in a way that I can make assignments to in 7.1. Does anyone have any sugestions? Also, if there is

[GENERAL] Re: How Postgresql Compares For Query And Load Operations

2001-07-20 Thread Dr. Evil
Mark, thanks for sharing these results with us. Interesting. PG is definitely slower, but not overwhelmingly slower. I wonder how different the result would be if you had a huge amount of RAM and allocated PG enough buffers to keep the entire table in RAM. That would take OS IO considerations

[GENERAL] Re: PG rules! (RULES being the word ;-)

2001-07-18 Thread Dr. Evil
this way i have to implement my businees logic twice. inside the database and in the middleware. I dont think that this is very good. Sometimes implenting the business logic twice is the right thing to do. For instance, let's say we have a financial application, and we need to calculate

[GENERAL] Re: pl-sql

2001-07-18 Thread Dr. Evil
pl/pgsql can give a real boost if you need to aggregate values in a way that doesn't have an existing SQL function. For instance, there is an SQL function which will take an average. However, what if you need some other statistical type of average which isn't supported in SQL? For the sake of

[GENERAL] RedHat Open Database?

2001-07-07 Thread Dr. Evil
I saw an announcement somewhere that RedHat is working on its own Open Database, based on PG. What do people think about this? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister

[GENERAL] Preventing variables from rolling over

2001-05-29 Thread Dr. Evil
I assume that if I keep on adding to an INT4, at some point it will roll over and become negative, and then if I add some more, it could become positive. Is there a way to prevent this? Ie, I would like for it to end with an error instead of wrapping around. Or is there a way to check for

[GENERAL] Implicit row locking during an UPDATE

2001-05-24 Thread Dr. Evil
I'm still not understanding this, and it's vitally important to the project I'm working on, so I have a question: From my understanding, this: UPDATE account SET value = 10 WHERE number = 99; actually implies all of this: BEGIN; SELECT value FOR UPDATE FROM account WHERE number = 99; UPDATE

[GENERAL] chr() command in PG7.03?

2001-04-30 Thread Dr. Evil
I notice in 7.1, there is a chr() command which converst an intenger into a char, but it doesn't seem to work in 7.03. Is there an equivalent command? I couldn't find anything in the docs. ---(end of broadcast)--- TIP 1: subscribe and

[GENERAL] Strange PG error

2001-04-29 Thread Dr. Evil
I was trying to write a function which does a DES encryption for Postgres, which I would then link in as a C function. I got the function more or less working on its own, and then I tried to link it to PG. The first time I executed the function, the backend died. Then, I removed the Unix

[GENERAL] CREATE TABLE AS... syntax?

2001-04-25 Thread Dr. Evil
I'm trying to use CREATE TABLE AS under 7.03. There are no examples in the guide, so I tried a few things: CREATE TABLE foo (test INT4) AS SELECT number FROM account; and CREATE TABLE foo (test INT4) AS number FROM account; and both of them give ERROR: parser: parse error at or near as.

[GENERAL] The dreaded readline, again

2001-04-07 Thread Dr. Evil
I'm trying to install PG on my new OpenBSD machine. I installed the latest version of GNU readline in the usual place (defaults to /usr/local/...) and then I did ./configure in the src/ directory of PG7.03. This should have detected readline properly, but when I tried psql, I couldn't use the