dbTalk Databases Forums  

Bigserial - sequences on tables

comp.databases.postgresql comp.databases.postgresql


Discuss Bigserial - sequences on tables in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Matthew Woodcraft
 
Posts: n/a

Default Re: Bigserial - sequences on tables - 02-28-2011 , 05:52 PM






D Yuniskis <not.going.to.be (AT) seen (DOT) com> wrote:
Quote:
In light of this type of usage, could I impose upon you
to please explain the consequences of each of these
"serial/sequence" approaches?
What you're doing is fine, and just what SERIAL is intended for.

The only issue is that you might worry that someone might create a mess
by inserting a record and explicitly specifying the id rather than
letting the automatic value be used. But if you're the only person
modifying the table, it's good enough to just Not Do That.

-M-

Reply With Quote
  #12  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: Bigserial - sequences on tables - 03-01-2011 , 10:35 AM






On Mon, 28 Feb 2011 23:47:23 +0000, Matthew Woodcraft wrote:

Quote:
If what you want is to forbid people setting explicit values, you can do
that with per-column permissions.

(But before Postgresql 8.4 using a trigger was the best way, yes.)

It still is the best way. It gives you the highest degree of control.


--
http://mgogala.byethost5.com

Reply With Quote
  #13  
Old   
Jasen Betts
 
Posts: n/a

Default Re: Bigserial - sequences on tables - 03-09-2011 , 04:19 AM



On 2011-02-28, Mladen Gogala <no (AT) email (DOT) here.invalid> wrote:
Quote:
On Mon, 28 Feb 2011 22:13:29 +0000, Matthew Woodcraft wrote:

It overrides the default (like for any other default), and it doesn't
affect the sequence.

So, when the sequence reaches the given number, you will have a primary
key violation? That sounds like a plan.
yes, that works well. when they retry the next value from the sequence
will be tried. this is usually good.

--
⚂⚃ 100% natural

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.