Forum: Ruby on Rails Re: using postgres sequences on id columns

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D4b246038154d7cc2363256bd25a4fe0?d=identicon&s=25 ljw1001 (Guest)
on 2005-11-12 12:49
(Received via mailing list)
That makes sense but I was trying to use one sequence for 5 different
tables
so the ids would be unique across all the tables. If the sequence has to
have the same name as the table, that would be impossible. Is that
what's
happening here?

>Date: Mon, 7 Nov 2005 16:12:31 -0800 (PST)
>From: CSN <cool_screen_name90001@yahoo.com>
>Subject: Re: [Rails] using postgres sequences on id columns
>To: rails@lists.rubyonrails.org
>Message-ID: <20051108001231.64300.qmail@web52909.mail.yahoo.com>
>Content-Type: text/plain; charset=iso-8859-1

>SERIAL is just an alias for 'integer no null default
>nextval('sequence')...' Looks like Rails is looking
>for a sequence named project_id_seq yet you created
>one named unique_sequence.

>CSN
81194a50c0f9bd95d7832a77fdf371bd?d=identicon&s=25 cool_screen_name90001 (Guest)
on 2005-11-12 12:49
(Received via mailing list)
I'd suggest revisiting your database design. Sounds
like all five tables could be combined into one.

CSN


--- Larry White <ljw1001@gmail.com> wrote:

> >Subject: Re: [Rails] using postgres sequences on id
> >one named unique_sequence.
> >>CREATE SEQUENCE unique_sequence START 101;
> >> however, I get this error message:
> >>
> > thanks.
> > _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>





__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
This topic is locked and can not be replied to.