LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-30-2003, 06:36 AM   #1
deadlock
Member
 
Registered: Apr 2003
Distribution: Red Hat
Posts: 65

Rep: Reputation: 15
postgres serial fields


I am having a problem migrating a database from Informix to PostgresSQL due to differences in the behaviour of the SERIAL fields in postgres.

In informix, if I pass a '0' to a serial field (e.g. a record index) I am given the next available value in the field automatically.

As far as I can tell from postgres the same thing should happen. Postgres creates a sequence for the serial field and sets the default value as:

nextval('"count_idx_seq"'::text)

however if I try to enter a 0 to the list, 0 gets added to the table, then future inputs return a "duplicate value not allowed" error.

Any tips?

Dan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two New LQ Profile Fields jeremy LQ Suggestions & Feedback 8 07-12-2005 11:10 PM
Help me using kernel_stat fields... arunka Programming 0 03-24-2005 06:18 AM
inittab fields env Linux - General 2 03-04-2005 12:36 PM
Supressing Fields w/ AWK Rv5 Programming 3 10-19-2004 11:06 AM
compulsory fields masand LQ Suggestions & Feedback 20 09-07-2004 04:33 PM


All times are GMT -5. The time now is 07:06 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration