[GENERAL] What filesystem to use for postgres?

2010-09-14 Thread A B
Hello. Is there any doc or wiki page that describes what filesystems that are recomended to use (OS is Linux) for PostgreSQL? Information about filesystems options/mount options and how well they work with different RAID setups is also of interest. -- Sent via pgsql-general mailing list

[GENERAL] Replacing characters in a string

2010-09-14 Thread Luís de Sousa
Hello everyone, I need to replace all occurrences of a certain character in a string. For that I'm using regexp_replace, but so far I only managed to replace the first character, here's an example: SELECT regexp_replace('xaxx', 'x', 'e'); regexp_replace eaxx (1 row) But the

Re: [GENERAL] Replacing characters in a string

2010-09-14 Thread Sergey Konoplev
2010/9/14 Luís de Sousa luis.a.de.so...@gmail.com: SELECT regexp_replace('xaxx', 'x', 'e');  regexp_replace  eaxx (1 row) But the result I'd need is 'eaee'. How can I do it? Just specify 'g' as the flags parameter (the 4th one). It means 'globally'. SELECT

Re: [GENERAL] Replacing characters in a string

2010-09-14 Thread Michele Petrazzo - Unipex
Luís de Sousa ha scritto: Hello everyone, I need to replace all occurrences of a certain character in a string. For that I'm using regexp_replace, but so far I only managed to replace the first character, here's an example: SELECT regexp_replace('xaxx', 'x', 'e'); regexp_replace

Re: [GENERAL] What filesystem to use for postgres?

2010-09-14 Thread Bill Moran
In response to A B gentosa...@gmail.com: Hello. Is there any doc or wiki page that describes what filesystems that are recomended to use (OS is Linux) for PostgreSQL? Information about filesystems options/mount options and how well they work with different RAID setups is also of

Re: [GENERAL] What filesystem to use for postgres?

2010-09-14 Thread Aaron
Some more current numbers can be found here: http://wiki.postgresql.org/wiki/HP_ProLiant_DL380_G5_Tuning_Guide Aaron Thul http://www.chasingnuts.com On Tue, Sep 14, 2010 at 4:00 AM, A B gentosa...@gmail.com wrote: Hello. Is there any doc or wiki page that describes what filesystems that

[GENERAL] Int to Interval conversion

2010-09-14 Thread Howard Cole
Hi everyone, I have a table with a duration field, stored as an Integer. How can I retrieve this from the table as an Interval type? E.g. create table test (test_id serial primary key, time_in_minutes int); insert into test values (1440); Now how do I extract that as 24:00:00::interval in

Re: [GENERAL] Int to Interval conversion

2010-09-14 Thread Bill Moran
In response to Howard Cole howardn...@selestial.com: I have a table with a duration field, stored as an Integer. How can I retrieve this from the table as an Interval type? E.g. create table test (test_id serial primary key, time_in_minutes int); insert into test values (1440); Now

Re: [GENERAL] Int to Interval conversion

2010-09-14 Thread Szymon Guz
On 14 September 2010 13:57, Howard Cole howardn...@selestial.com wrote: Hi everyone, I have a table with a duration field, stored as an Integer. How can I retrieve this from the table as an Interval type? E.g. create table test (test_id serial primary key, time_in_minutes int); insert

Re: [GENERAL] Int to Interval conversion

2010-09-14 Thread Adrian Klaver
On Tuesday 14 September 2010 4:57:46 am Howard Cole wrote: Hi everyone, I have a table with a duration field, stored as an Integer. How can I retrieve this from the table as an Interval type? E.g. create table test (test_id serial primary key, time_in_minutes int); insert into test

Re: [GENERAL] What filesystem to use for postgres?

2010-09-14 Thread Matthieu HUIN
Greetings, This wiki entry might be of interest to you: http://wiki.postgresql.org/wiki/HP_ProLiant_DL380_G5_Tuning_Guide I don't know how up to date these benchmarks are though. Matthieu Huin Le mardi 14 septembre 2010 à 08:35 -0400, Bill Moran a écrit : In response to A B

Re: [GENERAL] Int to Interval conversion

2010-09-14 Thread Michael Glaesemann
On Sep 14, 2010, at 7:57 , Howard Cole wrote: create table test (test_id serial primary key, time_in_minutes int); insert into test values (1440); Now how do I extract that as 24:00:00::interval in a query? test=# SELECT 1440 * INTERVAL '1 minute'; ?column? -- 24:00:00 (1 row)

