PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 13th, 2002, 04:25 AM
ggnanaraj ggnanaraj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Chennai, India
Posts: 69 ggnanaraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 55 sec
Reputation Power: 11
Primay Key Constraint ??

As per the document...

http://www.postgresql.org/idocs/ind...altertable.html

ALTER TABLE distributors ADD PRIMARY KEY (dist_id);

should work....but for me ....get this error ... ???

Quote:
hris=# alter table con5 add primary key (nis);
ERROR: ALTER TABLE / ADD CONSTRAINT is not implemented for that constraint type.
hris=#

Reply With Quote
  #2  
Old August 13th, 2002, 04:49 PM
ultraslacker's Avatar
ultraslacker ultraslacker is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 56 ultraslacker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
I've stumbled over this too -


ALTER table distributors ADD CONSTRAINT name_of_constraint PRIMARY KEY (dist_id);
__________________
Casuistry Agnostic

Reply With Quote
  #3  
Old August 13th, 2002, 10:38 PM
ggnanaraj ggnanaraj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Chennai, India
Posts: 69 ggnanaraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 55 sec
Reputation Power: 11
Hi

Thanks for your reply...

However, the following still gives the same error... ??
Quote:
ALTER table distributors ADD CONSTRAINT name_of_constraint PRIMARY KEY (dist_id);


Should we create a primary key constraint only during CREATE TABLE...??

I'm using version 7.2.1. BTW, any method to find the version of the PostgreSQL database ??

Thanks & Regards.

Reply With Quote
  #4  
Old August 14th, 2002, 06:59 PM
ultraslacker's Avatar
ultraslacker ultraslacker is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 56 ultraslacker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
Hmm.. both statements are valid. I'm at a lost as I am using 7.2.1 also.

Just for kicks, check which version you are running -

pg_config --version

Reply With Quote
  #5  
Old August 15th, 2002, 10:54 PM
ggnanaraj ggnanaraj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Chennai, India
Posts: 69 ggnanaraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 55 sec
Reputation Power: 11
Quote:
Originally posted by ultraslacker
Just for kicks, check which version you are running -

pg_config --version


Hi Boss

pg_config --version shows me ...

Quote:

PostgreSQL 7.1.3



But, I've downloaded and installed 7.2.1. Previously, we had 7.1.3 on RH Linux 7.2.

Any links/info about how to upgrade from 7.1.3 to 7.2.1 properly??

I greatly appreciate you kind help.

Thanks & Regards.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > Primay Key Constraint ??

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap