[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. Functions in DB2: BLOB()/CLOB() Criteria: Size of character string targeted for cast is more than 1GB. Character String as argument to this function. How can I migrate this function

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Thomas Markus
Am 19.06.2013 08:05, schrieb sachin kotwal: While migrating my application from DB2 to PostgreSQL. I want to migrate following functions in PostgreSQL. Functions in DB2: BLOB()/CLOB() Criteria: Size of character string targeted for cast is more than 1GB. Character String as argument to this

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

[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),

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 what is the

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

2013-06-19 Thread Pavel Stehule
Hello 2013/6/19 sachin kotwal kotsac...@gmail.com: 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

Re: [GENERAL] json functions

2013-06-19 Thread Merlin Moncure
On Wed, Jun 19, 2013 at 12:00 AM, Jayadevan M jayadevan.maym...@ibsplc.com 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.

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

[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 | 20

Re: [GENERAL] postgresql query

2013-06-19 Thread Victor Yegorov
2013/6/19 Jashaswee sweet.rink...@gmail.com 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 ---

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 kotsac...@gmail.com 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

[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

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

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

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 = '*' #

[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) from

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 ambart...@gmail.com 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

[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

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 want is a

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. Cannot

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Amit Langote
On Wed, Jun 19, 2013 at 6:00 PM, Albe Laurenz laurenz.a...@wien.gv.at 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

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 11:10 AM, Amit Langote amitlangot...@gmail.com 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

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 ros...@gmail.com wrote: On Thu, Jun 20, 2013 at 11:10 AM, Amit Langote amitlangot...@gmail.com 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

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 11:35 AM, Amit Langote amitlangot...@gmail.com wrote: On Thu, Jun 20, 2013 at 10:27 AM, Chris Angelico ros...@gmail.com 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

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Amit Langote
On Thu, Jun 20, 2013 at 10:54 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Jun 20, 2013 at 11:35 AM, Amit Langote amitlangot...@gmail.com wrote: On Thu, Jun 20, 2013 at 10:27 AM, Chris Angelico ros...@gmail.com wrote: If your wrapper function is written in SQL and is trivial (eg ignore

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 12:09 PM, Amit Langote amitlangot...@gmail.com 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

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Amit Langote
On Thu, Jun 20, 2013 at 11:10 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Jun 20, 2013 at 12:09 PM, Amit Langote amitlangot...@gmail.com 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) :

Re: [GENERAL] Migration from DB2 to PostgreSQL

2013-06-19 Thread Chris Angelico
On Thu, Jun 20, 2013 at 12:34 PM, Amit Langote amitlangot...@gmail.com wrote: On Thu, Jun 20, 2013 at 11:10 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Jun 20, 2013 at 12:09 PM, Amit Langote amitlangot...@gmail.com wrote: Umm, my bad! I almost forgot I could write pure SQL function

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 (which

[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

[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 psql using