Re: [GENERAL] Monitoring Object access

2010-09-14 Thread adi hirschtein
I'd like to look at it from the object level and see how much I/O is being done on specific table or index and then check which sessions are responsible for that. also, what's the catalog table you would recommend me to use if I want to see I/O activity on an object regardless of the session? On

Re: [GENERAL] Replacing characters in a string

2010-09-14 Thread Pavel Stehule
Hello 2010/9/14 Luís de Sousa luis.a.de.so...@gmail.com: Hello everyone, I need to replace all occurrences of a certain character in a string. For that I'm using regexp_replace, but so far I only managed to replace the first character, here's an example: SELECT regexp_replace('xaxx', 'x',

Re: [GENERAL] Replacing characters in a string

2010-09-14 Thread Thom Brown
2010/9/14 Luís de Sousa luis.a.de.so...@gmail.com: Hello everyone, I need to replace all occurrences of a certain character in a string. For that I'm using regexp_replace, but so far I only managed to replace the first character, here's an example: SELECT regexp_replace('xaxx', 'x', 'e');  

Re: [GENERAL] Replacing characters in a string

2010-09-14 Thread Szymon Guz
2010/9/14 Luís de Sousa luis.a.de.so...@gmail.com Hello everyone, I need to replace all occurrences of a certain character in a string. For that I'm using regexp_replace, but so far I only managed to replace the first character, here's an example: SELECT regexp_replace('xaxx', 'x', 'e');

Re: [GENERAL] Replacing characters in a string

2010-09-14 Thread Luís de Sousa
Thank you for all the answers, several ways this can be made. Luís -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Monitoring Object access

2010-09-14 Thread tv
I'd like to look at it from the object level and see how much I/O is being done on specific table or index and then check which sessions are responsible for that. also, what's the catalog table you would recommend me to use if I want to see I/O activity on an object regardless of the

Re: [GENERAL] Monitoring Object access

2010-09-14 Thread Satoshi Nagayasu
On 2010/09/12 23:02, adi hirschtein wrote: I'm coming from the Oracle side of the house and In oracle for instance, you use shared buffer as well, but you are still able to see which session is waiting for which blocks and if one session is doing the real I/O then the other one wait on 'wait

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-14 Thread Carlos Mennens
On Mon, Sep 13, 2010 at 9:58 PM, Craig Ringer cr...@postnewspapers.com.au wrote: craig$ sudo -u postgres psql postgres= CREATE USER craig WITH PASSWORD 'somepassword'           CREATEDB CREATEROLE; postgres= CREATE DATABASE craig WITH OWNER craig; postgres= \q So I set a Linux shell password

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-14 Thread Alan Hodgson
On September 14, 2010 09:50:30 am Carlos Mennens wrote: Obviously there appears to be a specific password for both accounts which I think are completely seperate from the Linux shell passwords, right? PostgreSQL has internal passwords for roles which can be set with alter role or while

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-14 Thread Richard Broersma
On Tue, Sep 14, 2010 at 9:50 AM, Carlos Mennens carlos.menn...@gmail.com wrote: Secondly I am unable to find any information in the docs that show me how to set just the user password for 'carlos'. In MySQL I would use: SET PASSWORD FOR 'carlos'@'localhost' = PASSWORD('newpass'); You'd want

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-14 Thread Carlos Mennens
On Tue, Sep 14, 2010 at 1:52 PM, Richard Broersma richard.broer...@gmail.com You'd want to use ALTER USER http://www.postgresql.org/docs/8.4/interactive/sql-alteruser.html So: ALTER USER carlos WITH ENCRYPTED PASSWORD 'password'; I find it strange when I am logged in as super user

[GENERAL] Identify Login User Permissions

2010-09-14 Thread Carlos Mennens
I can't find in the docs or using Google how one can identify which user is currently logged in to psql. I search for the command that if for some reason I forget which user I am logged in as, rather than logging out of PostgreSQL, there has to be a command that shows me who I am and also what

Re: [GENERAL] Identify Login User Permissions

2010-09-14 Thread Guillaume Lelarge
Le 14/09/2010 22:01, Carlos Mennens a écrit : I can't find in the docs or using Google how one can identify which user is currently logged in to psql. I search for the command that if for some reason I forget which user I am logged in as, rather than logging out of PostgreSQL, there has to be

Re: [GENERAL] Identify Login User Permissions

2010-09-14 Thread Richard Broersma
On Tue, Sep 14, 2010 at 1:01 PM, Carlos Mennens carlos.menn...@gmail.com wrote: I can't find in the docs or using Google how one can identify which user is currently logged in to psql. I search for the command that if for some reason I forget which user I am logged in as, rather than logging

Re: [GENERAL] Identify Login User Permissions

2010-09-14 Thread Carlos Mennens
On Tue, Sep 14, 2010 at 4:23 PM, Guillaume Lelarge guilla...@lelarge.info wrote: SELECT current_user; Thanks. That worked well: postgres=# SELECT current_user; current_user -- carlos (1 row) Do you know how I can verify what privileges or permissions 'carlos' has granted to him

Re: [GENERAL] I keep getting type does not exist on compile of this SETOF function (list 2 table)

2010-09-14 Thread Jonathan Brinkman
Thanks, yes the schema was missing from the DECLARE rs statement! -Original Message- From: Merlin Moncure [mailto:mmonc...@gmail.com] Sent: Monday, September 13, 2010 1:35 PM To: Jonathan Brinkman Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] I keep getting type does not exist

Re: [GENERAL] Identify Login User Permissions

2010-09-14 Thread Richard Broersma
On Tue, Sep 14, 2010 at 1:28 PM, Carlos Mennens carlos.menn...@gmail.com wrote: Do you know how I can verify what privileges or permissions 'carlos' has granted to him in PostgreSQL? psql has its own commands. for example if i was to see the owner of all: users: db= \du schemas: db= \dn

Re: [GENERAL] Identify Login User Permissions

2010-09-14 Thread Guillaume Lelarge
Le 14/09/2010 22:28, Carlos Mennens a écrit : On Tue, Sep 14, 2010 at 4:23 PM, Guillaume Lelarge guilla...@lelarge.info wrote: SELECT current_user; Thanks. That worked well: postgres=# SELECT current_user; current_user -- carlos (1 row) Do you know how I can verify

[GENERAL] workaround steps for autovaccum problem

2010-09-14 Thread tamanna madaan
Hi All I am using postgres-8.1.2. I am getting the following error while autovacuum. 2010-08-18 18:36:14 UTC LOG: autovacuum: processing database template0 2010-08-18 18:36:14 UTC ERROR: could not access status of transaction 3222599682 2010-08-18 18:36:14 UTC DETAIL: could not open file

Re: [GENERAL] workaround steps for autovaccum problem

2010-09-14 Thread David Fetter
On Wed, Sep 15, 2010 at 02:39:26AM +0530, tamanna madaan wrote: Hi All I am using postgres-8.1.2. I am getting the following error while autovacuum. Please upgrade your software to PostgreSQL 8.1.21 and try again. Cheers, David. -- David Fetter da...@fetter.org http://fetter.org/

[GENERAL] Extracting data from BYTEA column to binary file using libpq

2010-09-14 Thread Julia Jacobson
Hello everybody out there using PostgreSQL, What is the problem with the following C++ code for the extraction of data from a BYTEA column to a binary file? #include stdlib.h #include stdio.h #include iostream #include fstream #include libpq-fe.h using namespace std; main () { PGconn

[GENERAL] pgpool-II 3.0 + postgres 9rc1 + md5 authentication not working

2010-09-14 Thread Bryan Murphy
I can't get md5 authentication working with postgres 9rc1 and pgpool-II 3.0. I see references to pool_passwd in the pgpool documentation, but I see nothing indicating *where* this file should exist and how pgpool finds it. I've set my accounts up in pcp.conf, however, I do not believe this is

[GENERAL] select sql slow inside function

