Question about Oracle compatibility

From: Mario Weilguni <mweilguni(at)sime(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Question about Oracle compatibility
Date: 2000-11-27 17:09:52
Message-ID: 00112718095200.00894@wotan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Kreen 2000-11-27 17:16:51 Re: Re: [GENERAL] Warning: Don't delete those /tmp/.PGSQL.* files
Previous Message Tom Lane 2000-11-27 17:09:00 Re: Re: [NOVICE] Re: re : PHP and persistent connections