From: | Memphisto <szoli(at)netvisor(dot)hu> |
---|---|
To: | PostgreSQL general mailinglist <pgsql-general(at)postgreSQL(dot)org> |
Subject: | insert problem. |
Date: | 1998-11-05 14:13:35 |
Message-ID: | Pine.LNX.3.96.981105150833.1479C-100000@linux.intranet.netvisor.hu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
I've got this little problem:
I've got two relations:
groups(name text); -- This one contains the name of usergroups;
users (username text, groupid oid, constraint grid primary key(username));
-- The users relation contains the name of the users along with the group
relation's oid as a foreign key.
I'd like to insert a new user and I also know the group's he or she
belongs to:
elmu=> insert into users values('Average Joe', (select oid from groups
where groups.name='grp1'));
ERROR: parser: parse error at or near "select"
What's wrong with the insertion?
Thanks in advance
--------------------------------------------------------------------------------
Sebestyén Zoltán AKA Memphisto It all seems so stupid,
it makes me want to give up.
szoli(at)netvisor(dot)hu But why should I give up,
when it all seems so stupid?
MAKE INSTALL NOT WAR And please avoid Necrosoft Widows
From | Date | Subject | |
---|---|---|---|
Next Message | Memphisto | 1998-11-05 14:30:33 | The problem I described... |
Previous Message | Constantin Teodorescu | 1998-11-05 13:56:57 | Multiple rule action syntax |