[GENERAL] Does PG cache results of an aggregate function, (and results of non-volatile functions)?

2009-09-03 Thread Allan Kamau
Hi, I do have a query which make use of the results of an aggregate function (for example bit_or) several times in the output column list of the SELECT clause, does PostgreSQL simply execute the aggregate function only once and provide the output to the other calls to the same aggregate function. H

Re: [GENERAL] Postgres memory question

2009-08-10 Thread Allan Kamau
On Mon, Aug 10, 2009 at 7:49 PM, Vick Khera wrote: > On Mon, Aug 10, 2009 at 9:46 AM, Bill Moran wrote: >> We have servers using about 200 connections on average ... it climbs up >> to 300+ during busy use.  I've seen it peak as high as 450, and we've seen >> no performance issues. >> >> This is a

Re: [GENERAL] [PERFORM] Concurrency issue under very heay loads

2009-07-16 Thread Allan Kamau
May be a simple way would be to use a "SEQUENCE" database object. And call nextval('your_sequence') to obtain the next unique value (of type bigint). According to PG docs "http://www.postgresql.org/docs/8.4/interactive/functions-sequence.html";, the sequence object has functions that "provide simpl

Re: [GENERAL] how to extract data from bytea so it is be used in blob for mysql database

2009-05-14 Thread Allan Kamau
Hi George, This is my guess to the cause of the problem (I could be wrong). You edited the pg_dump generated sql file to suit to suit the requirements of your target server (MySQL), during this edition, your editor may have inserted line terminators where it found long sentences, this long sen

Re: [GENERAL] Calculating product from rows - (aggregate product ) [solution found, thanks Andreas]

2009-05-04 Thread Allan Kamau
On Mon, May 4, 2009 at 10:42 AM, A. Kretschmer wrote: > In response to Allan Kamau : >> Hi >> >> I would like to calculate a product of a field's values of a relation, >> this function may multiply each value and give the result as a single >> float numb

Re: [GENERAL] Calculating product from rows - (aggregate product )

2009-05-04 Thread Allan Kamau
,some_field)VALUES(4,null); SELECT array_to_string(ARRAY(SELECT a.some_field FROM imaginary a),'*'); --within plpgsql execute the following EXECUTE 'SELECT '||SELECT array_to_string(ARRAY(SELECT a.some_field FROM imaginary a),'*') INTO _my_aggregated_product;

[GENERAL] Calculating product from rows - (aggregate product )

2009-05-04 Thread Allan Kamau
Hi I would like to calculate a product of a field's values of a relation, this function may multiply each value and give the result as a single float number. For example: CREATE table imaginary(id INTEGER NOT NULL, some_field FLOAT NULL,primary key(id)); INSERT INTO imarginary(1,0.333);I

Re: [GENERAL] Restore Crashes Postgres

2009-04-28 Thread Allan Kamau
You may want to zero in on the problem by performing database dumps (using pg_dump and the various options accordingly) then restore on the failing installation using the psql command. Maybe (I am guessing here, you haven't elaborated on "crashes") you may be issuing insert statements (in the

Re: [GENERAL] Web + Slicing/Paging datas

2009-04-28 Thread Allan Kamau
On Tue, Apr 28, 2009 at 2:21 PM, Jasen Betts wrote: > On 2009-04-23, durumdara wrote: >> Hi! >> >> In a mod_py application I wanna write a wrapper that handle all PSQL >> data view with paging/slicing. >> >> For example: >> I have 1.500 records. I wanna show only N (f. ex: 15) records in the >

Re: [GENERAL] PGSQL and Javascript

2009-01-30 Thread Allan Kamau
May be Javascript + JDBC not sure. But the question is why would you want to do so? Javascript can be read easily by the user having the javascript running on their browser. JDBC or any other database connecting client will want to some how authenticate the user in most cases the username, passwor

Re: [GENERAL] How are locks managed in PG?

2008-12-19 Thread Allan Kamau
Postgres by default uses the MVCC (Multiversion Concurrency Control, MVCC) for concurrency control. This is a large topic and may require more explanation than a simple email response would easily provide. The well written PostgreSQL documentation has good explanation on this topic (http://www.post

Re: [GENERAL] Lost password

2008-12-17 Thread Allan Kamau
this password has been registered and won't go away even if the software is > deleted. > > Any help much appreciated! > > PS I use windows vista and my friend turned my user account control off. > > Why on earth is there not a retrieve password function - unbelievable. >

Re: [GENERAL] Rows count in the cursor ?

2008-12-16 Thread Allan Kamau
Hi Ivanmara, There are two things about cursors you may need to remember ( I hope I do remember fairly well not to error in this response :-) ). 1) A cursor is similar to a pointer to a given record, which means it's "vision" is limited to the current record, and you move the cursor forward by

