Displaying 20 results from an estimated 7000 matches similar to: "pg_escape_bytea / pg_unescape_bytea (php) alternative in Rails?"
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
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
2006 Nov 22
1
to_absolute_uri typo in 0.6.3?
I just started using Mechanize, and started using Ruby about thirty
seconds before that, but one of the sites I''m scraping does a redirect
on form submission to a badly-formed relative URL:
index.cfm?action=bing&bang=boom=1|a=|b=|c= (etc.)
Interestingly, Mechanize 0.6.2 handled this OK, but in 0.6.3 this causes
a URI::InvalidURIError exception from URI.parse() in to_absolute_uri
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?
Thanks,
Joe
2009 Mar 27
1
UTF8 postgres args saving issue
Hi, All
I have an encountered an issue where the args field is not saved correctly
to the database. I encounter an error like this:
ActiveRecord::StatementInvalid (RuntimeError: ERROR C22021 M invalid
byte sequence for encoding "UTF8": 0xcb3a H This error can also happen if
the byte sequence does not match the encoding expected by the server, which
is controlled by
2011 Sep 12
0
Migrate column from text to binary (PostgreSQL)
Hello,
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
2015 Jun 25
4
URI Handling Patch
I have written a patch (please see attached) which fixes both of these bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=1092583
https://bugzilla.redhat.com/show_bug.cgi?id=1232477
By default, when saving a URI using xmlSaveUri it escapes everything in the
URI. QEMU doesn't want anything escaped, so now I unescape everything
after the URI is generated. Unfortunately there's no flag to
2006 Jul 05
5
CentOS-4.3 and PHP PostgreSQL extension.
I need to enable pg support on one of my CentOS servers. I know nothing about
PHP but DRUPAL requires a DB backend and we have standardized on pg rather
than mysql. The PHP.net page devoted to the subject of pg says that to enable
pg support PHP must be built with the flag "--with-pgsql[=DIR]" and that the
required support extension must be loaded via the /etc/php.ini file with the
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 Jan 31
19
Best Practices: Escaping text on input or output?
In web applications that have user generated content, it is clearly
necessary to provide some ability to ''escape'' user generated text to
avoid SQL injection, XSS, and other nasty attacks. The existing dogma
on this point seems to favor escaping text as it comes out of the
database, rather than doing it on the way in.
I''m not sure that I understand the logic behind
2007 Jul 13
1
PHP doesn't connect to PG with SELinux
I just migrated my FC4 server to CentOS 5 and had some problems with DB
connections from PHP to a PG server (remote server). The thing is that I
couldn't get an error, until I disabled SELinux. At that time, the PG
connections started working.
Are there any instructions on how to work with SELinux enabled and
multiple applications connecting one with another?
--
select
2011 May 16
3
Problem with GET args and UTF-8 encoding (output of Rack::Utils.unescape() ?)
Hi folks,
Here''s my basic issue, hopefully this is clear. I''m trying to submit
some UTF-8 values in my query string, but they are coming out mangled
on the other end. It *seems* like the problem is that what
Rack::Utils.unescape() pushes out gets converted to UTF-8 somewhere in
the chain (using 3.0.7, and Ruby 1.9.2, by the way), and it''s mangling
characters which are
2007 Jul 19
1
Storing order of sortable objects in RoR
I have two sortable lists that you can drag and drop to and from. Each
object in the lists have a position field in the object''s table. I
want to be able to update the position in the database automagically
once a user has sorted the list.
I can drag and drop just fine but I am not able to store the new
positions in the database.
I am trying to use Ajax.request in the onUpdate callback
2006 Aug 07
1
DirHandler in surplus slashing / unrequited unescaping
im using Mongrels to serve up /usr/portage/packages for other gentoo boxen. since i guess im the guinea pig with the DirHandler, ran into a couple issues:
first, the client showed no files in the remote binhost, turns out the DirHandler was adding a trailing "/" to every filename, presumably making the client think they were directories, not files. attached is a patch which fixes this
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(/['']/,
2006 Aug 15
4
escaping html?
Hi
I have a wysiwyg html ditor in my app. How do I escape html written to the
database and encoding when I display the content>
Ty
Pieter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060815/d8c50941/attachment.html
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
2007 Sep 22
2
http helpers c extension
hi,
I rewrote escape, unescape, and query_parse in a C extension.
http://s3.amazonaws.com/four.livejournal/20070922/http_helpers.tar.bz2
Here are some sample benchmarks (the benchmark script is included in
the package)
user system total real
escape: Single long
Mongrel: 1.680000 0.020000 1.700000 ( 1.837793)
HttpHlp: 0.030000 0.010000 0.040000 ( 0.036590)
2015 Jun 26
3
Re: URI Handling Patch
>
> > By default, when saving a URI using xmlSaveUri it escapes everything in
> the URI. QEMU doesn't want anything escaped, so now I unescape
> everything after the URI is generated. Unfortunately there's no flag to
> change the default behavior.
>
> I'm not sure that's the actual issue here, but I'm somehow included to
> think this is another
2007 Dec 28
6
Arbitrary system files readable in 1.0.4 - 1.1.2
I just found a vulnerability in one of my web apps that was running
Mongrel 1.1.2 where I could go to URIs like
/.%252e/.%252e/.%252e/.%252e/.%252e/.%252e/.%252e/etc/passwd and it
would serve the actual /etc/passwd file.
The issue seems to be in lib/mongrel/handlers.rb in the change from
1.0.3 to 1.0.4
req_path = HttpRequest.unescape(path_info)
- if @path
- req_path =