Skip site navigation (1) Skip section navigation (2)

Fw: How to get OID return value(pls help me)

From: "sandhya" <sandhyar(at)amiindia(dot)co(dot)in>
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
Cc: "postgre" <pgsql-admin(at)postgresql(dot)org>, "sandhya" <sandhyar(at)amiindia(dot)co(dot)in>
Subject: Fw: How to get OID return value(pls help me)
Date: 2005-12-22 07:46:31
Message-ID: 00c201c606cb$d361af40$cd00000a@amiindiahjwbgh (view raw or flat)
Thread:
Lists: pgsql-admin
----- Original Message ----- 
From: "sandhya" <sandhyar(at)amiindia(dot)co(dot)in>
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
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" <mike(at)fuhr(dot)org>
> To: "sandhya" <sandhyar(at)amiindia(dot)co(dot)in>
> Cc: "postgre" <pgsql-admin(at)postgresql(dot)org>
> 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
> >
>




pgsql-admin by date

Next:From: Martijn van OosterhoutDate: 2005-12-22 08:08:07
Subject: Re: [GENERAL] Running with fsync=off
Previous:From: Benjamin AraiDate: 2005-12-22 07:30:15
Subject: Running with fsync=off

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group