Ok,
I have a query that runs fine in oracle:
select
driver_id, 'GREEN' as color, pos_date,
pos_lat, pos_lon
from
driver_pos
where
driver_id = 1
order
by pos_date
The only way this works in postgres
is by casting ‘GREEN’ to text using ‘GREEN’::text
The problem
Thanks! Now I get it...
naeem
-Original Message-
From: Oliver Elphick [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 26, 2004 3:05 PM
To: Naeem Bari
Cc: [EMAIL PROTECTED]
Subject: Re: [GENERAL] Newbie question about escaping in a function
On Tue, 2004-10-26 at 11:57 -0500, Naeem
I have a simple function defined thusly:
CREATE OR REPLACE FUNCTION datemath(timestamp with time
zone, int4, varchar)
RETURNS timestamp AS
'
DECLARE
tdat timestamp;
rdat timestamp;
BEGIN
IF ($1 IS NULL) THEN
TDAT
:= NOW();
ELSE
TDAT
:= $1;
END IF;
se
and consistent,
and I have to write only a small amount of DDL to generate a lot of it
:)
Thanks again for the help guys,
Naeem
-Original Message-
From: Jan Wieck [mailto:[EMAIL PROTECTED]
Sent: Monday, October 25, 2004 2:52 PM
To: Franco Bruno Borghesi
Cc: Naeem Bari; [EMAIL PROTECTE
October 25, 2004 2:48 PM
To: Naeem Bari
Cc: [EMAIL PROTECTED]
Subject: Re: [GENERAL] ON DELETE trigger blocks delete from my table
"Naeem Bari" <[EMAIL PROTECTED]> writes:
> CREATE OR REPLACE FUNCTION public.func_job_status_upd()
> RETURNS trigger AS
>
Hi,
I am using postgres 7.4.5 on Redhat Enterprise Linux 3.
My background is really on Oracle, and I am porting a
largish database over to postgres.
Here is my problem:
On oracle, I had a table with an “on update or delete”
trigger that copied the current row out to an audit