Re: [GENERAL] How to convert numbers into words in postgresql

2013-05-15 Thread Albe Laurenz
Jashaswee wrote: > i want to convert numbers into words in postgresql.is there any query for it? > if yes please reply soon I found two solutions in the Wiki: http://wiki.postgresql.org/wiki/Integer_to_Text http://wiki.postgresql.org/wiki/Numeric_to_English Yours, Laurenz Albe -- Sent via pgsq

[GENERAL] pg_basebackup -R option in PG 9.3 beta

2013-05-15 Thread Raghavendra
Hi, While trying new features of Pg 9.3 beta, my eyes caught on pg_basebackup -R option so I have given a try but somehow I didn't succeed it to work... -bash-4.1$ ./pg_basebackup --version pg_basebackup (PostgreSQL) 9.3beta1 -bash-4.1$ ./pg_basebackup -h localhost -D ../data_bkp -p -U post

Re: [GENERAL] pg_basebackup -R option in PG 9.3 beta

2013-05-15 Thread Hari Babu
On Wednesday, May 15, 2013 2:50 PM Raghavendra wrote: >Hi, > >While trying new features of Pg 9.3 beta, my eyes caught on pg_basebackup -R option so I have given a try but somehow I didn't succeed it to work... > >-bash-4.1$ ./pg_basebackup --version >pg_basebackup (PostgreSQL) 9.3beta1 >

Re: [GENERAL] Storing Special Characters

2013-05-15 Thread Rebecca Clarke
Thanks everyone for your help. I changed the encoding as directed on the PHP documentation provided by Leif to LATIN1 instead of the UTF-8. This resolved the issue and the records with £ and é inserted into the database without complaint. On Tue, May 14, 2013 at 11:36 PM, CR Lender wrote: > O

Re: [GENERAL] pg_basebackup -R option in PG 9.3 beta

2013-05-15 Thread Raghavendra
On Wed, May 15, 2013 at 3:18 PM, Hari Babu wrote: > On Wednesday, May 15, 2013 2:50 PM Raghavendra wrote: > > >Hi, > > >** ** > > >While trying new features of Pg 9.3 beta, my eyes caught on > pg_basebackup -R option so I have given a try but somehow I didn't succeed > it to work... >

[GENERAL] volatile void returning function not executed as often as expected in sql function

2013-05-15 Thread Ingmar Brouns
Hi, I have a volatile void returning function that I call in the SELECT clause of a query. When I execute the query, the function is called for every row in the result, this is also what I expect. However, if I embed that same query in an sql function and then call that function it gets executed o

[GENERAL] Re: volatile void returning function not executed as often as expected in sql function

2013-05-15 Thread Ingmar Brouns
When I send the mail, I saw it, the problem is that the function should return setof void instead of void, then it works, sorry for bothering. pv=# --increase every a in foo by 1, but now in function create or replace function foofunc2() returns setof void as $func$ select foofunc(a) from foo

Re: [GENERAL] pg_basebackup -R option in PG 9.3 beta

2013-05-15 Thread Hari Babu
>on Wednesday, May 15, 2013 4:04 PM Raghavendra wrote: >In earlier version of primary connection information was enclosed within one single quote: >primary_conninfo = 'user=postgres host=localhost port=5432' > >But, the file created with -R option (recovery.conf) has doubled the single quotes

Re: [GENERAL] pg_basebackup -R option in PG 9.3 beta

2013-05-15 Thread Raghavendra
On Wed, May 15, 2013 at 4:26 PM, Hari Babu wrote: > >on Wednesday, May 15, 2013 4:04 PM Raghavendra wrote: > > >In earlier version of primary connection information was enclosed within > one single quote: > > >primary_conninfo = 'user=postgres host=localhost port=5432' > > >** ** > > >

Re: [GENERAL] Large amount of serialization errors in transactions

2013-05-15 Thread Kevin Grittner
Vegard Bønes wrote: > I tried increasing max_pred_locks_per_transaction by a factor 20, > and that seems to have helped. Good to know.  After I sent my response I was hoping you wouldn't take it to imply that increating it by a factor of 10 was necessarily the useful maximum.  It depends mostly

Re: [GENERAL] FATAL: database "a/system_data" does not exist

2013-05-15 Thread sumita
The database name is "a" and the "system_data" appears within the Schemas. When I list the database from psql, I get following report Name| Owner | Encoding | Collate |Ctype| Access privileg es ---+--+--+-+-+-- -

Re: [GENERAL] dblink does not resolve DNS, but works with IP

