pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedPorting from Oracl to Postgres
4+ messages / 4 participants
[nested] [flat]
* Porting from Oracl to Postgres
@ 2003-09-05 04:24 Jomon Skariah <jomons@aztec.soft.net>
0 siblings, 2 replies; 4+ messages in thread
From: Jomon Skariah @ 2003-09-05 04:24 UTC (permalink / raw)
To: pgsql-sql
Hi,
Thanks for your replys.
We are facing another problem now.
we need to find an alternative for Oracle's ADD_MONTHS in PostGres..
Regards
Jomon
-----Original Message-----
From: Rod Taylor [mailto:rbt@rbt.ca]
Sent: Friday, September 05, 2003 1:20 AM
To: Jomon Skariah
Cc: pgsql-sql@postgresql.org
Subject: Re: MINUS & ROWNUM in PostGres
> 1) Do we have a replacement in PostGres for MINUS operator of Oracle .
I believe MINUS is non-standard word for EXCEPT, correct?
> 2 Also I need to find an alternative for ROWNUM in oracle..
If you are looking for a unique identifier, try using the OID.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Porting from Oracl to Postgres
@ 2003-09-05 13:57 Rod Taylor <rbt@rbt.ca>
parent: Jomon Skariah <jomons@aztec.soft.net>
1 sibling, 1 reply; 4+ messages in thread
From: Rod Taylor @ 2003-09-05 13:57 UTC (permalink / raw)
To: Jomon Skariah <jomons@aztec.soft.net>; +Cc: pgsql-sql
On Fri, 2003-09-05 at 00:24, Jomon Skariah wrote:
>
> Hi,
>
> Thanks for your replys.
>
> We are facing another problem now.
>
> we need to find an alternative for Oracle's ADD_MONTHS in PostGres..
Guessing based on the name that it adds a quantity of months to a
timestamp. How about an SQL Interval?
now() + interval '15 months'
List of functions:
http://www.postgresql.org/docs/7.3/interactive/functions.html
Attachments:
signature.asc (application/pgp-signature, 186B) download
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Porting from Oracl to Postgres
@ 2003-09-05 14:12 Richard Huxton <dev@archonet.com>
parent: Jomon Skariah <jomons@aztec.soft.net>
1 sibling, 0 replies; 4+ messages in thread
From: Richard Huxton @ 2003-09-05 14:12 UTC (permalink / raw)
To: Jomon Skariah <jomons@aztec.soft.net>; pgsql-sql
On Friday 05 September 2003 05:24, Jomon Skariah wrote:
> Hi,
>
> Thanks for your replys.
>
> We are facing another problem now.
>
> we need to find an alternative for Oracle's ADD_MONTHS in PostGres..
SELECT now() + '1 hour'::interval;
SELECT now() + '2 days'::interval;
SELECT now() + '3 months':: interval;
See the data-types section of the manual for details.
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Porting from Oracl to Postgres
@ 2003-09-05 14:29 Jeff Eckermann <jeff_eckermann@yahoo.com>
parent: Rod Taylor <rbt@rbt.ca>
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Eckermann @ 2003-09-05 14:29 UTC (permalink / raw)
To: Jomon Skariah <jomons@aztec.soft.net>; +Cc: pgsql-sql
--- Rod Taylor <rbt@rbt.ca> wrote:
> On Fri, 2003-09-05 at 00:24, Jomon Skariah wrote:
> >
> > Hi,
> >
> > Thanks for your replys.
> >
> > We are facing another problem now.
> >
> > we need to find an alternative for Oracle's
> ADD_MONTHS in PostGres..
>
> Guessing based on the name that it adds a quantity
> of months to a
> timestamp. How about an SQL Interval?
>
> now() + interval '15 months'
>
> List of functions:
>
http://www.postgresql.org/docs/7.3/interactive/functions.html
For compatibility in your application, you could do
something like:
CREATE FUNCTION add_months(date, integer) RETURNS date
AS '
SELECT ($1 + ( $2::text || ''
months'')::interval)::date;
' LANGUAGE 'sql';
I second the recommendation to spend some time looking
over the available functions in PostgreSQL.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2003-09-05 14:29 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-09-05 04:24 Porting from Oracl to Postgres Jomon Skariah <jomons@aztec.soft.net>
2003-09-05 13:57 ` Rod Taylor <rbt@rbt.ca>
2003-09-05 14:29 ` Jeff Eckermann <jeff_eckermann@yahoo.com>
2003-09-05 14:12 ` Richard Huxton <dev@archonet.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox