Обсуждение: reg:lo_write

Поиск
Список
Период
Сортировка

reg:lo_write

От
"sandhya"
Дата:
Hi,
  
  If i use lo_write in different function to write data into an object,Will there be any problem?
like,
I open my object and add data into it and in another function if i again open the same object and add data....It will append to the previous content right!Am i wrong?
 
If i wants to append the content to the present object is there anything i need to do?
Please help me in doing  this................
I am unable to see the image which i am exporting...
Thank you,
Sandhya
 

Re: reg:lo_write

От
"Marco Bizzarri"
Дата:
I'm not sure, but I think you will have problems. As far as I can
understand, largeobject semantics is similar to files. Therefore, you
open an existing LO, and you obtain a file descriptor, which will
point (I think) at the start of the LO. If you write something, the
file descriptor will be moved accordingly. If you open again (i.e. you
issue another lo_open), you will have another file descriptor for the
same LO, which will be at the start of the LO, and you will overwrite
your previous LO.

Please take care with these advices as I'm not a PostgreSQL expert,
just reporting some experience.

Regards
Marco

On 6/22/06, sandhya <sandhyar@amiindia.co.in> wrote:
>
>
> Hi,
>
>   If i use lo_write in different function to write data into an object,Will
> there be any problem?
> like,
> I open my object and add data into it and in another function if i again
> open the same object and add data....It will append to the previous content
> right!Am i wrong?
>
> If i wants to append the content to the present object is there anything i
> need to do?
> Please help me in doing  this................
> I am unable to see the image which i am exporting...
> Thank you,
> Sandhya
>


--
Marco Bizzarri
http://notenotturne.blogspot.com/

Re: reg:lo_write

От
"sandhya"
Дата:
Thank you all....
I have to just modify the already existing application for DB support.So..where ever they are using write i should only use my lo_write...No way to escape from it.....So trying to sort it out....I will keep one file descriptor..and will check whether it is getting or not.....
 
Regards,
Sandhya
 
----- Original Message -----
Sent: Thursday, June 22, 2006 1:56 PM
Subject: RE: [ADMIN] reg:lo_write

Dear sandhya,
According to my knowledge....If u use LO_WRITE function to write data into an object,it wil be problem with primary data.because the descripter wil always take recent existing data.Expetially this wil come under client-server arch.
 
                     Why don't U use...lo_export and lo_import for lorge objects?
 
 

Thanks  &  Regards

Vivekananda.R | Software Engineer           

Infinite Computer Solutions | Exciting Times…Infinite Possibilities...

SEI-CMMI level 5 | ISO 9001:2000

 Tel +91-80-5193-0000| Fax  +91-80-51930009 | Cell No  +91-9986463365|www.infics.com          

 


From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of sandhya
Sent: Thursday, June 22, 2006 1:15 PM
To: Postgres
Cc: sandhya
Subject: [ADMIN] reg:lo_write

Hi,
  
  If i use lo_write in different function to write data into an object,Will there be any problem?
like,
I open my object and add data into it and in another function if i again open the same object and add data....It will append to the previous content right!Am i wrong?
 
If i wants to append the content to the present object is there anything i need to do?
Please help me in doing  this................
I am unable to see the image which i am exporting...
Thank you,
Sandhya
 
Information transmitted by this e-mail is proprietary to Infinite Computer Solutions and / or its Customers and is intended for use only by the individual or the entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at info.in@infics.com and delete this email from your records.

Re: reg:lo_write

От
"sandhya"
Дата:
Hi Macro..
 If i assign my lobj_fd(say LO file descriptor) to one Global int.
 But will my lo_write work if i pass that global int inplace of lobjfd....
One more thing...It should be in "begin" and "end" sessions right!

How can i open a LO in many places and write the content into it.....Will it
get appended to the previous content?
You said two different file descriptors i will be having?How to overcome
it?Any suggestion pls

Anybody please give me suggestion how can i over come this problem?So that i
can proceed further




