X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 90D6D8BA10D for ; Fri, 18 Feb 2005 16:19:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 57473-01 for ; Fri, 18 Feb 2005 16:19:17 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 26AE58BA09F for ; Fri, 18 Feb 2005 16:19:16 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j1IGJEbV018728; Fri, 18 Feb 2005 11:19:14 -0500 (EST) To: Greg Spiegelberg Cc: pgsql-admin@postgresql.org Subject: Re: OID assistance In-reply-to: <42160FA7.8030607@cranel.com> References: <3482911A44F0C44EABC658E136A2E8073E974A@colmail01.cranel.local> <17940.1108738126@sss.pgh.pa.us> <42160081.5050205@cranel.com> <18094.1108738956@sss.pgh.pa.us> <42160FA7.8030607@cranel.com> Comments: In-reply-to Greg Spiegelberg message dated "Fri, 18 Feb 2005 10:54:15 -0500" Date: Fri, 18 Feb 2005 11:19:14 -0500 Message-ID: <18727.1108743554@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/168 X-Sequence-Number: 16336 Greg Spiegelberg writes: > Tom Lane wrote: >> Exactly how are you "using OIDs to store files"? Do you mean you're >> using large objects? > The table is > Table "public.imgs" > Column | Type | Modifiers > ----------+--------+------------------------------------------------------ > id | bigint | not null default nextval('public.imgs_id_seq'::text) > file | text | > contents | oid | > Indexes: imgs_pkey primary key btree (id) > Data is loaded using INSERT's. > insert into imgs values (1,'/path/to/myfile',lo_import('/path/to/myfile')); Well, put a unique index on the contents column. Better to fail an insert than to get a conflict of LO OIDs. If you were on 7.4 or later you could do ALTER TABLE SET WITHOUT OIDS so you'd not be sucking up OIDs for the table rows themselves. On 7.3 the only way would be to drop and recreate the larger tables WITHOUT OIDS, which is probably going to be painful :-(. regards, tom lane