Re: using postgres sequences on id columns

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 [email protected]
Subject: Re: [Rails] using postgres sequences on id columns
To: [email protected]
Message-ID: [email protected]
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

I’d suggest revisiting your database design. Sounds
like all five tables could be combined into one.

CSN

— Larry W. [email protected] 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
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Yahoo! Mail - PC Magazine Editors’ Choice 2005