----- Original Message -----
From: "Marco Bizzarri" <marco.bizzarri@gmail.com>
To: "sandhya" <sandhyar@amiindia.co.in>
Cc: "Postgres" <pgsql-admin@postgresql.org>
Sent: Thursday, June 22, 2006 1:43 PM
Subject: Re: [ADMIN] reg:lo_write


> I'm not sure, but I think you will have problems. As far as I can
> understand, largeobject semantics is similar to files. Therefore, you
> open an existing LO, and you obtain a file descriptor, which will
> point (I think) at the start of the LO. If you write something, the
> file descriptor will be moved accordingly. If you open again (i.e. you
> issue another lo_open), you will have another file descriptor for the
> same LO, which will be at the start of the LO, and you will overwrite
> your previous LO.
>
> Please take care with these advices as I'm not a PostgreSQL expert,
> just reporting some experience.
>
> Regards
> Marco
>
> On 6/22/06, sandhya <sandhyar@amiindia.co.in> wrote:
> >
> >
> > Hi,
> >
> >   If i use lo_write in different function to write data into an
object,Will
> > there be any problem?
> > like,
> > I open my object and add data into it and in another function if i again
> > open the same object and add data....It will append to the previous
content
> > right!Am i wrong?
> >
> > If i wants to append the content to the present object is there anything
i
> > need to do?
> > Please help me in doing  this................
> > I am unable to see the image which i am exporting...
> > Thank you,
> > Sandhya
> >
>
>
> --
> Marco Bizzarri
> http://notenotturne.blogspot.com/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>



Re: reg:lo_write

От
"Marco Bizzarri"
Дата:
Hi Sandhya.

On 6/22/06, sandhya <sandhyar@amiindia.co.in> wrote:
> Hi Macro..
>  If i assign my lobj_fd(say LO file descriptor) to one Global int.
>  But will my lo_write work if i pass that global int inplace of lobjfd....

Yes, I think so.

> One more thing...It should be in "begin" and "end" sessions right!

If you mean inside a single transaction, yes, the lobj_fd is sensible
within one transaction.

> How can i open a LO in many places and write the content into it.....Will it
> get appended to the previous content?

If you have to open and append to the previous content, you could use
other lo_lseek, and pass it SEEK_END, so that you will position to the
end of the LO. At that point, you could "append" to the end of the LO.

> You said two different file descriptors i will be having?How to overcome
> it?Any suggestion pls
>
> Anybody please give me suggestion how can i over come this problem?So that i
> can proceed further
>
>
>
>
> ----- Original Message -----
> From: "Marco Bizzarri" <marco.bizzarri@gmail.com>
> To: "sandhya" <sandhyar@amiindia.co.in>
> Cc: "Postgres" <pgsql-admin@postgresql.org>
> Sent: Thursday, June 22, 2006 1:43 PM
> Subject: Re: [ADMIN] reg:lo_write
>
>
> > I'm not sure, but I think you will have problems. As far as I can
> > understand, largeobject semantics is similar to files. Therefore, you
> > open an existing LO, and you obtain a file descriptor, which will
> > point (I think) at the start of the LO. If you write something, the
> > file descriptor will be moved accordingly. If you open again (i.e. you
> > issue another lo_open), you will have another file descriptor for the
> > same LO, which will be at the start of the LO, and you will overwrite
> > your previous LO.
> >
> > Please take care with these advices as I'm not a PostgreSQL expert,
> > just reporting some experience.
> >
> > Regards
> > Marco
> >
> > On 6/22/06, sandhya <sandhyar@amiindia.co.in> wrote:
> > >
> > >
> > > Hi,
> > >
> > >   If i use lo_write in different function to write data into an
> object,Will
> > > there be any problem?
> > > like,
> > > I open my object and add data into it and in another function if i again
> > > open the same object and add data....It will append to the previous
> content
> > > right!Am i wrong?
> > >
> > > If i wants to append the content to the present object is there anything
> i
> > > need to do?
> > > Please help me in doing  this................
> > > I am unable to see the image which i am exporting...
> > > Thank you,
> > > Sandhya
> > >
> >
> >
> > --
> > Marco Bizzarri
> > http://notenotturne.blogspot.com/
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 9: In versions below 8.0, the planner will ignore your desire to
> >        choose an index scan if your joining column's datatypes do not
> >        match
> >
>
>
>

