-
Recent Posts
Tags
app engines attributes cgi database DBI Debian frameworks full screen terminal GWT hacks hardware hobbit howto html inheritance javascript jQuery libraries Linux mac oracle OSX parallels Perl photoshop pixels PostgreSQL programming qa regression testing screen size Software Development style template toolkit term Theory translation type cast User Interface virtual machine virtual machines visual studio vmware web design web programming
Tag Archives: PostgreSQL
Magic DBI incantation returns array of hashes keyed by column names
my $sql = "select foo, bar, baz from some_table;"; my $result = $dbh->selectall_arrayref($sql, {Slice => {}}); #$result = [ # {foo=>'some data', bar=> 'more data', baz=>'more data'}, # {foo=>'data for row 2', bar=>'....', baz=>'...'}, # {foo=>'data for row 3', bar=>...etc #] It’s the “Slice => {}” part that does it.
Simple Postgres Type Cast
I recently did a select similar to the following, where a subquery grabs some ids, and then a main query uses them: select * from attributes where id in ( select id from documents where owner = 'sam' ); But I got the following error: ERROR: operator does not exist: integer = text HINT: No [...]
Authentication and Postgres
For a given web app, the database and web server may reside on the same machine. Apache runs as webserver-user (or similar) and connects on a local socket to postgres. Postgres on my machine, is not configured to listen on any ports, rather it is configured to authenticate by ‘ident sameuser’ on local sockets. Therefore, [...]
using explain to inteligently create indecies in PostgreSQL