Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 3AA35633CD7 for ; Tue, 2 Mar 2010 11:44:45 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 56226-02-5 for ; Tue, 2 Mar 2010 15:44:24 +0000 (UTC) X-Greylist: delayed 00:08:30.526758 by SQLgrey-1.7.6 Received: from mail.jfcomputer.com (unknown [76.14.161.106]) by mail.postgresql.org (Postfix) with ESMTP id 53118633F5A for ; Tue, 2 Mar 2010 11:44:18 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mail.jfcomputer.com (Postfix) with ESMTP id BB63B7765B for ; Tue, 2 Mar 2010 07:35:44 -0800 (PST) X-Virus-Scanned: amavisd-new at jfcomputer.com Received: from mail.jfcomputer.com ([127.0.0.1]) by localhost (server1.jfcomputer.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LgDNzwkBVHHU for ; Tue, 2 Mar 2010 07:35:42 -0800 (PST) Received: from [192.168.1.219] (unknown [192.168.1.219]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johnf@mail.jfcomputer.com) by mail.jfcomputer.com (Postfix) with ESMTPSA id ABED977654 for ; Tue, 2 Mar 2010 07:35:42 -0800 (PST) From: John To: pgsql-sql@postgresql.org Subject: determine the curval() of a view Date: Tue, 2 Mar 2010 07:35:42 -0800 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201003020735.42499.johnf@jfcomputer.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.57 tagged_above=-10 required=5 tests=AWL=-0.929, BAYES_20=-0.74, RDNS_NONE=0.1 X-Spam-Level: X-Archive-Number: 201003/11 X-Sequence-Number: 33718 Hi, I am working with a view that has a "_INSERT" rule. I'm wondering if there is a way to determine what the curval() of the PK (serial type) after an insert occurs. Given the name of the view I'd like to determine the sequence associated with the view's PK. Actually, I wonder if it is even possible to determine the PK from the view name. I'm guessing that it might be possible because the view must be associated with a table/s. And they will have PK's. Any hints will be very helpful. Johnf