Re: query to match '\N'

From: pc <chavanpriya(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: query to match '\N'
Date: 2007-07-31 00:41:32
Message-ID: 1185842492.172133.249270@z28g2000prd.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jul 30, 3:27 am, al(dot)(dot)(dot)(at)magproductions(dot)nl (Alban Hertroys) wrote:
> Nis Jrgensen wrote:
> > Alban Hertroys skrev:
>
> >> Presumably he wanted col2 like E'%\\\\N%'.
> >> But doesn't \N mean NULL, or would the OP be looking for literal '\N'
> >> strings in his data? Because if he's looking for NULLs it may be better
> >> to query for col2 IS NULL.
>
> > My guess is that this string was used to signify NULL in the file
> > originally imported into the db.
>
> Which is basically what I was pointing out ;)
> It's all speculation anyway, we're guessing at what problem the OP tries
> to solve.
>
> I think either he is looking for NULL column values that exist in his
> input file as '\N' strings (strings cannot contain NULLs, so using
> "like" is pointless), or he is looking for failed conversions of \N from
> his input file that thus may have ended up as literal \N characters in
> column data.
>
> In the latter case there shouldn't be any columns that match "like
> '%\\\\N%'" but not "= '\\\\N'". OTOH, we may be talking about an import
> failure, in which case anything is possible. Fixing that would probably
> be more difficult than fixing the cause of the failure and re-doing the
> import.
>
> As I said, it's all speculation. Without input from the OP there's not
> much point in continuing this discussion.
>
> Regards,
> --
> Alban Hertroys
> al(dot)(dot)(dot)(at)magproductions(dot)nl
>
> magproductions b.v.
>
> T: ++31(0)534346874
> F: ++31(0)534346876
> M:
> I:www.magproductions.nl
> A: Postbus 416
> 7500 AK Enschede
>
> // Integrate Your World //
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/

oh yes! You all are exactly right.I exported a table and all nulls
became \N and when i imported it \n remained \N and did not convert to
NULL.So I updates all \N s with '' now.
Thank you all for your input.I got to learn a lot from you.

pc

PS: Please refer to me as she :)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Decibel! 2007-07-31 00:44:58 Re: [GENERAL] Question about Postgres
Previous Message Tom Allison 2007-07-30 23:26:45 pg_dump