File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference between these two ways PostgreSQL)?

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
What is the difference between:
insert into agents (id, username, password) values (default, '....', '....')
and
insert into agents (id, username, password) values (nextval('agents_seq'), '....', '....')
Where id column is auto increment (sequence)?
When to use each one?
Thanks.
 
Greg Bugaj
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I am not mistaken nextval('sequence name') will give you next available sequance number using specific sequence name, while the 'default' option will use the default associated sequence.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic