While migrating my application from DB2 to PostgreSQL.
I want to migrate TIMESTAMP() function of DB2 into PostgreSQL.
Example in DB2:
#SELECT TIMESTAMP('2013-01-01','12:13:14') FROM SYSIBM.SYSDUMMY1
1
--
2013-01-01-12.13.14.00
1 record(s)
I have done some more try as follows:
#select timestamp(current_date);
ERROR: syntax error at or near current_date at character 18
STATEMENT: select timestamp(current_date);
ERROR: syntax error at or near current_date
LINE 1: select timestamp(current_date);
On 27/06/2013 12:51, sachin kotwal wrote:
I have done some more try as follows:
#select timestamp(current_date);
ERROR: syntax error at or near current_date at character 18
STATEMENT: select timestamp(current_date);
ERROR: syntax error at or near current_date
LINE 1: select
I've done something weird:
CREATE OR REPLACE FUNCTION timestamp(_date date, _time time) RETURNS
timestamp AS $$
SELECT _date + _time;
$$ LANGUAGE sql;
SELECT timestamp('2013-01-01'::date, '12:00:00'::time);
It worked, but you will need explict cast and quote the timestamp function
name... Many
On 2013-06-27 20:43, sachin kotwal wrote:
While migrating my application from DB2 to PostgreSQL.
I want to migrate TIMESTAMP() function of DB2 into PostgreSQL.
Example in DB2:
#SELECT TIMESTAMP('2013-01-01','12:13:14') FROM SYSIBM.SYSDUMMY1
1
--
On 6/27/2013 4:51 AM, sachin kotwal wrote:
#select timestamp(current_date);
try... current_date::timestamptz
orcast current_date as timestamptz
--
john r pierce 37N 122W
somewhere on the middle of the left coast
--
Sent via pgsql-general
Using your link
http://www.postgresql.org/docs/9.2/static/functions-formatting.html
In DB2 when I use following command I am getting output combined date and
time i passed to function.
#SELECT TIMESTAMP('2013-01-01','12:13:14') FROM SYSIBM.SYSDUMMY1
1
I've done something weird:
CREATE OR REPLACE FUNCTION timestamp(_date date, _time time) RETURNS
timestamp AS $$
SELECT _date + _time;
$$ LANGUAGE sql;
SELECT timestamp('2013-01-01'::date, '12:00:00'::time);
Good one.
function with above definition is already present in pg_catalog. so no need
as i know each value is limited to 1GB. For larger content use module lo
http://www.postgresql.org/docs/9.2/static/lo.html
I just want to know that like DB2 we can convert other data types into
CLOB/BLOB using function CLOB()/BLOB().
Example:
SELECT CLOB('testdata') FROM SYSIBM.SYSDUMMY1
Same
On Fri, Jun 21, 2013 at 9:40 PM, sachin kotwal kotsac...@gmail.com wrote:
as i know each value is limited to 1GB. For larger content use module lo
http://www.postgresql.org/docs/9.2/static/lo.html
I just want to know that like DB2 we can convert other data types into
CLOB/BLOB using function
http://wiki.postgresql.org/images/d/d1/DB2UDB-to-PG.pdf
On 18 June 2013 05:52, sachin kotwal kotsac...@gmail.com wrote:
Function in DB2: BLOB() Criteria: Size of character string targeted for cast
is more than 1GB How can I migrate this function into PostgreSQL with above
mention criteria.
On 06/21/2013 04:49 PM, Daniel de Oliveira Mantovani wrote:
http://wiki.postgresql.org/images/d/d1/DB2UDB-to-PG.pdf
On 18 June 2013 05:52, sachin kotwal kotsac...@gmail.com wrote:
Function in DB2: BLOB() Criteria: Size of character string targeted for cast
is more than 1GB How can I migrate
PostgreSQL has no such capability. Unless you need that and
want to code it yourself, the best solution would be to
write a function that just ignores the third argument.
For time being I will write a function that just ignores the third argument.
but if we really want to create such
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
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
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
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),
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
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
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
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
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
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
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
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
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
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) :
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
Function in DB2: BLOB()Criteria:Size of character string targeted for cast is
more than 1GBHow can I migrate this function into PostgreSQL with above
mention criteria.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Migration-from-DB2-to-PostgreSQL-tp5759607.html
Sent
29 matches
Mail list logo