Regards
Marco

--
Marco Bizzarri
http://notenotturne.blogspot.com/

Re: reg:lo_write

От
"Marco Bizzarri"
Дата:
Did you look at this example?

http://www.redhat.com/docs/manuals/database/RHDB-7.1.3-Manual/prog/largeobjects.html

(I think you can find better example in the postgresql documentation,
this was the first one I found)

On 6/22/06, Marco Bizzarri <marco.bizzarri@gmail.com> wrote:
> Hi Sandhya.
>
> On 6/22/06, sandhya <sandhyar@amiindia.co.in> wrote:
> > Hi Macro..
> >  If i assign my lobj_fd(say LO file descriptor) to one Global int.
> >  But will my lo_write work if i pass that global int inplace of lobjfd....
>
> Yes, I think so.
>
> > One more thing...It should be in "begin" and "end" sessions right!
>
> If you mean inside a single transaction, yes, the lobj_fd is sensible
> within one transaction.
>
> > How can i open a LO in many places and write the content into it.....Will it
> > get appended to the previous content?
>
> If you have to open and append to the previous content, you could use
> other lo_lseek, and pass it SEEK_END, so that you will position to the
> end of the LO. At that point, you could "append" to the end of the LO.
>
> > You said two different file descriptors i will be having?How to overcome
> > it?Any suggestion pls
> >
> > Anybody please give me suggestion how can i over come this problem?So that i
> > can proceed further
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Marco Bizzarri" <marco.bizzarri@gmail.com>
> > To: "sandhya" <sandhyar@amiindia.co.in>
> > Cc: "Postgres" <pgsql-admin@postgresql.org>
> > Sent: Thursday, June 22, 2006 1:43 PM
> > Subject: Re: [ADMIN] reg:lo_write
> >
> >
> > > I'm not sure, but I think you will have problems. As far as I can
> > > understand, largeobject semantics is similar to files. Therefore, you
> > > open an existing LO, and you obtain a file descriptor, which will
> > > point (I think) at the start of the LO. If you write something, the
> > > file descriptor will be moved accordingly. If you open again (i.e. you
> > > issue another lo_open), you will have another file descriptor for the
> > > same LO, which will be at the start of the LO, and you will overwrite
> > > your previous LO.
> > >
> > > Please take care with these advices as I'm not a PostgreSQL expert,
> > > just reporting some experience.
> > >
> > > Regards
> > > Marco
> > >
> > > On 6/22/06, sandhya <sandhyar@amiindia.co.in> wrote:
> > > >
> > > >
> > > > Hi,
> > > >
> > > >   If i use lo_write in different function to write data into an
> > object,Will
> > > > there be any problem?
> > > > like,
> > > > I open my object and add data into it and in another function if i again
> > > > open the same object and add data....It will append to the previous
> > content
> > > > right!Am i wrong?
> > > >
> > > > If i wants to append the content to the present object is there anything
> > i
> > > > need to do?
> > > > Please help me in doing  this................
> > > > I am unable to see the image which i am exporting...
> > > > Thank you,
> > > > Sandhya
> > > >
> > >
> > >
> > > --
> > > Marco Bizzarri
> > > http://notenotturne.blogspot.com/
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 9: In versions below 8.0, the planner will ignore your desire to
> > >        choose an index scan if your joining column's datatypes do not
> > >        match
> > >
> >
> >
> >
>
> Regards
> Marco
>
> --
> Marco Bizzarri
> http://notenotturne.blogspot.com/
>


--
Marco Bizzarri
http://notenotturne.blogspot.com/

Re: reg:lo_write

От
"sandhya"
Дата:
Hi,
 In the examples what ever they are doing is with in one session....But its
not in my case.
I have to open the LO in each and every function and have to write my data
into it and close.
I am trying to get the Length of it and setting the position to END....After
first write when i check the length of it when it coems fro second
write....the filedescriptor is showing zero again...Every time it is showing
zero and only the last content is persisting....?How to come out from this
problem?
Even Global File descriptor too failed....to get this...

No way can we open a LO and append the content to it.......