2013-05-15 Thread Tom Lane
Mike Christensen writes: > Though I'm a bit curious why there's a host and hostaddr. Why can't it > just resolve whatever you give it? Well, it will ... if you use the "host" parameter. The whole point of "hostaddr" is that for that parameter, it will not try a DNS lookup. You'd only use that i

Re: [GENERAL] FATAL: database "a/system_data" does not exist

2013-05-15 Thread Adrian Klaver
On 05/15/2013 05:45 AM, sumita wrote: The database name is "a" and the "system_data" appears within the Schemas. When I list the database from psql, I get following report Name| Owner | Encoding | Collate |Ctype| Access privileg es ---+--+--+---

[GENERAL] seeming overflow during avg() of intervals without errors/warnings

2013-05-15 Thread Vick Khera
I'm attempting to compute an average age of some records based on a create_date field. The simple query of select avg(now() - user_created) from user_list where owner_id = 1 and user_status = 'active'; returns nonsense: -487 days -06:46:14.61501 The minimum user_created value is '2006-06-05 09:

Re: [GENERAL] FATAL: database "a/system_data" does not exist

2013-05-15 Thread Tom Lane
Adrian Klaver writes: > On 05/15/2013 05:45 AM, sumita wrote: >> Also,so far I have unable to find out which process is invoking this query. >> I do see the process id in the logs but I am unable to see this process id >> in pg_stat_activity table.. > Actually a\system_data is not part of a quer

Re: [GENERAL] dblink does not resolve DNS, but works with IP

2013-05-15 Thread Mike Christensen
Ah, gotcha! I guess whatever sample I was originally copying from used hostaddr for some reason.. Thanks for the clarification, Tom! On Wed, May 15, 2013 at 6:08 AM, Tom Lane wrote: > Mike Christensen writes: > > Though I'm a bit curious why there's a host and hostaddr. Why can't it > > jus

Re: [GENERAL] Re: volatile void returning function not executed as often as expected in sql function

2013-05-15 Thread Merlin Moncure
On Wed, May 15, 2013 at 5:44 AM, Ingmar Brouns wrote: > When I send the mail, I saw it, the problem is that the function > should return setof void instead of void, then it works, sorry for > bothering. for non-trivial sql language processing functions I tend to return an error code or string ind

Re: [GENERAL] seeming overflow during avg() of intervals without errors/warnings

2013-05-15 Thread Tom Lane
Vick Khera writes: > So basically, it seems like however avg() on intervals is being computed it > is overflowing somewhere without warning. Hmmm ... yeah, it looks like interval_pl is missing any overflow check: regression=# select '2147483648 days'::interval; ERROR: interval field value out o

[GENERAL] Best way to reduce server rounds getting big BLOBs

2013-05-15 Thread Jorge Arévalo
Hello, I'd like to know what's the best way to reduce the number of server rounds in a libpq C app that fetches BLOBs from a remote PostgreSQL server. About 75% of the time my app uses is spent querying database. I basically get binary objects (images). I have to fetch all the images from a tab

Re: [GENERAL] How to convert numbers into words in postgresql

2013-05-15 Thread Jashaswee
thnx for your help albe. i went through this code its working fine . -- View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-convert-numbers-into-words-in-postgresql-tp5755370p578.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent

[GENERAL] volatile void returning function not executed as often as expected in sql function

2013-05-15 Thread Ingmar Brouns
I have a volatile void returning function that I call in the SELECT clause of a query. When I execute the query, the function is called for every row in the result, this is also what I expect. However, if I embed that same query in an sql function and then call that function it gets executed only o

[GENERAL] Best way to reduce server rounds getting big BLOBs

2013-05-15 Thread Jorge Arévalo
Hello, I'd like to know what's the best way to reduce the number of server rounds in a libpq C app that fetches BLOBs from a remote PostgreSQL server. About 75% of the time my app uses is spent querying database. I basically get binary objects (images). I have to fetch all the images from a ta

Re: [GENERAL] Best way to reduce server rounds getting big BLOBs

2013-05-15 Thread Merlin Moncure
On Wed, May 15, 2013 at 11:31 AM, Jorge Arévalo wrote: > Hello, > > I'd like to know what's the best way to reduce the number of server rounds in > a libpq C app that fetches BLOBs from a remote PostgreSQL server. > > About 75% of the time my app uses is spent querying database. I basically get

[GENERAL]

2013-05-15 Thread Carlos Henrique Reimer
Hi, Currently, our application is still using PG 8.2 and we are trying to use 9.2 but there are some problems related with the implicit casts removed on 8.3. Example: 1) select 'teste'||1; 2) select trim(1); Select 1 & 2 does run fine on 8.2 but in 9.2 select 1 is ok and select 2 got an error d

Re: [GENERAL]

2013-05-15 Thread AI Rumman
Create the functions: CREATE FUNCTION pg_catalog.text(integer) RETURNS text STRICT IMMUTABLE LANGUAGE SQL AS 'SELECT textin(int4out($1));'; CREATE CAST (integer AS text) WITH FUNCTION pg_catalog.text(integer) AS IMPLICIT; http://www.rummandba.com/2010/10/migrate-database-from-postgresql-81-to.html

Re: [GENERAL]

2013-05-15 Thread Carlos Henrique Reimer
Actually, as stated in my first note, this is what I've done to fix the select 2 (select trim(1);) but after creating this function/cast the select 1 (select 'teste'||1;) started not working. On Wed, May 15, 2013 at 4:24 PM, AI Rumman wrote: > Create the functions: > CREATE FUNCTION pg_catalog.

Re: [GENERAL]

2013-05-15 Thread AI Rumman
Ah! I missed that. Which version of 9.2 you are working with? I am also at 9.2 and its working fine. Try out using select 'teste'||1::int; See if it works or not. On Wed, May 15, 2013 at 3:41 PM, Carlos Henrique Reimer < carlos.rei...@opendb.com.br> wrote: > Actually, as stated in my first note

Re: [GENERAL]

2013-05-15 Thread Carlos Henrique Reimer
The PG version I'm using is 9.2.4. It works but after recreating the implicit cast with the function: CREATE FUNCTION pg_catalog.text(integer) RETURNS text STRICT IMMUTABLE LANGUAGE SQL AS 'SELECT textin(int4out($1));'; CREATE CAST (integer AS text) WITH FUNCTION pg_catalog.text(integer) AS IMPLI

Re: [GENERAL]

2013-05-15 Thread AI Rumman
Drop those functions and try again. On Wed, May 15, 2013 at 4:22 PM, Carlos Henrique Reimer < carlos.rei...@opendb.com.br> wrote: > The PG version I'm using is 9.2.4. > > It works but after recreating the implicit cast with the function: > > > CREATE FUNCTION pg_catalog.text(integer) RETURNS tex

Re: [GENERAL]

2013-05-15 Thread Carlos Henrique Reimer
It works if I drop the functions but then the select trim(1) does not work; On Wed, May 15, 2013 at 5:38 PM, AI Rumman wrote: > Drop those functions and try again. > > > On Wed, May 15, 2013 at 4:22 PM, Carlos Henrique Reimer < > carlos.rei...@opendb.com.br> wrote: > >> The PG version I'm using

Re: [GENERAL]

2013-05-15 Thread AI Rumman
I am using the same version and its fine. postgres=# select version(); version --- PostgreSQL 9.2.4 on x86_64-unknown-linux-gnu, compiled

Re: [GENERAL]

2013-05-15 Thread Carlos Henrique Reimer
I got the same 144 rows here. Have dropped the test database and recreated it again, then performed these SQL commands: select 'test'||1; CREATE FUNCTION pg_catalog.text(integer) RETURNS text STRICT IMMUTABLE LANGUAGE SQL AS 'SELECT textin(int4out($1));'; CREATE CAST (integer AS text) WITH FUNC

[GENERAL] Tuning read ahead

2013-05-15 Thread Ramsey Gurley
Hi all, I've just gotten into my new database server yesterday and I've started doing database setup and tuning. I'm on a Rackspace Linux server with two raid arrays. Both are ext3. One is a two disk RAID1 I plan on using for WAL and OS, the other is a four disk RAID10 I will use for the data.

[GENERAL] Creating Extension pg_trgm

2013-05-15 Thread itishree sukla
Hi all, I need to create pg_trgm extension, however in my current DB, we have some function based on pg_trgm. when i am trying to create extension, it is asking to drop all dependant function, is there anyway without dropping any dependency i can create this extension. Thanks in advance... Reg

[GENERAL] upsert functionality

2013-05-15 Thread Sajeev Mayandi
Hi, Our company is planning to move to postreSQL. We were initially using sybase where upsert functionality was available using "insert on existing update" clause. I know there multiple ways to fix this using RULE or separate function in postgresql. But I would like to know which version of p

Re: [GENERAL] upsert functionality

2013-05-15 Thread Thomas Kellerer
Sajeev Mayandi, 16.05.2013 07:01: Hi, Our company is planning to move to postreSQL. We were initially using sybase where upsert functionality was available using "insert on existing update" clause. I know there multiple ways to fix this using RULE or separate function in postgresql. But I woul