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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
20 matches
Mail list logo