Re: [GENERAL] Lost password

2008-12-16 Thread Allan Kamau
It is assumed you are running Unix (or Linux). The commands you've been provided with are standard Unix system commands that will help you find the files (pg_hba.conf) you are looking for, the output of these commands (locate or find) is the absolute path to your queried file (in your case pg_hba.c

Re: [GENERAL] Piping CSV data to psql when executing COPY .. FROM STDIN (Solved)

2008-10-29 Thread Allan Kamau
h I scp to the remote server then I issue another call to psql to connect to the remote server's PostgreSQL and execute an sql having a COPY abc FROM .. Allan. Sam Mason wrote: On Tue, Oct 28, 2008 at 03:11:05PM +0200, Allan Kamau wrote: Sam, I have been unable to understand your sh

Re: [GENERAL] Piping CSV data to psql when executing COPY .. FROM STDIN

2008-10-28 Thread Allan Kamau
Reid Thompson wrote: Allan Kamau wrote: Sam, I have been unable to understand your shell script well enough to use it. Seems am slow this afternoon :-) On this list I saw a message detailing using copy as illustrated below (see )when I run this command I get the following output (see

Re: [GENERAL] Piping CSV data to psql when executing COPY .. FROM STDIN

2008-10-28 Thread Allan Kamau
SV HEADER;' COPY ( SELECT * FROM abc ) to STDOUT WITH delimiter E'\t' \echo '\\.' Sam Mason wrote: On Tue, Oct 28, 2008 at 01:25:00PM +0200, Allan Kamau wrote: The alternative I am attempting is to use "COPY abc FROM STDIN WITH HEADER". I pipe the

[GENERAL] Piping CSV data to psql when executing COPY .. FROM STDIN

2008-10-28 Thread Allan Kamau
Hi all, I am trying to copy data (results of a SELECT * FROM abc WHERE ...) to a remote PC (on my network). If I execute the "COPY abc2 FROM abc.txt CSV WITH HEADER" on psql connected to the remote PC, PostgreSQL will expect the file to be resident on the (remote) server's file system (or atl

Re: [GENERAL] Need some help

2008-07-01 Thread Allan Kamau
Indeed, perhaps no one in the mailing list can look over your shoulder to get the much needed additional details as Chandra has pointed out. My guess is that you may be trying a binary install, perhaps rpm. The install the complains that it cannot find libraries that it requires installed on t

Re: [GENERAL] pg_dump estimation

2008-06-25 Thread Allan Kamau
Sam Mason wrote: On Tue, Jun 24, 2008 at 11:13:14PM -0500, Marcelo Martins wrote: is there a way to find out / calculate / estimate how big a pg_dump using plain text format for a DB will be ? How about simply doing: pg_dump | wc -c Sam Hi Marcelo, If (using Sam's suggest

Re: [GENERAL] replication

2008-06-25 Thread Allan Kamau
Initially you may want to get the full dump (this applies also to the replication option) across to your other site. You may want to bzip2 the dump file, you may be surprised by the reduction of file size using bzip2. Try "tar -cjf mydump.sql.tar.bz2 mydump.sql" then transfer it using scp or pl

Re: [GENERAL] Password safe web application with postgre

2008-05-15 Thread Allan Kamau
Hi Bohdan, Is your web applications for use with PostgreSQL server administration where you would like users to supply their login credentials for PostgreSQL so that their actions within the db can be limited by the fine gain privileges assigned to them? If it is not then you may want to mayb

Re: [GENERAL] Removing redundant itemsets

2008-03-31 Thread Allan Kamau
Thanks, I have "reworded" the email (replaced "transaction" with "purchase"). The email has now been sent to the pgsql-sql mailing list. Craig Ringer wrote: Allan Kamau wrote: Hi all, I have a plain sql problem (didn't know where else to post it).

[GENERAL] Removing redundant itemsets

2008-03-31 Thread Allan Kamau
Hi all, I have a plain sql problem (didn't know where else to post it). I have a list of transactions (market basket) and I would like to select non redundant longest possible patterns by eliminating (creating/populating other table to contain only non redandant itemsets) transactions having it

Re: [GENERAL] Writing transactions in plpgsql

2001-06-08 Thread Allan Kamau
> I would like to write begin and commit/rollback > transaction instructions within plpgsql writen > functions. > Also how to write 'lock serializable' in plpgsql. > > Thank you in advance. > > Allan Kamau.

Re: [GENERAL] Writing transactions in plpgsql

2001-06-08 Thread Allan Kamau
> I would like to write begin and commit/rollback > transaction instructions in plpgsql functions I am writing. > Also how to write 'lock serializable' in plpgsql > > Thank you in advance. > > Allan Kamau. >

<    1   2