Recent

Author Topic: postgres operation + progressbar + wav file  (Read 2553 times)

nicolas_lazarus

  • New Member
  • *
  • Posts: 42
postgres operation + progressbar + wav file
« on: March 16, 2012, 01:05:43 am »
Hi all ,

Is it possible to show the progress of a insert/update operation in a progressbar ?  The data type is bytea for a wav file.
Maybe someway to read the number of bytes transferred to the database?

Thanks in advance,

Nicolás

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: postgres operation + progressbar + wav file
« Reply #1 on: March 16, 2012, 08:40:12 am »
The only possible solution I see is to transfer your bytea in chuncks.
Split your file in say 64k block and transfer them to the database with:
Code: [Select]
insert into wavs (data,id) values (xyz,chunk1)
repeat
update wavs set data = data || chunkn where id=xyz
until finished
If you want to do the same for reading the wav's back from the database, change your table layout to store the numbered chuncks instead of the complete wavs. 

 

TinyPortal © 2005-2018