Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uornT-00BtJj-Mx for pgsql-general@arkaria.postgresql.org; Wed, 20 Aug 2025 23:00:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uornT-00C1SO-3O for pgsql-general@arkaria.postgresql.org; Wed, 20 Aug 2025 23:00:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uornS-00C1RV-8l for pgsql-general@lists.postgresql.org; Wed, 20 Aug 2025 23:00:47 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uornQ-000v29-0M for pgsql-general@lists.postgresql.org; Wed, 20 Aug 2025 23:00:45 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id B08BB1D000D7; Wed, 20 Aug 2025 19:00:43 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 20 Aug 2025 19:00:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1755730843; x=1755817243; bh=ed7F9I7W7d1SDLxHrpDWsHHvpdnD3tzh+Nz8GgeUufo=; b= Pna0QVE18l74aF3bFXQQWwzk+zhfs2mTSuJpsjbcL+s/EYeyt2QmpzMU9C04MaGn fFk6a0rP29njjbZFxo9XDqlzmlH3l2x8fGIT13by8qjvjplr6JVCtx8tamcOO1Qa qT1o7pDjGnDK5vA5T8M428WepWBAISQ2xkp4xGxAIfjivyc75K03/fBfUp04NSbT fUPZmDgfvbmTaHjVXcIuuGGhuIR7zB8bP9770og2BNgI/3EHndhxus3fOobUWC7P PPSRhUlLa6SbxoPJKNYrmNdgoTNx12GfYxkriQQp4SghsAplEHn+A1FGpTeyo0Nu 4PpRJI1Wke0VpPh1cpODjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1755730843; x= 1755817243; bh=ed7F9I7W7d1SDLxHrpDWsHHvpdnD3tzh+Nz8GgeUufo=; b=L bq07GQK7VNOOWsX8NJ8CGN/Me9Ml4CwTes7LMPnaDmY+ePds5dO+QLgFzbiF32k2 JfLvXVfSN8+RMIMsB5sTpTdoSueFNmLVf5lDO1MfmvW3KNFTIA+aixgWjHZHaxdS 14cqZzVs2F+6LIocSx/o6hC2QGMC+PAQYKk8p23dFJR1xbpkhQB2N1Fi2vPtCVCO 9V7vmJBxzcFQ2pixl/Z09WQh1jxQPqa5dGuedN0gQU7FomQ/WD9vp8pNKWS7kZi8 VnivMZMFRYyrEVPGhlX7vbEU1xJUyZmJmZ3hXUQNtyXCiQ8C9tWw13CWLZWxzFIT neoIl9ciamdxBk6BeG21g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduheeliedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepueffgeffieevffdufeeuiedugfekvdfgkeefjeehjefh feeutdduvdegjeeufeeknecuffhomhgrihhnpehhvgigrghrohgtkhgvthdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgr nhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggprhgtphhtthhopeefpdhmoh guvgepshhmthhpohhuthdprhgtphhtthhopegrvhhinhgrshhhrdhvrghllhgrrhgrphhu sehgmhgrihhlrdgtohhmpdhrtghpthhtohepkhhktghhnhdrihhnsehgmhgrihhlrdgtoh hmpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhr vghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 20 Aug 2025 19:00:42 -0400 (EDT) Message-ID: Date: Wed, 20 Aug 2025 16:00:42 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: MS SQL to Postgres To: Avinash Vallarapu , KK CHN Cc: pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/20/25 15:52, Avinash Vallarapu wrote: > Hi Krishane, > > * SQL Server often auto-generates constraint names, while PostgreSQL > typically requires explicit > names. You will need to give more detail on above as: create table constraint_test (id integer primary key, fld_1 varchar, fld_2 varchar check (fld_2 != ''), UNIQUE(fld_1, fld_2)); constraint_test Table "public.constraint_test" Column | Type | Collation | Nullable | Default --------+-------------------+-----------+----------+--------- id | integer | | not null | fld_1 | character varying | | | fld_2 | character varying | | | Indexes: "constraint_test_pkey" PRIMARY KEY, btree (id) "constraint_test_fld_1_fld_2_key" UNIQUE CONSTRAINT, btree (fld_1, fld_2) Check constraints: "constraint_test_fld_2_check" CHECK (fld_2::text <> ''::text) > Regards, > Avinash Vallarapu > +1-902-221-5976 > www.hexarocket.com -- Adrian Klaver adrian.klaver@aklaver.com