>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 n
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
---
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 maili
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
--
2013-01-01-12.13.14.
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... M
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 ti
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 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 wrote:
Function in DB2: BLOB() Criteria: Size of character string targeted for cast
is more than 1GB How can I migrate this function into P
http://wiki.postgresql.org/images/d/d1/DB2UDB-to-PG.pdf
On 18 June 2013 05:52, sachin kotwal 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 Fri, Jun 21, 2013 at 9:40 PM, sachin kotwal 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 CLOB()/BLOB()
>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
>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 funct
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
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
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
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
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
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
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
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,'
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
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
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
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 f
24 matches
Mail list logo