X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id F3F0AD1D8AE for ; Tue, 10 Feb 2004 17:03:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 82614-02 for ; Tue, 10 Feb 2004 13:03:39 -0400 (AST) Received: from physics.gmu.edu (physics.gmu.edu [129.174.44.73]) by svr1.postgresql.org (Postfix) with ESMTP id 54477D1C4BC for ; Tue, 10 Feb 2004 13:03:38 -0400 (AST) Received: from physics.gmu.edu (localhost.localdomain [127.0.0.1]) by physics.gmu.edu (8.12.8/8.12.8) with ESMTP id i1AH3aBp015918; Tue, 10 Feb 2004 12:03:36 -0500 From: mohan@physics.gmu.edu Received: (from apache@localhost) by physics.gmu.edu (8.12.8/8.12.8/Submit) id i1AH3aNj015916; Tue, 10 Feb 2004 12:03:36 -0500 X-Authentication-Warning: physics.gmu.edu: apache set sender to mohan@physics.gmu.edu using -f Received: from 138.88.163.115 (SquirrelMail authenticated user mohan) by physics.gmu.edu with HTTP; Tue, 10 Feb 2004 12:03:36 -0500 (EST) Message-ID: <64366.138.88.163.115.1076432616.squirrel@physics.gmu.edu> Date: Tue, 10 Feb 2004 12:03:36 -0500 (EST) Subject: Unique Constraint with foreign Key To: X-Priority: 3 Importance: Normal Cc: X-Mailer: SquirrelMail (version 1.2.11) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/99 X-Sequence-Number: 16790 Hi all i am using postgres and torque I have a column x in Table A of type varchar and NOT NULL. I want to impose a unique key constraint on that table and column y is the primary key. I have another Table B with column x. can i make this column x as a foreign key on column x in table A. or Can i have varchar types of size 50 as primary keys in Postgres. please let me know --Mohan