From chrup999@yahoo.com Mon Jul 16 02:06:02 2001 Received: from smtp011.mail.yahoo.com (smtp011.mail.yahoo.com [216.136.173.31]) by postgresql.org (8.11.3/8.11.1) with SMTP id f6G261a08993 for ; Sun, 15 Jul 2001 22:06:02 -0400 (EDT) (envelope-from chrup999@yahoo.com) Received: from chill-025.bbnow.net (HELO ?192.168.0.4?) (24.219.2.25) by smtp.mail.vip.sc5.yahoo.com with SMTP; 16 Jul 2001 02:05:55 -0000 X-Apparently-From: User-Agent: Microsoft-Entourage/9.0.1.3108 Date: Sun, 15 Jul 2001 21:05:43 -0500 Subject: Unknown values in int8 fields? From: Chris Ruprecht To: "pgsql-sql@postgresql.org" Message-ID: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Archive-Number: 200107/193 X-Sequence-Number: 3988 Hi Chris, When I load records with copy from ... And one of the fields (last one) is left empty, I want the default of nextval('sequence_table') to kick in - but it doesn't. Now, the field with a unique index on it stays blank. No big deal if I could go and say 'update rate set recno = nextval('sequence_rate') where recno = 0 - but it's not that easy as the recno is not 0 but - hmm what? What can I check for? I tried '?' and ? And 0 and ... And ... And ... But nothing works ... Now what? Best regards Chris _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com From webmaster@robbyslaughter.com Mon Jul 16 02:23:16 2001 Received: from mail.utexas.edu (wb1-a.mail.utexas.edu [128.83.126.134]) by postgresql.org (8.11.3/8.11.1) with SMTP id f6G2NGa14038 for ; Sun, 15 Jul 2001 22:23:16 -0400 (EDT) (envelope-from webmaster@robbyslaughter.com) Received: (qmail 25666 invoked by uid 0); 16 Jul 2001 02:23:12 -0000 Received: from adsl-64-218-163-131.dsl.austtx.swbell.net (HELO robmanbox) (64.218.163.131) by umbs-smtp-1 with SMTP; 16 Jul 2001 02:23:12 -0000 Reply-To: From: "Robby Slaughter" To: "Chris Ruprecht" , Subject: RE: Unknown values in int8 fields? Date: Sun, 15 Jul 2001 21:24:15 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-Mimeole: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal In-Reply-To: X-Archive-Number: 200107/194 X-Sequence-Number: 3989 I've not been following this too closely but it sounds like you are trying to COPY records from table A to table B, where the table B also includes a serial value. Here's an easy trick which I'm pretty sure will work: instead of using COPY use SELECT INTO. It's much slower but I think it will do the trick. Good luck! HTH. -Robby -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Chris Ruprecht Sent: Sunday, July 15, 2001 9:06 PM To: pgsql-sql@postgresql.org Subject: [SQL] Unknown values in int8 fields? Hi Chris, When I load records with copy
from ... And one of the fields (last one) is left empty, I want the default of nextval('sequence_table') to kick in - but it doesn't. Now, the field with a unique index on it stays blank. No big deal if I could go and say 'update rate set recno = nextval('sequence_rate') where recno = 0 - but it's not that easy as the recno is not 0 but - hmm what? What can I check for? I tried '?' and ? And 0 and ... And ... And ... But nothing works ... Now what? Best regards Chris _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) From acroyear_07030@yahoo.com Mon Jul 16 03:37:49 2001 Received: from smtp016.mail.yahoo.com (smtp016.mail.yahoo.com [216.136.174.113]) by postgresql.org (8.11.3/8.11.1) with SMTP id f6G3bna35157 for ; Sun, 15 Jul 2001 23:37:49 -0400 (EDT) (envelope-from acroyear_07030@yahoo.com) Received: from adsl-63-202-90-251.dsl.snfc21.pacbell.net (HELO Steph1) (63.202.90.251) by smtp.mail.vip.sc5.yahoo.com with SMTP; 16 Jul 2001 03:37:43 -0000 X-Apparently-From: Message-ID: <005001c10daa$318c1530$6fde010a@myst.com> From: "Stephan Szabo" To: "Chris Ruprecht" Cc: References: Subject: Re: Unknown values in int8 fields? Date: Sun, 15 Jul 2001 20:48:32 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-Mimeole: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200107/195 X-Sequence-Number: 3990 Have you tried "where recno IS NULL"? ----- Original Message ----- From: "Chris Ruprecht" To: Sent: Sunday, July 15, 2001 7:05 PM Subject: [SQL] Unknown values in int8 fields? > Hi Chris, > > When I load records with copy
from ... And one of the fields (last > one) is left empty, I want the default of nextval('sequence_table') to kick > in - but it doesn't. > Now, the field with a unique index on it stays blank. No big deal if I could > go and say 'update rate set recno = nextval('sequence_rate') where recno = 0 > - but it's not that easy as the recno is not 0 but - hmm what? What can I > check for? I tried '?' and ? And 0 and ... And ... And ... But nothing works > ... Now what? _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com