Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 514CE1EB83EA for ; Thu, 23 Feb 2012 15:35:39 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S0eS0-0003Bt-UJ for pgsql-admin@postgresql.org; Thu, 23 Feb 2012 19:35:38 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q1NJZNtF004388; Thu, 23 Feb 2012 14:35:23 -0500 (EST) To: "Fred Parkinson" cc: pgsql-admin@postgresql.org Subject: Re: Can't query the sequence table of a serial primary key. In-reply-to: <4F461C53020000A70001B6BB@gwia1.abag.ca.gov> References: <4F461C53020000A70001B6BB@gwia1.abag.ca.gov> Comments: In-reply-to "Fred Parkinson" message dated "Thu, 23 Feb 2012 11:00:34 -0800" Date: Thu, 23 Feb 2012 14:35:23 -0500 Message-ID: <4387.1330025723@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/96 X-Sequence-Number: 39156 "Fred Parkinson" writes: > We have moved some databases from 7.x to 8.4 > Previously I could query the sequencing table of a 'serial primary key' by simply running > select * from mytable_id_seq; > where mytable has id as a serial primary key and mytable_id_seq is the postgresql relation which manages the key. That naming relationship isn't guaranteed, and AFAIR it wasn't guaranteed in 7.4 either; in case of name collision you'd get something like mytable_id_seq1 instead. > When I do \d I see the table and the sequencer under 'List of relations'. > But when I run select * from mytable_id_seq; postgresql responds with: > relation 'mytable_id_seq' does not exist. Maybe the sequence is in a schema that's not in your search_path. regards, tom lane