PostgreSQL is an open-source, object-relational database management system (ORDBMS) available for many platforms including Linux, UNIX, MS Windows and Mac OS X. Please mention your PostgreSQL version when asking questions.

learn more… | top users | synonyms (3)

0
votes
0answers
3 views

createdb: could not connect to database postgres: FATAL: could not write init file

I run: /soft/postgres/8.2.3/bin/createdb pstg the result is: createdb: could not connect to database postgres: FATAL: could not write init file any clues as to the cause and possible solutions ...
0
votes
0answers
29 views

Complex Rails/Postgres SQL optimization

Restaurant has_many Dish Dish has_many Photo Photo belongs_to Dish Restaurant 1 Dish 1 Photo 1 May 9, 1:00 PM Dish 2 Photo 2 May 9, 2:00 PM Dish 3 Photo 3 May 9, 3:00 PM ...
0
votes
0answers
7 views

foreign key matching in postgreSQL

Just curious, if I have this table CREATE TABLE "post" ( "id" SERIAL, "revision" INTEGER NOT NULL DEFAULT 0, "summary" CHARACTER VARYING NOT NULL, "description" TEXT NOT NULL, ...
1
vote
3answers
34 views

Is there a way to query for an integer value or NULL without using OR?

I'd like to query for a (list of) values or NULL but not use OR. The reasoning behind trying to not use OR is, that I need to use an index on that field to speed up a query. A simple example to ...
0
votes
1answer
11 views

how to call postgres function with hibernate criteria

I am getting sorted results using hibernate criteria which generates the below sql: select * from mytable order by name asc; This is how i do it with hiberante criteria: ...
0
votes
0answers
15 views

Postgis: How to build query which returns points within box initially and then all the other points?

There is code which get from database points in bounding box for rendering on browser. Also displays list of points with attributes (name etc.) But, when filter will be applied to the dataset I may ...
0
votes
1answer
33 views

Group_concat equivalent in postgre sql 8.2.11

I am using a older version of postgre sql 8.2.11 ... can anyone tell me the equivalent of mysql group_concat for this postgre sql 8.2.11 ... i have tried array_accum , array_to_string , string_agg ... ...
0
votes
1answer
10 views

Trouble with pg_connect in connecting to Heroku

I created a PHP app on Heroku and I'm trying to connect to a Postgres database I set up on Heroku. I put a snippet like this into the project: $dbconn = pg_connect("host=thehost.amazon.whatever ...
-3
votes
0answers
33 views

Auto Commit Error with Postgres using Java

I have a application that work with some transactions. So I plan to use auto commit false before doing calculations and insert statements and after calling inserting I commit. But there is error ...
1
vote
1answer
20 views

PostgreSQL error: subquery must return only one column

Using PostgreSQL-9.1 and PostGIS 2.0.1, when doing a SELECT query containing a sub-query that returns multiple columns, I am getting the error subquery must return only one column. How can the ...
1
vote
1answer
24 views

Convert a nested subquery into normal query

I have problem with following query where in which the nested query should be converted to normal query: select count(*) as count, TO_CHAR(RH.updated_datetime,'DD-MM-YYYY HH:MI:SS') as date, ...
0
votes
1answer
10 views

Error requiring pg under rvm with postgres.app

I'm using Postgres.app on OS X (10.8.3). I have modified my PATH so that the bin folder for the app is before all others. Rammy:~ phrogz$ which pg_config ...
0
votes
1answer
25 views

How to write/overwrite a file with HTMLParser

I need to create some files from a template. I'm using psycopg2 to fetch from a database. Then I loop through. Now I need to write to file. Thanks! import sys from HTMLParser import HTMLParser from ...
0
votes
0answers
13 views

why do I require RESTRICT wildcard to drop schema in PostgreSQL

I have very little experience in PostgreSQL. I have been reading tutorials and documentation, and in order to create or drop a schema all of them say that I just need to execute: CREATE SCHEMA my ...
1
vote
3answers
19 views

Postgres dynamic sql and list result

I used EXECUTE(for dynamic sql) and SETOF(result is returning as list), but it is the wrong :( create table test as select 1 id, 'safd' data1,'sagd' data2 union select 2 id, 'hdfg' data1,'sdsf' ...

1 2 3 4 5 1118
15 30 50 per page