Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jzw1a-00077g-GJ for pgsql-novice@arkaria.postgresql.org; Mon, 27 Jul 2020 05:50:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jzw1Z-0004F7-A7 for pgsql-novice@arkaria.postgresql.org; Mon, 27 Jul 2020 05:50:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jzw1Z-0004F0-1e for pgsql-novice@lists.postgresql.org; Mon, 27 Jul 2020 05:50:09 +0000 Received: from mail-io1-xd41.google.com ([2607:f8b0:4864:20::d41]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jzw1R-0001JF-SG for pgsql-novice@lists.postgresql.org; Mon, 27 Jul 2020 05:50:08 +0000 Received: by mail-io1-xd41.google.com with SMTP id k23so15663958iom.10 for ; Sun, 26 Jul 2020 22:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3DkgYQxdheim9wcLz2cKHLPtP5u206Niv4jXoO0IdNU=; b=FsT9MiU0IV5fdcXHEaVmJxoMl+Kpd//7BU/7pHFBUHBxuZ1EfQI9XzuuqOUAnbI+fo ckIVJarJFajm07JDLXH38LEdmkG6gK0uPc/T9EKrsEvoNcJJdg5jm9+jQ9pFPa4vkEvP MhZnWwxGhQ/jTPTBdZJ9PZbX8CZGdSOIB14VNPG+4/xcTZ9gV+w4a7NrQ5WaKPkvct6p iW2Y5zvNxRAQ9p8ll9+UVr/EjxSqDxdkJXRjhoIraRvajsdQEpLj10VDKa1A1xOE9kXj /eIwbzaMNag0mtVdccGKPZKvXjGzJIhxhXpBJjbeQJmgkgEae7dJwvGL6sFNAIzwST51 nFtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3DkgYQxdheim9wcLz2cKHLPtP5u206Niv4jXoO0IdNU=; b=oW0VOLB0zy0ATlLXhgUjOc3kFUo/5t+u/0n2j2qKDVG8L8rdttL1c6dWkhaxnXae1N rSB+W+6D6soSpID/4jl28ikcNxDIUaSrTyJr3e7v5q39HPr3Oa/DPvPvVa2ZtVCGjkb3 9sVgARADV9pdBbfyCKTcg07f+TRq66SI7DvD55uplaOpn50WPWF0ftqQHATTFwepBcFH xsO9vr0FxWTTyCc30kAqhCCznn0s31LL3n/+c8cK+4beFCdS9Qq1zU/bvD2hvdnv5omJ iJxybNDHpJLztr6Qqh6ya7UxQ5FqkCzr8GNXDA2WlkNwkgpUVWu1/seK05cRNGvtFvKb QHhQ== X-Gm-Message-State: AOAM533JsYcB/hlGWZJF3zEn7pxcjje9g9zMn4b28M1Lio6qTZu9GtYw Fo0/nWKDvYd0AivagZb/ypfGkiYNO7wnblUwmBU= X-Google-Smtp-Source: ABdhPJz7P4Qi5ZtzxwAX5tJl+SuuzaV+x+alYnafBF8UVzNceRCH4os6iSQbt9p5z5E+yOBMgCHZfGkXW3zmHz7aNPU= X-Received: by 2002:a05:6602:1645:: with SMTP id y5mr19350710iow.86.1595828998252; Sun, 26 Jul 2020 22:49:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Amit S." Date: Mon, 27 Jul 2020 11:19:47 +0530 Message-ID: Subject: Re: Not null constraint in postgre To: Chamath Sajeewa Cc: pgsql-novice@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000902da005ab65e4cc" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000902da005ab65e4cc Content-Type: text/plain; charset="UTF-8" Hi Chamath, Here is an article explaining the same::: https://www.enterprisedb.com/postgres-tutorials/how-null-and-empty-strings-are-treated-postgresql-vs-oracle Thanks, Amit On Mon, Jul 27, 2020 at 11:15 AM Chamath Sajeewa wrote: > Hi, > There is a column in my table with not null constraint. Default value is > set to 0 for that column. In my query, column value is set to null. When i > try to execute that query in pgsql, it is getting failed due to constraint > violation. Any idea? This is working in oracle. > Thank You! > -- Amit Sharma --000000000000902da005ab65e4cc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Chamath,=C2=A0

Here is an article ex= plaining the same:::


Thanks, Amit

On Mon, Jul 27, 2020 at 11:15 AM Chamath Sajeewa &= lt;csgsajeewa@gmail.com> wro= te:
Hi,
There is a column in my table with not null cons= traint. Default value is set to 0 for that column. In my query, column valu= e is set to null. When i try to execute that query in pgsql, it is getting = failed due to constraint violation. Any idea? This is working in oracle.
Thank You!


--

Amit Sharma
--000000000000902da005ab65e4cc--