In PostgreSQL, there is a BLOB datatype called bytea. It's just an array of bytes.
bytea literals are output in the following way:
'\\037\\213\\010\\010\\005`Us\\000\\0001.fp3\'\\223\\222%'
See PostgreSQL docs for full definition of the format.
I'm trying to construct a Perl regular expression which will match any such string.
It should also…
Hello all,
Does anyone know how to change a column in SQLite and PostgreSQL to LONGTEXT?
I have done so in MySQL successfully with:
"ALTER TABLE projects MODIFY description LONGTEXT;"
But this clause doesn't seem to work on SQLite. I tried hard to find documentation on PostgreSQL, but that site's format really makes people puke. SQLite's…
I'm considering using postgreSQL 8.4x db on windows/Mac for development and linux for production. wondering what front-end tools are out there that are comparable to Toad (for Oracle) ?
PostgreSQL comes with PgAdminIII. It's OK but I feel there might be something better than that. I prefer free or open source but if something is NOT too…
Is it possible for a PostgreSQL plpgsql function to not return anything? I've created a function, and I don't need it to return anything at all, as it performs a complex SQL query, and inserts the results of that query into another table (SELECT INTO ....). Thus, I have no need or interest in having the function return any output or…
First of all, the framework of choice needs to have excellent support for PostgreSQL. I don't care about MySQL because it doesn't have half of the features the application I will be porting requires. (And when I say excellent support, I mean that their approach to database drivers has not been solely trained in MySQL).
The ideal…
I am in need of an application that can periodically transmit select rows from a PostgreSQL database across a network to a second PostgreSQL server. Typically these will be the most recent row added, pulled and transmitted every 10-30 seconds.
The primary servers run in a MS Windows environment with a high-latency, and…
I have installed postgresql on my Mac OS Lion, and am working on a rails app. I use RVM to keep everything separate from my other rails apps.
For some reason when I try to migrate the db for the first time rake cannot find the postgres user. I get the error
FATAL: role "postgres" does not exist
I have pgAdmin 3 so…
I am looking to create n-grams from text column in PostgreSQL. I currently split(on white-space) data(sentences) in a text column to an array.
select regexp_split_to_array(sentenceData,E'\s+') from tableName
Once I have this array, how do I go about:
Creating a loop to find n-grams, and write each to a row in…
I'm currently working on a project that makes use of Seam/Hibernate (JPA) on MySQL. I'm reconsidering moving towards PostgreSQL after investigating some of the features that it provides. My question is, is there anything I need to worry about with this configuration? Limitations? Gotchas? Things to watch out…
I have built a small inventory system using postgresql and psycopg2. Everything works great, except, when I want to create aggregated summaries/reports of the content, I get really bad performance due to count()'ing and sorting.
The DB schema is as follows:
CREATE TABLE hosts
(
id SERIAL PRIMARY KEY,
…
I'm running a Postgresql query and getting the following error:
ActiveRecord::StatementInvalid (PGError: ERROR: could not open segment 1 of relation base/20983/24161 (target block 5046584): No such file or directory
The query is of the format 'SELECT "locations".* FROM "locations" WHERE ("locations"."id" IN…
I'm using Vagrant with Chef Solo to setup a Lucid 64 box.
I'm using a Chef recipe to install PostgreSQL 9.1 from Martin Pitt's backports.
The install goes ok until the point where the database is started with
/etc/init.d/postgresql start
There's a log pause and the command fails.
If I run pg_ctl…
Suppose I create a table in Postgresql with a comment on a column:
create table t1 (
c1 varchar(10)
);
comment on column t1.c1 is 'foo';
Some time later, I decide to add another column:
alter table t1 add column c2 varchar(20);
I want to look up the comment contents of the first column, and…
Hi,
I have a huge database which holds pairs of numbers (A,B), each ranging from 0 to 10,000 and stored as floats.
e.g.,
(1, 9984.4), (2143.44, 124.243), (0.55, 0), ...
Since the PostgreSQL table which stores these pairs grew quite large, I have decided to partition it into inheriting…
A few days ago, I ran into an unexpected performance problem with a pretty standard Django setup. For an upcoming feature, we have to regenerate a table hourly, containing about 100k rows of data, 9M on the disk, 10M indexes according to pgAdmin.
The problem is that inserting them by…
I am trying to configure Drupal 7 with Postgres. At the database setup step, I get the following error.
Warning: PDO::_construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in DatabaseConnection-_construct() (line 300 of…
Le PostgreSQL Global Development Group annonce la sortie de PostgreSQL 9.2, dernière version en date du système de gestion de bases de données libre de référence.
Depuis l'annonce de la version bêta en mai, les développeurs et les intégrateurs louent les avancées en…
i've got a Ubuntu Linux system with 12Gb memory most of which (at least 10Gb) can be allocated solely to postgres. the system also has a 6 disk 15k SCSI RAID 10 setup.
The process i'm trying to optimise is twofold.
firstly a single threaded, single connection will…
Background:
I have a PostgreSQL (v8.3) database that is heavily optimized for OLTP.
I need to extract data from it on a semi real-time basis (some-one is bound to ask what semi real-time means and the answer is as frequently as I reasonably can but I will be…
I need to create postgresql function
CREATE FUNCTION date_ranges (_start date, end date)
RETURNING TABLE(day_in_range date) AS...
if I call date_ranges('2010-06-01', 2010-06-05')
I should receive
2010-06-01
2010-06-02
2010-06-03
2010-06-04
2010-06-05
…
Just a quick and simple question: in PostgreSQL, how do you list the names of all stored functions/stored procedures using a table using just a SELECT statement, if possible? If a simple SELECT is insufficient, I can make do with a stored function.
My…
We are doing research right now on whether to switch our postgresql db to an embedded Derby db. Both would be using glassfish 3 for our data layer. Anybody have any opinions or knowledge that could help us decide?
Thanks!
edit: we are writing some…