From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | Avinash Vallarapu <avinash(dot)vallarapu(at)gmail(dot)com>, KK CHN <kkchn(dot)in(at)gmail(dot)com> |
Cc: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: MS SQL to Postgres |
Date: | 2025-08-20 23:00:42 |
Message-ID: | d65d25c5-b511-4a9a-92ed-16a27797ac57@aklaver.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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 <http://www.hexarocket.com>
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Justin Pryzby | 2025-08-21 01:51:16 | Re: analyze-in-stages post upgrade questions |
Previous Message | Avinash Vallarapu | 2025-08-20 22:52:43 | Re: MS SQL to Postgres |