Question about Oracle compatibility - Mailing list pgsql-hackers

From Mario Weilguni
Subject Question about Oracle compatibility
Date
Msg-id 00112718095200.00894@wotan
Whole thread Raw
Responses Re: Question about Oracle compatibility  (Alex Perel <veers@webhosting.com>)
Re: Question about Oracle compatibility  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Question about Oracle compatibility  (Don Baccus <dhogaza@pacifier.com>)
Re: Question about Oracle compatibility  (Pete Forman <pete.forman@westgeo.com>)
List pgsql-hackers
Sorry if I'm posting to the wrong list, but I don't know which list is 
appropriate for this question.

I've a question concerning compatibilty Postgres <-> Oracle. In Oracle, empty 
strings and null are basicly the same, but it does not seem to be under 
Postgres, making migration a pain.

Example:
ORACLE:
select id  from anytable
where field='';

POSTGRES:
select id from anytable
where field='' or field is null;

Or another example: The oracle query
update anytable set adatefiled=''
fails in Postgres, I've to write
update anytable set adatefield=null;

This gets really bad when the actual data is coming from a webinterface, I've 
to handle 2 different queries for the case empty string and non-empty string.

Is there a better way to achieve this?

Thanks!

Best regards,Mario Weilguni



pgsql-hackers by date:

Previous
From: Marko Kreen
Date:
Subject: Re: Re: [GENERAL] Warning: Don't delete those /tmp/.PGSQL.* files
Next
From: Alex Perel
Date:
Subject: Re: Question about Oracle compatibility