Re: [pgadmin-support] [GENERAL] Postgres DB crashing

2013-06-19 Thread bhanu udaya
Thanks for the quick response. These errors are after disabling the autovacuum. auto_vacuum parameter was set to off. Can find the exact reason for this crash. Thanks and Regards Radha Krishna Date: Tue, 18 Jun 2013 13:54:09 -0400 Subject: Re: [pgadmin-support] [GENERAL] Postgres DB crashing

[GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread sachin kotwal
While migrating my application from DB2 to PostgreSQL. I want to migrate following functions in PostgreSQL. TO_CHAR() in DB2 which can take three arguments as follows: SELECT TO_CHAR(CURRENT_DATE,'-MM-DD',112.50) FROM SYSIBM.SYSDUMMY1 I am not sure what is the purpose of third argument in T

[GENERAL] Migration from DB2 to PostgreSQL-ROLLUP()

2013-06-19 Thread sachin kotwal
While migrating my application from DB2 to PostgreSQL. I want to migrate ROLLUP() function in PostgreSQL. Example: SELECT WEEK(SALES_DATE) AS WEEK, DAYOFWEEK(SALES_DATE) AS DAY_WEEK, SUM(SALES) AS UNITS_SOLD FROM SALES GROUP BY ROLLUP ( WEEK(SALES_DATE), DAYOFWEEK(SALES_

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Albe Laurenz
sachin kotwal wrote: > While migrating my application from DB2 to PostgreSQL. > > I want to migrate following functions in PostgreSQL. > > TO_CHAR() in DB2 which can take three arguments as follows: > > SELECT TO_CHAR(CURRENT_DATE,'-MM-DD',112.50) FROM SYSIBM.SYSDUMMY1 > > I am not sure wha

Re: [GENERAL] Migration from DB2 to PostgreSQL-ROLLUP()

2013-06-19 Thread Pavel Stehule
Hello 2013/6/19 sachin kotwal : > While migrating my application from DB2 to PostgreSQL. > > I want to migrate ROLLUP() function in PostgreSQL. > > Example: > SELECT WEEK(SALES_DATE) AS WEEK, > DAYOFWEEK(SALES_DATE) AS DAY_WEEK, > SUM(SALES) AS UNITS_SOLD > FROM SALES > GRO

Re: [GENERAL] json functions

2013-06-19 Thread Merlin Moncure
On Wed, Jun 19, 2013 at 12:00 AM, Jayadevan M wrote: > Hi, > > > > I have PostgreSQL 9.2.1. I can see a few json functions under pg_catalog, > json_send, for example. But I can’t find any documentation. Am I missing > something? json_send like all send functions is internal. Not all functions av

Re: [GENERAL] pgxs question - linking c-functions to external libraries

2013-06-19 Thread Peter Eisentraut
On 6/6/13 11:49 PM, Rad Cirskis wrote: > Hi John, > have you managed to get it to link with external shared libs? Sure, many extensions to that. Do something like SHLIB_LINK += -lfoo in your Makefile. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to y

[GENERAL] postgresql query

2013-06-19 Thread Jashaswee
I have numeric values in a numeric column.the column has two parts.i want to split in 2 differnet column . The column value looks like this: Quantity 2000 -1000 both the quantity values are of a same product.but i want these in a single line. so what i want is a result set that looks like: In

Re: [GENERAL] postgresql query

2013-06-19 Thread AI Rumman
Which version of Postgresql are you using? However, you may use string_agg like below if its available in your version: \d t1 Table "public.t1" Column | Type | Modifiers +-+--- i | integer | amt| integer | select * from t1; i | amt ---+- 1 | 2

Re: [GENERAL] postgresql query

2013-06-19 Thread Victor Yegorov
2013/6/19 Jashaswee > The column value looks like this: > > Quantity > 2000 > -1000 > > both the quantity values are of a same product.but i want these in a > single > line. > so what i want is a result set that looks like: > In quantity Out quantity > --- > 2000

Re: [GENERAL] Migration from DB2 to PostgreSQL-ROLLUP()

2013-06-19 Thread Merlin Moncure
On Wed, Jun 19, 2013 at 3:56 AM, sachin kotwal wrote: > While migrating my application from DB2 to PostgreSQL. > > I want to migrate ROLLUP() function in PostgreSQL. > > Example: > SELECT WEEK(SALES_DATE) AS WEEK, > DAYOFWEEK(SALES_DATE) AS DAY_WEEK, > SUM(SALES) AS UNITS_SOLD

[GENERAL] Problem with connection

2013-06-19 Thread karen chau
Hi Folks, I'm having trouble with connection / remote connection. I'm running Postgres on Solaris 10. $ netstat -a |grep 5432 localhost.5432 *.*0 0 49152 0 LISTEN 6002ae2ee98 stream-ord 6002af1d080 /tmp/.s.PGSQL.5432 _Works fine_ $ psql -d direct

Re: [GENERAL] Problem with connection

2013-06-19 Thread Ziggy Skalski
On 13-06-19 04:13 PM, karen chau wrote: Hi Folks, I'm having trouble with connection / remote connection. I'm running Postgres on Solaris 10. $ netstat -a |grep 5432 localhost.5432 *.*0 0 49152 0 LISTEN 6002ae2ee98 stream-ord 6002af1d080 /tmp/.s.PGSQ

Re: [GENERAL] Problem with connection

2013-06-19 Thread Adrian Klaver
On 06/19/2013 01:13 PM, karen chau wrote: Hi Folks, I'm having trouble with connection / remote connection. I'm running Postgres on Solaris 10. $ netstat -a |grep 5432 localhost.5432 *.*0 0 49152 0 LISTEN 6002ae2ee98 stream-ord 6002af1d080 /tmp/.s.

Re: [GENERAL] Problem with connection

2013-06-19 Thread John R Pierce
On 6/19/2013 1:53 PM, Ziggy Skalski wrote: #listen_addresses = 'localhost'# what IP address(es) to listen on; You should have it set to localhost *and* the hostname you want to use (i.e. the phys-brmtso-2), that might be the problem I think. or better, listen_addresses = '*' # li

[GENERAL] intagg

2013-06-19 Thread Andrew Bartley
Hi All, I am trying to use the intagg extension. in 9.1.9 I have created the extension as such "CREATE EXTENSION intagg" Then tried to use the function int_array_aggregate. Returns this message function int_array_aggregate(integer[]) does not exist select int_array_aggregate(transactions) fro

Re: [GENERAL] intagg

2013-06-19 Thread Andrew Bartley
Sorry that should be aggregate int_array_aggregate not function On 20 June 2013 08:16, Andrew Bartley wrote: > Hi All, > > I am trying to use the intagg extension. in 9.1.9 > > I have created the extension as such "CREATE EXTENSION intagg" > > Then tried to use the function int_array_aggregate.

[GENERAL] Carry forward last observation

2013-06-19 Thread McGehee, Robert
Hello, I have a table with dates and stock prices. Some of the prices are NULL because the stock did not trade on that day. In such instances, I'd like to replace the NULL value with the most recent non-NULL value, but I can't find an efficient way to do this. I had thought a clever WINDOW funct

Re: [GENERAL] postgresql query

2013-06-19 Thread David Johnston
Jashaswee wrote > I have numeric values in a numeric column.the column has two parts.i want > to split in 2 differnet column . > The column value looks like this: > > Quantity > 2000 > -1000 > > both the quantity values are of a same product.but i want these in a > single line. > so what i wan

Re: [GENERAL] Carry forward last observation

2013-06-19 Thread David Johnston
McGehee, Robert wrote > Hello, > I have a table with dates and stock prices. Some of the prices are NULL > because the stock did not trade on that day. In such instances, I'd like > to replace the NULL value with the most recent non-NULL value, but I can't > find an efficient way to do this. Cann

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Amit Langote
On Wed, Jun 19, 2013 at 6:00 PM, Albe Laurenz wrote: > sachin kotwal wrote: >> While migrating my application from DB2 to PostgreSQL. >> >> I want to migrate following functions in PostgreSQL. >> >> TO_CHAR() in DB2 which can take three arguments as follows: >> >> SELECT TO_CHAR(CURRENT_DATE,'

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 11:10 AM, Amit Langote wrote: > If this particular function is to be used repeatedly in a single > query, would the cost of having a wrapper function around the original > function be too large? For example, if this function appears in a > WHERE clause against a table conta

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Amit Langote
Hi, On Thu, Jun 20, 2013 at 10:27 AM, Chris Angelico wrote: > On Thu, Jun 20, 2013 at 11:10 AM, Amit Langote > wrote: >> If this particular function is to be used repeatedly in a single >> query, would the cost of having a wrapper function around the original >> function be too large? For examp

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 11:35 AM, Amit Langote wrote: > On Thu, Jun 20, 2013 at 10:27 AM, Chris Angelico wrote: >> If your wrapper function is written in SQL and is trivial (eg ignore >> the third parameter and pass the other two on), the planner should be >> able to optimize right through it. Be

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Amit Langote
On Thu, Jun 20, 2013 at 10:54 AM, Chris Angelico wrote: > On Thu, Jun 20, 2013 at 11:35 AM, Amit Langote > wrote: >> On Thu, Jun 20, 2013 at 10:27 AM, Chris Angelico wrote: >>> If your wrapper function is written in SQL and is trivial (eg ignore >>> the third parameter and pass the other two on

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 12:09 PM, Amit Langote wrote: > Umm, my bad! I almost forgot I could write pure SQL function bodies. > Although, why does following happen? (sorry, a 8.4.2 installation) : > > postgres=# create or replace function gt(n int, m int) returns boolean > as 'select n>m' language

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Amit Langote
On Thu, Jun 20, 2013 at 11:10 AM, Chris Angelico wrote: > On Thu, Jun 20, 2013 at 12:09 PM, Amit Langote > wrote: >> Umm, my bad! I almost forgot I could write pure SQL function bodies. >> Although, why does following happen? (sorry, a 8.4.2 installation) : >> >> postgres=# create or replace fun

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 12:34 PM, Amit Langote wrote: > On Thu, Jun 20, 2013 at 11:10 AM, Chris Angelico wrote: >> On Thu, Jun 20, 2013 at 12:09 PM, Amit Langote >> wrote: >>> Umm, my bad! I almost forgot I could write pure SQL function bodies. >>> Although, why does following happen? (sorry, a

Re: [GENERAL] json functions

2013-06-19 Thread Jayadevan M
Hi, >json_send like all send functions is internal. Not all functions available in >the >catalog are exposed through SQL -- for example they may be used to serialize >data for transmission over the wire. If you can handle C you can hunt down >the location of the function to see what it does (whi

[GENERAL] variadic args to C functions

2013-06-19 Thread Alan Nilsson
Has anyone got any pointers on implementing a C function in an extension that takes variadic args? I would like to do something like: select my_function(XXX,...); where XXX will be between 1 and many integers. Possible? I didn't see any examples in the contrib directory. -- Sent via pgsq

[GENERAL] LDAP authentication timing out

2013-06-19 Thread James Sewell
Hello All, I have the following config: hostsamerole+myrole samenetldap ldapserver="ldap1,ldap2,ldap3" ldapbinddn="mybinddn" ldapbindpasswd="mypass" ldapbasedn="mybase" ldapsearchattribute="myatt" Usually auth works perfectly with LDAP (starting a session from psq

[GENERAL] Archiving and recovering pg_stat_tmp

2013-06-19 Thread Sameer Thakur
Hello, I was trying to figure out how does one recover server statistics to the same snapshot to which a database is restored after PITR. The steps i had in mind were 1.Set up WAL archiving 2.On server shutdown one would need to backup pg_stat_tmp along with file system level back of database 3. O

[GENERAL] Snapshot backups

2013-06-19 Thread James Sewell
Hey All, This is a message to confirm my thoughts / validate a possible approach. In a situation where PGDATA and {XLOG, ARCHIVELOG} are on different SAN/NAS volumes and a backup is to be initiated do pg_start_backup and pg_stop_backup need to be used? I am using snapshots of each volume for bac