Displaying 17 results from an estimated 17 matches for "bytea".
Did you mean:
byte
2006 Jan 18
1
Rails and PostgreSQL bytea
Hi!
I''m trying to insert binary data into a PostgreSQL database where the
field is of type ''bytea''. This works fine if a do Base64 encoding but I
just want to do character escaping. How do I do this????.
What I get is this:
ActiveRecord::StatementInvalid in Init_test#save_file
ArgumentError: Invalid Ruby/cstring: INSERT INTO
globalfiles(chksum,block,directory,filename,blocksize,tim...
2006 Oct 30
2
pg_escape_bytea / pg_unescape_bytea (php) alternative in Rails?
...t; character. Postgres will think that the string has ended with that
character. Is there a function that changes all such characters into
"\[ASCII-number]"? And the other way around when getting the stream
back from the database?
References:
http://be.php.net/manual/nl/function.pg-escape-bytea.php
http://be.php.net/manual/nl/function.pg-unescape-bytea.php
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TL...
2005 Dec 21
1
Escape bytea binary data in postgres SQL
Hi!
I want to escape binary data correctly either manually or using some
pre-defined function that does this for me!
I have found on the web: PGconn.escape_bytea but I only get "undefined
method". Any ideas, what is the correct way of doing this my self?
I''m using Rails (WEBrick) under Windows XP with postgre-pr 0.4.0
I have tried:
s_buffer = s_buffer.gsub(/['']/, ''\\047'')
s_buffer = s_buffer.gsub(/[\\]/, ...
2011 Sep 12
0
Migrate column from text to binary (PostgreSQL)
...,
So I''ve realized one of the columns in a table has to be binary
instead of text. However, a straightforward
change_column :my_table, :my_column, :binary
fails under PostgreSQL (9.x series) The error message being:
PGError: ERROR: column "my_column" cannot be cast to type bytea
: ALTER TABLE "my_table" ALTER COLUMN "my_column" TYPE bytea
Now I''ve being told this problem can be solved with USING clause of
the ALTER TABLE/COLUMN statement, like this:
ALTER TABLE "my_table" ALTER COLUMN "my_column" TYPE bytea USING
"my_...
2006 Jul 05
1
ActiveRecord / PostgreSQL Performance Issue
I''m currently using ruby-postgres (the compiled interface to
PostgreSQL), and I''m seeing a huge performance hit with larger :binary
fields in ActiveRecord subclasses owing, it appears, to the use of the
bytea field type and the fact that using that datatype necessitates an
in-memory "unescape" conversion. The best I can tell from looking at the
Postgres Active Record adapter code, however, it doesn''t look like
switching to ruby-postgres (the native Ruby interface) will help this
p...
2009 Mar 31
1
external equiv to R_serialize()?
I'm trying to efficiently allow conversion of R objects to PostgreSQL
bytea (raw binary) datatype within PL/R for persistent storage in
Postgres tables. I have found R_serialize() which looks like what I
need, -- e.g. R_serialize(object, NULL, FALSE, NULL) -- except that it
is marked attribute_hidden. Is there some other externally available
interface that I can use?...
2009 Mar 27
1
UTF8 postgres args saving issue
...G "id"):
This won''t happen all the time ... only when the array of bytes from the
dump (represented as a string) have combinations or bytes that can''t be
interpreted as UTF8.
This could be fixed in a couple of ways I suppose the most obvious being how
the adapter saves bytea fields and encoding the dump as UTF8 ... but I
wasn''t sure if it would un-encode. So I implemented the fool proof option
of Base64 encoding the data, which means never having to worry about
encoding again (because this is not the first time I''ve had a character
encoding issue)
H...
2011 Apr 06
5
CentOS 5.6 will not install due to Firefox error
Hello all,
Well, my local mirror now has CentOS 5.6! Yay! But, I cannot
get it to install. A "yum update" and a "yum --skip-broken"
yields me this:
--> Processing Conflict: firefox conflicts xulrunner >= 1.9.2.14
--> Finished Dependency Resolution
firefox-3.6.13-2.el5.centos.i386 from installed has depsolving problems
--> firefox conflicts with xulrunner
2006 Dec 02
2
select some columns only when doing "find"
Hi,
I love ActiveRecord and its simplicity.
Person.find(1)
It''s so simple but imagine if the table people has 30 columns and there
are some columns with type ''bytea'' (or large object / binary data)
holding MB-s data, then you only need three columns only with type
''string'', ''string'', ''int''. It''s a waste of time using that code. So you
use:
Person.find_by_sql( "select name, id, body f...
2009 Mar 17
2
Upload image to MySQL
Need simple sample, how to upload image in to MySQL database (in BLOB)
Rails 2.2.2
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To
2006 Jun 28
2
Streaming from Database
I need to store rather large data in the database using blobs. I''ve been
working with Rails and have designed a proof-of-concept setup that works
pretty well, except there''s a considerable performance hit with very
large files due to the fact that ActiveRecord loads the entire blob into
memory before the data can get passed to send_data.
I know at least one person is going
2006 Dec 04
7
I need help to connect Postgres and Ruby on Rails Please.
Hello to everyone, I have a problem that is giving me a headache, and
trying to do a project in Ruby on Rails and I need to connect with a
Data Base that is en Postgres, the truth is that I didn’t think that it
was so hard to connect a DB with postgres because I was working with
Msyql and everything was easy. This are the thinks that I have install
in my computer.
1. Debian GNU/Linux, kernel
2008 Nov 03
17
SQL queries in Rails
Hi...
I want to know the equivalent instructions to insert, update, search
and delete a registry. I know Rails can do it easily Thanks to
ActiveRecord, but here''s the catch: I''m using PostgreSQL. As I''m using
SQL to do the migration (Including the foreign keys), I need to know
if I can use SQL queries to do those actions. Is there an example out
there?
I uncommented
2008 Sep 13
4
Setting up RoR with Postgresql ---heeellpp!
Hi there, I''ve been trying for a few hours now to get RoR and postgresql
talking - but I''m very confused about what''s going on (I''m running
windows btw).
I haven''t created a database in postgresql (I''m assuming that RoR will
do that?)
my database.yml looks like this:
production:
adapter: ruby-postgres
database: rails_production
2006 Jul 16
4
migrations questions: MySQL -> postgreSQL
I started my app before migrations were a best practice and have been using SQL scripts. Now I''m looking at potentially having to move from using MySQL to postgreSQL to use a particular hosting provider. I understand migrations are the way to go to make this ''easy'' but it also looks like the use of migrations introduces extra work in other areas. I''d really
2006 May 19
9
Resize uploaded image file without creating temp file?
...the correct
geometry. I know that file column does similar stuff, but I would prefer
to have a separate database row for each image size, rather than one row
and multiple saved files, which is what file_column seems to want to do.
If I store the images as blobs (I use postgresql, so they will be bytea
columns...), is it possible to resize an uploaded image file before
assigning it to the model attribute corresponding to the blob without
writing it to a temp file first? On the other hand, is it better for
performance and maintenance reasons to use files and just save the
location of the image f...
2007 Apr 30
5
Asterisk 1.4.4 VoiceMail ODBC Storage Help
Hi All,
I have an issue with the ODBC voicemail storage option with asterisk. All
appears to work fine, however, I get several sql execute warnings. I was
wondering if anyone out there could help me get to the bottom of what is
causing this and how I could possibly go about rectifying it.
The warning message we are getting is as follows:
WARNING[30115]: app_voicemail.c:1280 delete_file: SQL