pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedPrimary key with oid + name : error, which solution ?
5+ messages / 3 participants
[nested] [flat]
* Primary key with oid + name : error, which solution ?
@ 2001-10-31 09:06 Stéphane Chomat <steph_chomat@mac.com>
0 siblings, 2 replies; 5+ messages in thread
From: Stéphane Chomat @ 2001-10-31 09:06 UTC (permalink / raw)
To: pgsql-sql
I create two table repertory and person. And i have an error :
> CREATE TABLE repertory (name_rep name, attribut text[], PRIMARY
KEY(name_rep));
> CREATE TABLE person (nam_rep repertory, name_pers text, url text, eadr
text, tel text, attribut text[], PRIMARY KEY(name_pers,nam_rep));
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'person_pkey'
for table 'person'
ERROR: DefineIndex: type repertory has no default operator class
which solution for this problem ?
Stéphane Chomat
22 rue Le Brix
38100 Grenoble
603-999-478
steph_chomat@mac.com
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Primary key with oid + name : error, which solution ?
@ 2001-10-31 20:15 Roberto Mello <rmello@cc.usu.edu>
parent: Stéphane Chomat <steph_chomat@mac.com>
1 sibling, 0 replies; 5+ messages in thread
From: Roberto Mello @ 2001-10-31 20:15 UTC (permalink / raw)
To: St?phane Chomat <steph_chomat@mac.com>; +Cc: pgsql-sql
On Wed, Oct 31, 2001 at 10:06:22AM +0100, St?phane Chomat wrote:
> I create two table repertory and person. And i have an error :
>
> > CREATE TABLE repertory (name_rep name, attribut text[], PRIMARY
> KEY(name_rep));
> > CREATE TABLE person (nam_rep repertory, name_pers text, url text,
> eadr text, tel text, attribut text[], PRIMARY KEY(name_pers,nam_rep));
>
> NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index
> 'person_pkey' for table 'person'
> ERROR: DefineIndex: type repertory has no default operator class
Unless it's some OO extension in PostgreSQL that I don't know about, I
have never heard of the type "repertory" and "name". I don't think you
can use your table name as a data type.
BTW, you should also stay away from arrays (IMHO), since they are
non-standard.
-Roberto
--
+----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+
Roberto Mello - Computer Science, USU - http://www.brasileiro.net
http://www.sdl.usu.edu - Space Dynamics Lab, Developer
NY cops go bar-hopping; LA cops go night-clubbing.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Primary key with oid + name : error, which solution ?
@ 2001-10-31 22:08 Stephan Szabo <sszabo@megazone23.bigpanda.com>
parent: Stéphane Chomat <steph_chomat@mac.com>
1 sibling, 1 reply; 5+ messages in thread
From: Stephan Szabo @ 2001-10-31 22:08 UTC (permalink / raw)
To: Stéphane Chomat <steph_chomat@mac.com>; +Cc: pgsql-sql
On Wed, 31 Oct 2001, [ISO-8859-1] Stéphane Chomat wrote:
> I create two table repertory and person. And i have an error :
>
> > CREATE TABLE repertory (name_rep name, attribut text[], PRIMARY
> KEY(name_rep));
> > CREATE TABLE person (nam_rep repertory, name_pers text, url text, eadr
> text, tel text, attribut text[], PRIMARY KEY(name_pers,nam_rep));
>
> NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'person_pkey'
> for table 'person'
> ERROR: DefineIndex: type repertory has no default operator class
>
> which solution for this problem ?
You'd probably be best off using the name of the repertory in the person
table along with a foreign key. Also, IIRC name is mostly meant as an
internal type. You probably really want varchar(<length>).
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Primary key with oid + name : error, which solution ?
@ 2001-10-31 22:21 Stéphane Chomat <steph_chomat@mac.com>
parent: Stephan Szabo <sszabo@megazone23.bigpanda.com>
0 siblings, 1 reply; 5+ messages in thread
From: Stéphane Chomat @ 2001-10-31 22:21 UTC (permalink / raw)
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>; +Cc: pgsql-sql
Yes, name is an internal type. The problem is in the type of the table
repertory. If it is not
possible to use this syntaxe, i will take the type char. I just try the
new possibility of postgressql.
thanks.
steph.
Le mercredi 31 octobre 2001, à 11:08 , Stephan Szabo a écrit :
> On Wed, 31 Oct 2001, [ISO-8859-1] Stéphane Chomat wrote:
>
>> I create two table repertory and person. And i have an error :
>>
>>> CREATE TABLE repertory (name_rep name, attribut text[], PRIMARY
>> KEY(name_rep));
>>> CREATE TABLE person (nam_rep repertory, name_pers text, url text, eadr
>> text, tel text, attribut text[], PRIMARY KEY(name_pers,nam_rep));
>>
>> NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index
>> 'person_pkey'
>> for table 'person'
>> ERROR: DefineIndex: type repertory has no default operator class
>>
>> which solution for this problem ?
>
> You'd probably be best off using the name of the repertory in the person
> table along with a foreign key. Also, IIRC name is mostly meant as an
> internal type. You probably really want varchar(<length>).
>
>
Stéphane Chomat
22 rue Le Brix
38100 Grenoble
603-999-478
steph_chomat@mac.com
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Primary key with oid + name : error, which solution ?
@ 2001-10-31 22:40 Stephan Szabo <sszabo@megazone23.bigpanda.com>
parent: Stéphane Chomat <steph_chomat@mac.com>
0 siblings, 0 replies; 5+ messages in thread
From: Stephan Szabo @ 2001-10-31 22:40 UTC (permalink / raw)
To: Stéphane Chomat <steph_chomat@mac.com>; +Cc: pgsql-sql
On Wed, 31 Oct 2001, [ISO-8859-1] Stéphane Chomat wrote:
> Yes, name is an internal type. The problem is in the type of the table
> repertory. If it is not
> possible to use this syntaxe, i will take the type char. I just try the
> new possibility of postgressql.
Yeah. I think the problem is that you'd need an operator class to take two
objects of type repertory and sort them because the uniqueness is handled
via with the index system.
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2001-10-31 22:40 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-10-31 09:06 Primary key with oid + name : error, which solution ? Stéphane Chomat <steph_chomat@mac.com>
2001-10-31 20:15 ` Roberto Mello <rmello@cc.usu.edu>
2001-10-31 22:08 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2001-10-31 22:21 ` Stéphane Chomat <steph_chomat@mac.com>
2001-10-31 22:40 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox