DBD::Pg UTF-8 for PostgreSQL server_encoding
We are preparing to make a major version bump in DBD::Pg, the Perl interface for PostgreSQL, from the 2.x series to 3.x. This is due to a reworking of how we handle UTF-8. The change is not going to be backwards compatible, but will probably not affect many people. If you are using the pg_enable_utf8 flag, however, you definitely need to read on for the details.
The short version is that DBD::Pg is going return all strings from the Postgres server with the Perl utf8 flag on. The sole exception will be databases in which the server_encoding is SQL_ASCII, in which case the flag will never be turned on.
For backwards compatibility and fine-tuning control, there is a new attribute called pg_utf8_strings that can be set at connection time to override the decision above. For example, if you need your connection to return byte-soup, non-utf8-marked strings, despite coming from a UTF-8 Postgres database, you can say:
my $dsn = 'dbi:Pg:dbname=foobar';
my $dbh = DBI->connect($dsn, $dbuser, $dbpass,
{ AutoCommit => 0,
RaiseError => 0,
PrintError => 0,
pg_utf8_strings => 0,
}
);
Similarly, you can set pg_utf8_strings to 1 and it will …
database dbdpg git open-source perl postgres
Internet Retailer exhibits of note
Last night concluded Internet Retailer Conference & Exhibition 2011 in San Diego. We had a lot of good conversations with attendees and other exhibitors at the End Point booth, and our Liquid Galaxy with Google Earth was a great draw for visitors:
The majority of exhibitors at the show were offering software as a service or productized ecommerce services. A couple of our favorite small SaaS companies, both for their knowledgeable and friendly technical staff, and for their challenging some of the less-beloved incumbent giants in the space, were Olark, offering a SaaS live chat service, and SearchSpring, with their SaaS faceted search service. We look forward to trying out their services.
Some of the more dazzling software demonstrations at the show were:
-
Total Immersion, an augmented reality solution. Their TryLive Eyewear demo had us looking into their webcam and trying out different eyeglass frames that were overlaid on our video image in real time.
-
Styku, a company offering 3-D virtual fitting room software. They had an amazing video demo of mannequins modeling different clothes, and it’s all customizable per visitor who wants to use his/her measurements to be fitted …
company conference ecommerce
End Point at IRCE 2011
We are in full force with a booth at at Internet Retailer Conference 2011 in San Diego. The exhibit hall opened yesterday afternoon after the last few stragglers flew in from North Carolina (me) and Idaho (Jon) to join Ben, Rick, Carl, and Ron.
We’ve had a steady flow of booth visitors interested in hearing about our core ecommerce services and Liquid Galaxy. We’ve also heard from a few companies interested in partnering, which is a nice way to learn about the latest popular technologies in ecommerce, such as mobile and tablet opportunities, live chat integration, real-time user interactivity ecommerce features, and shipping integration and analytics.
Stop by if you’re here and interested in hearing more about End Point’s open source consulting and development services!
Here at IRCE 2011!
Ben navigates our Liquid Galaxy display.
Rick navigates through San Diego before a team dinner.
Ben & Carl pose in front our our Liquid Galaxy display.
company conference ecommerce visionport travel
DBD::Pg moves to Git!
Just a note to everyone that development the official DBD::Pg DBI driver for PostgreSQL source code repository has moved from its old home in Subversion to a Git repository. All development has now moved to this repo.
We have imported the SVN revision history, so it’s just a matter of pointing your Git clients to:
$ git clone git://bucardo.org/dbdpg.git
For those who prefer, there is a GitHub mirror:
$ git clone git://github.com/bucardo/dbdpg.git
Git is available via many package managers or by following the download links at https://git-scm.com/download for your platform.
Enjoy!
dbdpg git postgres perl
MongoDB replication from Postgres using Bucardo
One of the features of the upcoming version of Bucardo (a replication system for the PostgreSQL RDBMS) is the ability to replicate data to things other than PostgreSQL databases. One of those new targets is MongoDB, a non-relational ‘document-based’ database. (to be clear, we can only use MongoDB as a target, not as a source)
To see this in action, let’s setup a quick example, modified from the earlier blog post on running Bucardo 5. We will create a Bucardo instance that replicates from two Postgres master databases to a Postgres database target and a MongoDB instance target. We will start by setting up the prerequisites:
sudo aptitude install postgresql-server \
perl-DBIx-Safe \
perl-DBD-Pg \
postgresql-contrib
Getting Postgres up and running is left as an exercise to the reader. If you have problems, the friendly folks at #postgresql on irc.freenode.net will be able to help you out.
Now for the MongoDB parts. First, we need the server itself. Your distro may have it already available, in which case it’s as simple as:
aptitude install mongodb
For more installation information, follow the links from the MongoDB Quickstart page. For my test box, I ended up installing from source …
bucardo database mongodb nosql open-source perl postgres
June 8, 2011: World IPv6 Day

I’m a little surprised they didn’t do it today. 06-06, what better day for IPv6? Oh well, at least Hurricane Electric was awesome enough to send a Sage certification shirt just in time!
June 8th, 2011 is the day! In just a couple days time World IPv6 Day begins. Several of the largest and most popular sites on the Internet, and many others, turn on IPv6 addresses for a 24-hour interval. Many of them already have it, but you have to seek it out on a separate address. Odds are if you’re seeking that out specifically you’re configured well enough to not have any problems. But with IPv6 configured on the primary addresses of some of the largest Internet sites, people that don’t specifically know they’re testing something become part of the test. That’s important to track down exactly what composes those 1-problem-in-2,000 configurations, and assess if that’s even an accurate number these days.
Not sure about your own connection? https://test-ipv6.com/ is an excellent location to run a number of tests and see how v6-enabled you are. Odds are you’ll end up at one end of the spectrum or the other. But if there’s a configuration glitch that could help you track it down.
At End Point we …
ipv6 networking sysadmin
SeniorNet
SeniorNet is an organization dedicated to bringing education and technology access to older adults (50+). I began volunteering with them recently, coaching an intermediate Windows class. My role is to shadow half the class, watching for anyone who gets “stuck” or goes astray, as the instructor leads them through basic operations such as formatting text, creating spreadsheets, and so on.
I started this as a way to give back to the community, and to explore things I might want to do later in my career (namely, teach), but I’m finding that this is giving me some unexpected insights in design (visual and functional) for less-experienced computer users. I’m sure there are lots and lots of formal studies on how over-50ers learn to use computers vs. under-20ers, but there’s nothing like seeing it first-hand. I’ve already started mulling over how this new insight might affect the way I structured an on-line application (e.g., an e-commerce checkout) that would cater to an older audience. And while I don’t have any answers there, I feel better (and humble) for having begun the process, even at this late date.*
*I’m among the very oldest, if not the actual oldest of the End Point crew, …
community
Using Set Operators with Ruby Arrays
The Array class in Ruby has many methods that are extremely useful. I frequently find myself going to the RDoc just to review the different methods and keeping myself up-to-speed on what options are available for manipulating my data using the native methods. Often, I find that there is already a method that exists that can simplify a big chunk of code that I wrote that was confusing and complex.
In a recent project, I needed a way to handle a complex user interface problem that was caused by a many-to-many (has-and-belongs-to-many) database model. The solution that I came up with was an amazingly simple implementation for a problem that could have involved writing some very convoluted and complex algorithms that would have muddied my code and required me to write extensive tests. As it turns out, I had just read up on Array set operators (Ruby methods) and the solution became easier and monumentally more eloquent.
Introducing the Union, Difference, and Intersection
Since Arrays essentially act as a set[1], they can be manipulated using the set operations union, difference, and intersection. If you go do the Array rdoc, however, you’ll notice no methods with these names. So here is …
ruby rails