Re: [GENERAL] Can anyone help setting up pgbouncer?

2009-11-17 Thread Nick
Here's my output. Is it a permission error writing to etc? $ strace -f -e open pgbouncer -v pgbouncer.ini open("/etc/ld.so.cache", O_RDONLY) = 3 open("/usr/local/lib/libevent-1.4.so.2", O_RDONLY) = 3 open("/lib/libcrypt.so.1", O_RDONLY)= 3 open("/lib/libc.so.6", O_RDONLY)= 3 open(

Re: [GENERAL] Can anyone help setting up pgbouncer?

2009-11-17 Thread Rikard Bosnjakovic
On Tue, Nov 17, 2009 at 09:13, Nick wrote: > Here's my output. Is it a permission error writing to etc? [...] All files that are tried to be opened (in read only-mode) are successful, but there's a lack of an strace-message prior to pgbouncer's error message. For that particular strace-output,

[GENERAL] postgresql-8.4.1 compile error (with Sun Studio 11)

2009-11-17 Thread Maciej (Matchek) Blizinski
Hi pgsql-general, I'm looking at compiling postgresql using Sun Studio 11, on Solaris 8. I'm getting the following error: gmake[7]: Entering directory `/home/maciej/src/opencsw/pkg/postgresql/trunk/work/solaris8-sparc/build-isa-sparcv8/postgresql-8.4.1/src/interfaces/ecpg/pgtypeslib' gmake[7]: N

[GENERAL] test data

2009-11-17 Thread Willy-Bas Loos
Hi, Is there such a thing as a test dataset for postgresql? Coming from the project i mean. Cheers, WBL -- "Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw -- Sent via pgsql-general mailing list (pgsql-general@post

Re: [GENERAL] test data

2009-11-17 Thread Thomas Kellerer
Willy-Bas Loos, 17.11.2009 12:15: Hi, Is there such a thing as a test dataset for postgresql? Coming from the project i mean. Cheers, WBL Try this: http://pgfoundry.org/projects/dbsamples/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subsc

Re: [GENERAL] Can anyone help setting up pgbouncer?

2009-11-17 Thread Richard Huxton
Nick wrote: > Thanks Richard, I updated my users.txt file to include quotes (it > didn't) which fixed the broken auth file error, but now im getting > this... > > 1518 ERROR unconfigured_file: No such file or directory > > which repeats over and over again when I try > > pgbouncer -v pgbouncer.i

Re: [GENERAL] calling a function over several rows

2009-11-17 Thread Merlin Moncure
On Tue, Nov 17, 2009 at 1:35 AM, Adam Rich wrote: > Merlin Moncure wrote: >> >> On Tue, Nov 17, 2009 at 1:02 AM, Adam Rich wrote: >>> >>> Hello, >>> There is an existing function which takes an integer and returns a >>> record. >>>  I need to call this function with every integer in a table.  Is

[GENERAL] WAL file question

2009-11-17 Thread Geoffrey
listing of wal file time stamps for one of our production databases: Nov 17 06:22 000100610013 Nov 17 06:42 000100610014 Nov 17 07:02 000100610015 Nov 17 07:22 000100610016 Nov 17 07:42 000100610017 Nov 17 08:02 000100610018

Re: [GENERAL] postgresql-8.4.1 compile error (with Sun Studio 11)

2009-11-17 Thread Tom Lane
"Maciej (Matchek) Blizinski" writes: > "/opt/csw/postgresql/include/ecpg_config.h", line 9: warning: macro > redefined: HAVE_LONG_LONG_INT_64 > "prepare.c", line 116: identifier redeclared: ECPGprepare > current : function(int, pointer to const char, const char, > pointer to const char, po

Re: [GENERAL] WAL file question

2009-11-17 Thread Tom Lane
Geoffrey writes: > listing of wal file time stamps for one of our production databases: > Nov 17 06:22 000100610013 > Nov 17 06:42 000100610014 > Nov 17 07:02 000100610015 > Nov 17 07:22 000100610016 > Nov 17 07:42 000100610017 > Nov 17 0

Re: [GENERAL] WAL file question

2009-11-17 Thread Geoffrey
Tom Lane wrote: Geoffrey writes: listing of wal file time stamps for one of our production databases: Nov 17 06:22 000100610013 Nov 17 06:42 000100610014 Nov 17 07:02 000100610015 Nov 17 07:22 000100610016 Nov 17 07:42 000100610017 Nov

Re: [GENERAL] passing parameters to multiple statements

2009-11-17 Thread Konstantin Izmailov
Some companies have policy to stay DB agnostic, i.e. use standard SQL only. This is why they want to use multiple statements, not stored procedures. I'm not familiar with RETURNING. Is this SQL standard? Can it be used for inserting a row and returning back primary key for the inserted row in one

[GENERAL] impersonating a user/ownership problems

2009-11-17 Thread Ivan Sergio Borgonovo
I've several schemas each one is owned by a user. Then there are websites sharing the same code base using different schemas and connecting with different users. When I have to refactor I generally have to make the same changes for all the schemas. I log in as a user that have enough right to all

[GENERAL] build array of composites in SPI

2009-11-17 Thread Merlin Moncure
Trying to formulate a good strategy for $subject. The code is performance critical. The composite type is simple: (text, text), that needs to be routed to function call in array form. The #elements in the array is small, generally less than 10. The approach I have now is this: 1) look up the oi

Re: [GENERAL] build array of composites in SPI

2009-11-17 Thread Tom Lane
Merlin Moncure writes: > 2) build the composite via: > 2a) TupleDescGetAttInMetadata > 2b) BuildTupleFromCStrings > 2c) get datum/HeapTupleGetDatum If it's performance critical, you might want to avoid the extra overhead of the AttInMetadata API. Especially if you know the column datatypes

Re: [GENERAL] plperl: spi_query_prepared/spi_fetchrow versus spi_exec_prepared: memory?

2009-11-17 Thread Alexey Klyukin
On Nov 17, 2009, at 8:34 AM, Nathan Jahnke wrote: > hi all, > > having some memory leak issues with my app and spi_exec_prepared. > checking the docs: > > "Normally, spi_fetchrow should be repeated until it returns undef, > indicating that there are no more rows to read. The cursor is > automat

Re: [GENERAL] build array of composites in SPI

2009-11-17 Thread Merlin Moncure
On Tue, Nov 17, 2009 at 1:07 PM, Tom Lane wrote: > Merlin Moncure writes: >> 2) build the composite via: >>   2a) TupleDescGetAttInMetadata >>   2b) BuildTupleFromCStrings >>   2c) get datum/HeapTupleGetDatum > > If it's performance critical, you might want to avoid the extra overhead > of the At

Re: [GENERAL] build array of composites in SPI

2009-11-17 Thread Tom Lane
Merlin Moncure writes: > right...makes sense. converted. one last question: can you save off > the blessed TupleDesc (that is, make it static) between invocations of > the function (I'm not worried about it changing)? You could probably get away with copying it into some long-term memory contex

[GENERAL] Postgresql Database Lock Problem

2009-11-17 Thread shohorab hossain
Problem: Database Lock -- Dear all I am working as a database administrator in a company. Our Database system is Postgresql-8.3.5 and Application server is Jboss used for our Adempiere ERP system. This is a web based ERP system. All servers are running on RHE

Re: [GENERAL] [ADMIN] Postgresql Database Lock Problem

2009-11-17 Thread Plugge, Joe R.
Can you provide the layout of your table and all indexes that are present on said table? Sounds like a incorrectly indexed table possibly. -Original Message- From: pgsql-admin-ow...@postgresql.org [mailto:pgsql-admin-ow...@postgresql.org] On Behalf Of shohorab hossain Sent: Tuesday, Nov

[GENERAL] does encrypt function support higher than basic ascii?

2009-11-17 Thread Naoko Reeves
Hello, I have the following statement and accent e doesn't seems to be decrypted correctly. select decrypt(encrypt('aéiou','foo','aes'),'foo','aes') Could you tell me if there is an option for encoding or this function only encrypt basic ascii? Thank you very much for your time in advance.

Re: [GENERAL] Postgresql Database Lock Problem

2009-11-17 Thread Tom Lane
[ cc's trimmed a bit ] shohorab hossain writes: > LOG: process 19181 still waiting for ShareLock on transaction 18025221 > after 1002.251 ms > STATEMENT: SELECT CurrentNext, CurrentNextSys, IncrementNo, Prefix, Suffix, > DecimalPattern, AD_Sequence_ID FROM AD_Sequence WHERE Name = $1 AND > AD_Cl

Re: [GENERAL] build array of composites in SPI

2009-11-17 Thread Merlin Moncure
On Tue, Nov 17, 2009 at 2:19 PM, Tom Lane wrote: > Merlin Moncure writes: >> right...makes sense.  converted.  one last question: can you save off >> the blessed TupleDesc (that is, make it static) between invocations of >> the function (I'm not worried about it changing)? > > You could probably

Re: [GENERAL] does encrypt function support higher than basic ascii?

2009-11-17 Thread Richard Huxton
Naoko Reeves wrote: > Hello, > > I have the following statement and accent e doesn't seems to be > decrypted correctly. > > select decrypt(encrypt('aéiou','foo','aes'),'foo','aes') > > Could you tell me if there is an option for encoding or this function > only encrypt basic ascii? They take by

Re: [GENERAL] does encrypt function support higher than basic ascii?

2009-11-17 Thread Naoko Reeves
I have tried: select decrypt(encrypt((select convert('aéiou','UTF8', 'LATIN1')),'foo','aes'),'foo','aes') select decrypt(encrypt((select convert('aéiou','UNICODE', 'LATIN1')),'foo','aes'),'foo','aes') select decrypt(encrypt((select convert('aéiou','LATIN1', 'LATIN1')),'foo','aes'),'foo','aes')

Re: [GENERAL] Corrupt indices on already-dropped table (could not open relation with OID ...)

2009-11-17 Thread Craig de Stigter
> What PG version is this exactly? Do you have any idea how you got into > this state? > Using PostgreSQL 8.3.7-0ubuntu8.10.1 from the Intrepid repository. version() is PostgreSQL 8.3.7 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Ubuntu 4.3.2-1ubuntu11) 4.3.2 No database crashes or syst

Re: [GENERAL] Postgresql Database Lock Problem

2009-11-17 Thread Scott Marlowe
Next time this is happening join the pg_lock table to the pg_stat_activity table to see which query is holding the lock for a bazillion milliseconds, while it's happening. That query / statement may give you some clue what's wrong. -- Sent via pgsql-general mailing list (pgsql-general@postgresql

Re: [GENERAL] does encrypt function support higher than basic ascii?

2009-11-17 Thread Naoko Reeves
Sorry, as Richard said the issue was me not converting bytea to text. The blow did it . thank you! SELECT convert_from((select decrypt(encrypt((select convert('aéiou','LATIN1', 'LATIN1')),'foo','aes'),'foo','aes')),'UNICODE') -Original Message- From: pgsql-general-ow...@postgresql.org

Re: [GENERAL] does encrypt function support higher than basic ascii?

2009-11-17 Thread Richard Huxton
Naoko Reeves wrote: > Sorry, as Richard said the issue was me not converting bytea to text. The > blow did it . thank you! > > SELECT convert_from((select decrypt(encrypt((select convert('aéiou','LATIN1', > 'LATIN1')),'foo','aes'),'foo','aes')),'UNICODE') I'm surprised you can't just do: SELEC

Re: [GENERAL] does encrypt function support higher than basic ascii?

2009-11-17 Thread Naoko Reeves
I see that's how you cast...Yes that worked PERFECTLY. I am always learning something new from the list. Thank you VERY much! -Original Message- From: Richard Huxton [mailto:d...@archonet.com] Sent: Tuesday, November 17, 2009 2:07 PM To: Naoko Reeves Cc: pgsql-general@postgresql.org Subj

[GENERAL] Error when creating table with boolean data type

2009-11-17 Thread William Carithers
I get an "Error: relation "boolean" does not exist when attempting to create a table with columns of data type boolean. I using PostgreSQL 8.3.6 and the docs say that it supports boolean data type and even show some create table examples similar to mine. Sorry for such a newbie question but it's s

Re: [GENERAL] Error when creating table with boolean data type

2009-11-17 Thread William Carithers
OK, found it. I was trying to name a column with a keyword ('like'). The error message threw me off. Sorry for the spam. Bill On 11/17/09 4:04 PM, "William Carithers" wrote: > I get an "Error: relation "boolean" does not exist when attempting to create > a table with columns of data type boole

Re: [GENERAL] Error when creating table with boolean data type

2009-11-17 Thread APseudoUtopia
On Tue, Nov 17, 2009 at 7:15 PM, William Carithers wrote: > On 11/17/09 4:04 PM, "William Carithers" wrote: > >> I get an "Error: relation "boolean" does not exist when attempting to create >> a table with columns of data type boolean. I using PostgreSQL 8.3.6 and the >> docs say that it supports

Re: [GENERAL] Can anyone help setting up pgbouncer?

2009-11-17 Thread Nick
On Nov 17, 3:38 am, d...@archonet.com (Richard Huxton) wrote: > Nick wrote: > > Thanks Richard, I updated my users.txt file to include quotes (it > > didn't) which fixed the broken auth file error, but now im getting > > this... > > > 1518 ERROR unconfigured_file: No such file or directory > > > wh

Re: [GENERAL] Experience with many schemas vs many databases

2009-11-17 Thread Loyal
On Nov 15, 3:45 pm, lovetodrinkpe...@gmail.com (undisclosed user) wrote: > The app is very similar to wordpress MU. Each user has the same schema but > different data. > > 4. Ability to backup per user > > Backing up data by user is required for my solution. A lot of times, users > screw up and t

[GENERAL] cast record to array in plpgsql

2009-11-17 Thread Kurt
dear list, i'm trying to implement a general logging scheme with a plpgsql-trigger. The idea is, that after an update the trigger compares the elements of OLD and NEW and logs the changes made to the record columns. the trigger should be usable by any table, so the field names are not known before

Re: [GENERAL] Can anyone help setting up pgbouncer?

2009-11-17 Thread Nick
Richard, you are correct. I was missing the [] headings. Someone sent me a sample file which didn't have them so I didnt think they were necessary. I now get... 2009-11-17 12:00:35.809 19575 LOG File descriptor limit: 1024 (H: 1024), max_client_conn: 100, max fds possible: 130 So now the only ste

[GENERAL] Data Directory size increasing abnormally

2009-11-17 Thread utsav
Dear All, I am using postgres 7.3 version on RHEL 4.0. I have a table pdbsynchtable with the following structure caption varchar(1020) NOT NULL, uid varchar(255) NOT NULL, destination varchar(1020) NOT NULL, commanddata text NOT NULL, command varchar(50) NOT NULL, transactionid va

Re: [GENERAL] Postgres Clustering Options

2009-11-17 Thread David Kerr
On Thu, Nov 12, 2009 at 07:32:24PM -0900, Joshua J. Kugler wrote: - On Wednesday 11 November 2009, David Kerr said something like: - > I'm trying to meet a very high uptime requirement in a high - > performance environment. - - If you don't mind Xen, have you considered: - - http://dsg.cs.ubc.ca/

Re: [GENERAL] Data Directory size increasing abnormally

2009-11-17 Thread John R Pierce
utsav wrote: The commanddata field consists of binary data of a txt file whose size is between 1kb to 4kb and there is a high frequecy of updates on this table (approx twice in a sec) A strange behaviour is observerd in the physical files with respect to this table. The size of the file is gr

Re: [GENERAL] Data Directory size increasing abnormally

2009-11-17 Thread Scott Marlowe
Note that with pgsql, the older the version you're running, the greater your pgsql-fu must be to keep it happy. With autovacuum and more efficient vacuuming all around in later versions, your simple first step is to upgrade to 8.4.1 or 8.3.8 as soon as possible. Until then, dump / reload that tab

Re: [GENERAL] Data Directory size increasing abnormally

2009-11-17 Thread Reid Thompson
utsav wrote: Dear All, I am using postgres 7.3 version on RHEL 4.0. You should upgrade to a newer/the latest stable release The commanddata field consists of binary data of a txt file whose size is between 1kb to 4kb and there is a high frequecy of updates on this table (approx twice in a

[GENERAL] Where do you store key for encryption

2009-11-17 Thread Naoko Reeves
Hi, We have web application and encrypt PII columns. We use encrypt/decrypt function for this. Currently we hard coded the key in postgresql function which I am not sure of it. I did google it and people suggest that it needed to be stored in physically isolated location (storing decryption key

Re: [GENERAL] Error when creating table with boolean data type

2009-11-17 Thread Tom Lane
William Carithers writes: > OK, found it. I was trying to name a column with a keyword ('like'). The > error message threw me off. Sorry for the spam. FWIW, 8.4 and up will give you an error cursor on this: ERROR: relation "boolean" does not exist LINE 14: like boolean, ^ which

Re: [GENERAL] Where do you store key for encryption

2009-11-17 Thread Merlin Moncure
On Tue, Nov 17, 2009 at 10:12 PM, Naoko Reeves wrote: > Hi, > > We have web application and encrypt PII columns. We use encrypt/decrypt > function for this. > > Currently we hard coded the key in postgresql function which I am not sure > of it. > > I did google it and people suggest that it needed

Re: [GENERAL] Where do you store key for encryption

2009-11-17 Thread Naoko Reeves
Got it. Thank you very much for your advice. -Original Message- From: Merlin Moncure [mailto:mmonc...@gmail.com] Sent: Tuesday, November 17, 2009 8:54 PM To: Naoko Reeves Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Where do you store key for encryption On Tue, Nov 17, 2009 a

Re: [GENERAL] passing parameters to multiple statements

2009-11-17 Thread David Fetter
On Tue, Nov 17, 2009 at 09:33:05AM -0700, Konstantin Izmailov wrote: > Some companies have policy to stay DB agnostic, i.e. use standard > SQL only. That's called shooting yourself in the head. Unless you have a very, very specific, business-critical reason to pay this huge cost, you should never

Re: [GENERAL] Where do you store key for encryption

2009-11-17 Thread David Wall
In our open-esignforms project we use a layered approach for keys in which we have a boot key for the application that requires dual passwords which we then combine into a single password for PBE encryption of the boot key. We then have session keys that are encrypted with the boot key, and th

Re: [GENERAL] cast record to array in plpgsql

2009-11-17 Thread Pavel Stehule
2009/11/17 Kurt : > dear list, > > i'm trying to implement a general logging scheme with a plpgsql-trigger. > The idea is, that after an update the trigger compares the elements of > OLD and NEW and logs the changes made to the record columns. the trigger > should be usable by any table, so the fie