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.kla...@aklaver.com


Reply via email to