X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B2F229DC9D3 for ; Thu, 22 Dec 2005 03:39:11 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32930-02 for ; Thu, 22 Dec 2005 03:39:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from venus.amiindia.co.in (unknown [203.199.198.234]) by postgresql.org (Postfix) with ESMTP id 95DBA9DC9F2 for ; Thu, 22 Dec 2005 03:39:01 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by venus.amiindia.co.in (8.12.11/8.12.11) with SMTP id jBM7YcdU007711; Thu, 22 Dec 2005 13:04:39 +0530 Received: from amiindiahjwbgh (unknown [10.0.0.205])by venus.amiindia.co.in (Postfix) with ESMTP id 30420332941; Thu, 22 Dec 2005 13:04:35 +0530 (IST) Message-ID: <00c201c606cb$d361af40$cd00000a@amiindiahjwbgh> From: "sandhya" To: "Michael Fuhr" Cc: "postgre" , "sandhya" Subject: Fw: How to get OID return value(pls help me) Date: Thu, 22 Dec 2005 13:16:31 +0530 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 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-imss-version: 2.5 X-imss-result: Passed X-imss-scores: Clean:99.90000 C:21 M:2 S:5 R:5 X-imss-settings: Baseline:5 C:3 M:3 S:4 R:3 (0.2500 0.7500) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.009 required=5 tests=[AWL=0.008, UNPARSEABLE_RELAY=0.001] X-Spam-Score: 0.009 X-Spam-Level: X-Archive-Number: 200512/268 X-Sequence-Number: 19988 ----- Original Message ----- From: "sandhya" To: "Michael Fuhr" Sent: Thursday, December 22, 2005 1:15 PM Subject: Re: [ADMIN] How to get OID return value(pls help me) > What function is that? What does it do with the oid? > > It is normal C function ...with that oid it tries to open the object which i > stored in database. > > You don't mention what language and interface you're using but it > sounds like C and libpq. > Yes...it's C-libpq only > > and use strtoul() to convert the char * to an unsigned > This solved my problem. > Thank you very much Michael. > > Regards, > Sandhya > > > ----- Original Message ----- > From: "Michael Fuhr" > To: "sandhya" > Cc: "postgre" > Sent: Thursday, December 22, 2005 12:01 PM > Subject: Re: [ADMIN] How to get OID return value(pls help me) > > > > On Thu, Dec 22, 2005 at 11:05:22AM +0530, sandhya wrote: > > > My table consists of oid and varchar datatypes. > > > I want to get the oid type from the table and i need to pass it to > > > a function which accepts only the oid data type. > > > > What function is that? What does it do with the oid? > > > > > But my problem is the return value of the datatype i am getting from > > > the query result is char*. > > > > You don't mention what language and interface you're using but it > > sounds like C and libpq. > > > > > Is there any function in postgresql which gives the return value of > > > the executed query as OID type. > > > > You could rely on the knowledge that Oid is > > > > typedef unsigned int Oid; > > > > and use strtoul() to convert the char * to an unsigned int. Another > > way, if you're using 7.4 or later, would be to issue the query with > > PQexecParams() and request binary results. I think you'll have to > > deal with byte order issues in that case. > > > > This is off-topic for pgsql-admin; pgsql-interfaces or pgsql-general > > would be more appropriate. > > > > -- > > Michael Fuhr > > >