please help me...anybody

Thank you all,
Regards
Sandhya

----- Original Message -----
From: "Marco Bizzarri" <marco.bizzarri@gmail.com>
To: "sandhya" <sandhyar@amiindia.co.in>
Cc: "Postgres" <pgsql-admin@postgresql.org>
Sent: Thursday, June 22, 2006 3:33 PM
Subject: Re: [ADMIN] reg:lo_write


> Did you look at this example?
>
>
http://www.redhat.com/docs/manuals/database/RHDB-7.1.3-Manual/prog/largeobjects.html
>
> (I think you can find better example in the postgresql documentation,
> this was the first one I found)
>
> On 6/22/06, Marco Bizzarri <marco.bizzarri@gmail.com> wrote:
> > Hi Sandhya.
> >
> > On 6/22/06, sandhya <sandhyar@amiindia.co.in> wrote:
> > > Hi Macro..
> > >  If i assign my lobj_fd(say LO file descriptor) to one Global int.
> > >  But will my lo_write work if i pass that global int inplace of
lobjfd....
> >
> > Yes, I think so.
> >
> > > One more thing...It should be in "begin" and "end" sessions right!
> >
> > If you mean inside a single transaction, yes, the lobj_fd is sensible
> > within one transaction.
> >
> > > How can i open a LO in many places and write the content into
it.....Will it
> > > get appended to the previous content?
> >
> > If you have to open and append to the previous content, you could use
> > other lo_lseek, and pass it SEEK_END, so that you will position to the
> > end of the LO. At that point, you could "append" to the end of the LO.
> >
> > > You said two different file descriptors i will be having?How to
overcome
> > > it?Any suggestion pls
> > >
> > > Anybody please give me suggestion how can i over come this problem?So
that i
> > > can proceed further
> > >
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Marco Bizzarri" <marco.bizzarri@gmail.com>
> > > To: "sandhya" <sandhyar@amiindia.co.in>
> > > Cc: "Postgres" <pgsql-admin@postgresql.org>
> > > Sent: Thursday, June 22, 2006 1:43 PM
> > > Subject: Re: [ADMIN] reg:lo_write
> > >
> > >
> > > > I'm not sure, but I think you will have problems. As far as I can
> > > > understand, largeobject semantics is similar to files. Therefore,
you
> > > > open an existing LO, and you obtain a file descriptor, which will
> > > > point (I think) at the start of the LO. If you write something, the
> > > > file descriptor will be moved accordingly. If you open again (i.e.
you
> > > > issue another lo_open), you will have another file descriptor for
the
> > > > same LO, which will be at the start of the LO, and you will
overwrite
> > > > your previous LO.
> > > >
> > > > Please take care with these advices as I'm not a PostgreSQL expert,
> > > > just reporting some experience.
> > > >
> > > > Regards
> > > > Marco
> > > >
> > > > On 6/22/06, sandhya <sandhyar@amiindia.co.in> wrote:
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > >   If i use lo_write in different function to write data into an
> > > object,Will
> > > > > there be any problem?
> > > > > like,
> > > > > I open my object and add data into it and in another function if i
again
> > > > > open the same object and add data....It will append to the
previous
> > > content
> > > > > right!Am i wrong?
> > > > >
> > > > > If i wants to append the content to the present object is there
anything
> > > i
> > > > > need to do?
> > > > > Please help me in doing  this................
> > > > > I am unable to see the image which i am exporting...
> > > > > Thank you,
> > > > > Sandhya
> > > > >
> > > >
> > > >
> > > > --
> > > > Marco Bizzarri
> > > > http://notenotturne.blogspot.com/
> > > >
> > > > ---------------------------(end of
broadcast)---------------------------
> > > > TIP 9: In versions below 8.0, the planner will ignore your desire to
> > > >        choose an index scan if your joining column's datatypes do
not
> > > >        match
> > > >
> > >
> > >
> > >
> >
> > Regards
> > Marco
> >
> > --
> > Marco Bizzarri
> > http://notenotturne.blogspot.com/
> >
>
>
> --
> Marco Bizzarri
> http://notenotturne.blogspot.com/
>