Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
Save many data chunks to file - Mailing list pgsql-general
From
whiplash
Subject
Save many data chunks to file
Date
November 16, 2013
00:52:23
Msg-id
52810828.2080603@bss.org.ua
Whole thread
Raw
List
pgsql-general
Tree view
Hello! I have a table with image data:
CREATE TABLE images
(
id serial,
image_data bytea,
...
);
This is function for store image data to file:
CREATE OR REPLACE FUNCTION write_bytea ( p_data bytea, p_filename text )
RETURNS void AS
$BODY$
DECLARE
v_oid oid;
v_fdesc integer := 0;
v_fsize integer := 0;
BEGIN
v_oid := lo_create ( -1 );
v_fdesc := lo_open ( v_oid, CAST ( X'00020000' AS integer ) );
v_fsize := lowrite ( v_fdesc, p_data );
PERFORM lo_export ( v_oid, p_filename );
PERFORM lo_close ( v_fdesc );
PERFORM lo_unlink ( v_oid );
END
$BODY$
LANGUAGE plpgsql IMMUTABLE;
Query for saving image:
SELECT write_bytea ( i.image_data, id::text || '.jpg' )
FROM images i;
My problem: first 30-40 images (~75 KB for one image) save fast but
saving
speed
of next
images
slows down
and
slows down. What is wrong?
P.S. I try use it in pgAdmin and in psql, but problem doesn't
disappear.
pgsql-general
by date:
Previous
From:
Johannes Björk
Date:
16 November 2013, 00:51:46
Subject:
Add COPY statement inside sql function AND/OR call function within function
Next
From:
"Yelai, Ramkumar IN BLR STS"
Date:
16 November 2013, 00:52:32
Subject:
Postgresql Service and Server synch up issue.
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies