Re: using postgres sequences on id columns


#1

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 removed_email_address@domain.invalid
Subject: Re: [Rails] using postgres sequences on id columns
To: removed_email_address@domain.invalid
Message-ID: removed_email_address@domain.invalid
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


#2

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

CSN

— Larry W. removed_email_address@domain.invalid 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
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


Yahoo! Mail - PC Magazine Editors’ Choice 2005
http://mail.yahoo.com