[GENERAL] Syntax of: alter table ... add constraint ...

2010-11-08 Thread Alexander Farber
Hello, I'm having this table filled with data: \d pref_users; Table public.pref_users Column |Type | Modifiers +-+--- id | character varying(32) | not null first_name | character

Re: [GENERAL] Syntax of: alter table ... add constraint ...

2010-11-08 Thread Thomas Kellerer
Alexander Farber, 08.11.2010 15:50: And then I realized that I actually want medals smallint default 0 check (medals= 0) So I've dropped the old constraint with alter table pref_users drop constraint pref_users_medals_check; but how can I add the new contraint please? I'm trying:

Re: [GENERAL] Syntax of: alter table ... add constraint ...

2010-11-08 Thread Raymond O'Donnell
On 08/11/2010 14:50, Alexander Farber wrote: alter table pref_users add constraint pref_users_medals_check (medals= 0); ERROR: syntax error at or near ( LINE 1: ...pref_users add constraint pref_users_medals_check (medals=... ^ and

Re: [GENERAL] Syntax of: alter table ... add constraint ...

2010-11-08 Thread Alexander Farber
Thank you, alter table pref_users add constraint pref_users_medals_check check (medals = 0); has worked! I do not use pgAdmin, because I see in the logs of my 2 web server, that attackers look for it all the time. But I'll install it at my development VM at home now. Regards Alex -- Sent via

Re: [GENERAL] Syntax of: alter table ... add constraint ...

2010-11-08 Thread Guillaume Lelarge
Le 08/11/2010 16:18, Alexander Farber a écrit : Thank you, alter table pref_users add constraint pref_users_medals_check check (medals = 0); has worked! I do not use pgAdmin, because I see in the logs of my 2 web server, that attackers look for it all the time. But I'll install it at

Re: [GENERAL] Syntax of: alter table ... add constraint ...

2010-11-08 Thread Alexander Farber
Oh right, I meant phpPgAdmin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Syntax of: alter table ... add constraint ...

2010-11-08 Thread Alban Hertroys
On 8 Nov 2010, at 16:18, Alexander Farber wrote: Thank you, alter table pref_users add constraint pref_users_medals_check check (medals = 0); has worked! To clarify a bit on this; if you add a constraint, you specify its name and what type of constraint it is, before specifying the

Re: [GENERAL] Syntax of: alter table ... add constraint ...

2010-11-08 Thread Tom Lane
Alban Hertroys dal...@solfertje.student.utwente.nl writes: On 8 Nov 2010, at 16:18, Alexander Farber wrote: alter table pref_users add constraint pref_users_medals_check check (medals = 0); has worked! To clarify a bit on this; if you add a constraint, you specify its name and what type