I hope I will now remember FOREVER…

… that concatenation of anything with a NULL string in Postgres results in NULL!!! Because in Postgres, in contrast to Oracle, it’s done correctly, and NULL string is different from  an empty string.

I new it last time  – when I first debugged the customer search, but I forgot about it 18 months ago, when I got to move it to a different platform. And it took me hours to straighten this up again!

Advertisements

2 Comments

Filed under SQL

2 responses to “I hope I will now remember FOREVER…

  1. lily

    In SQL Server concatenation with null is always null
    You also cannot compare with null
    if @a = null will give syntax error, the correct way is
    if @a is null

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s