2010-09-14 Thread Gary Fu
Hi, I have a function proc_TaskComplete that inserts a record to table TaskHistory and then calls another function proc_ExportTaskComplete, that will retrieve (select) the record just inserted based on an index column (TaskId) in that table TaskHistory. I noticed that the select sql (inside

Re: [GENERAL] Extracting data from BYTEA column to binary file using libpq

2010-09-14 Thread Daniel Verite
Julia Jacobson wrote: ofstream myFile (picture.jpg, ios::out | ios::binary); myFile.write (contents); You must specify the number of bytes to write. Best regards, -- Daniel PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org -- Sent via pgsql-general

Re: [GENERAL] pgpool-II 3.0 + postgres 9rc1 + md5 authentication not working

2010-09-14 Thread Tatsuo Ishii
I can't get md5 authentication working with postgres 9rc1 and pgpool-II 3.0. I see references to pool_passwd in the pgpool documentation, but I see nothing indicating *where* this file should exist and how pgpool finds it. I've set my accounts up in pcp.conf, however, I do not believe this

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-14 Thread Craig Ringer
On 15/09/2010 12:50 AM, Carlos Mennens wrote: On Mon, Sep 13, 2010 at 9:58 PM, Craig Ringer cr...@postnewspapers.com.au wrote: craig$ sudo -u postgres psql postgres= CREATE USER craig WITH PASSWORD 'somepassword' CREATEDB CREATEROLE; postgres= CREATE DATABASE craig WITH OWNER

Re: [GENERAL] workaround steps for autovaccum problem

2010-09-14 Thread David Fetter
On Wed, Sep 15, 2010 at 05:30:51AM +0530, tamanna madaan wrote: I know upgrading postgres will resolve the problem permanently . But I wanted some workaround for now before I actually upgrade. I want a pony, but I'm not getting one. Upgrade PostgreSQL :) Cheers, David. -- David Fetter

Re: [GENERAL] workaround steps for autovaccum problem

2010-09-14 Thread tamanna madaan
I know upgrading postgres will resolve the problem permanently . But I wanted some workaround for now before I actually upgrade. But let me know if I really need to execute `vacuum freeze` In the scenario given in my previous update or I can skip this step. For your reference I am again updating

Re: [GENERAL] workaround steps for autovaccum problem

2010-09-14 Thread Bruce Momjian
If you are not willing to do a minor upgrade, it is unlikely many people are going to be willing to take the time to entertain your questions. --- tamanna madaan wrote: I know upgrading postgres will resolve the problem

Re: [GENERAL] workaround steps for autovaccum problem

2010-09-14 Thread Joshua D. Drake
On Tue, 2010-09-14 at 17:01 -0700, David Fetter wrote: On Wed, Sep 15, 2010 at 05:30:51AM +0530, tamanna madaan wrote: I know upgrading postgres will resolve the problem permanently . But I wanted some workaround for now before I actually upgrade. I want a pony, but I'm not getting one.

Re: [GENERAL] Extracting data from BYTEA column to binary file using libpq

2010-09-14 Thread Diego Schulz
On Tue, Sep 14, 2010 at 6:01 PM, Julia Jacobson julia.jacob...@arcor.de wrote: Hello everybody out there using PostgreSQL, What is the problem with the following C++ code for the extraction of data from a BYTEA column to a binary file? #include stdlib.h #include stdio.h #include iostream

[GENERAL] Search then Delete Performance

2010-09-14 Thread Michael Hull
Hi Everyone, I am fairly new to practical databases, but I am trying out the c interface to postgres and am wondering how to improve performance. I am a researcher, and I am trying to perform a large parameter sweep. Since this will involve a couple of thousand simulations, I have a process that

Re: [GENERAL] workaround steps for autovaccum problem

2010-09-14 Thread Scott Marlowe
On Tue, Sep 14, 2010 at 6:00 PM, tamanna madaan tamanna.ma...@globallogic.com wrote: I know upgrading postgres will resolve the problem permanently . But I wanted some workaround for now before I actually upgrade. But let me know if I really need to execute `vacuum freeze` In the scenario

Re: [GENERAL] Search then Delete Performance

2010-09-14 Thread Arjen Nienhuis
Hi, It's probably slow because you run many queries where a few would work: DELETE FROM unassignedjobs WHERE jobid IN (6, 8 ,2, 99, 66) But I wouldn't know how to build a query like that in C. A script in python or even bash that dit it would be faster than your C implementation. What you can

Re: [GENERAL] Search then Delete Performance

2010-09-14 Thread Tom Lane
Michael Hull mikehul...@googlemail.com writes: I am fairly new to practical databases, but I am trying out the c interface to postgres and am wondering how to improve performance. I am a researcher, and I am trying to perform a large parameter sweep. Since this will involve a couple of

Re: [GENERAL] Search then Delete Performance

2010-09-14 Thread John R Pierce
On 09/14/10 5:55 PM, Michael Hull wrote: So fairly simply, I have a daemon running on a machine, which accesses this DB. Clients connect and request the details for say 1000 simulations, at which point the daemon takes 1000 entries from the unassigned table and moves them to the assigned table.

Re: [GENERAL] Search then Delete Performance

2010-09-14 Thread Dann Corbit
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- ow...@postgresql.org] On Behalf Of John R Pierce Sent: Tuesday, September 14, 2010 8:41 PM To: Michael Hull Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Search then Delete Performance