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.
0
votes
0answers
33 views
ERROR:syntax error at or near“1” when run image.sql
I've be working on installing discourse on my Ubunutu of version12.04.Here is what I'm totally confused when I run production-image.sql on pgAdmin:
ERROR: syntax error at or near "1"
LINE 3603: 1 ...
0
votes
2answers
9 views
Compare postgresql enum in a function
I have a function defined that I would like to have update a record value it is modified.
CREATE FUNCTION update_project_status_away_from_started()
RETURNS TRIGGER AS $$
BEGIN
IF OLD.status = ...
1
vote
2answers
44 views
Why is this SQL updating the entire table
I've been hit by the classic beginner mistake. As if I'd done an UPDATE with no WHERE clause.
Here's the SQL:
"UPDATE teams SET description = ? " +
"FROM teams t " +
"JOIN team_memberships tm ON ...
1
vote
3answers
29 views
SQL column names and comparing them to row records in another table in PostgreSQL
I have one of those cases where each SQL query works great, but not when I paste them together.
I have two tables. One is dynamic that allows NULL values. The other helps fill the null values by ...
1
vote
0answers
31 views
Counting results filtered by distinct() or group_by() in Codeigniter
I want to count my results of an active record query with CI (using postgreSQL). I am using count_all_results(), which works fine for most queries, but not when using distinct() or group_by() after a ...
0
votes
0answers
6 views
sun jdbc-odbc Driver does not work with 32bit PostgreSQL Odbc driver?
My software is planned to connect to any DB with jdbc AND ALSO with jdbc-odbc!
(The customer will decide what connection and driver he will use)
But it does not work for all Databases!
examples from ...
0
votes
0answers
24 views
(postgreSQL error) FATAL: role “demo” does not exist (PG::Error)
So I've just installed postgreSQL with HomeBrew and have initialized my new demo_app with the: rails new demo_app -d postgresql command.
Albeit, I am getting the following error when starting up the ...
0
votes
0answers
11 views
Mysql Connection Pooling Similar To PostgreSQL's PgBouncer
I'm looking for a pooling solution for mysql that is independent of the language. I am using PGBouncer as an example because it
Resides on the server the database is on
Just change the connection ...
0
votes
1answer
11 views
How to return resultset with Plpython3 in Postgres
How can a plpython function return result set as a normal sql query resultset (not as text).
Here is function definition -
DROP FUNCTION IF EXISTS demo_report();
CREATE OR REPLACE FUNCTION ...
0
votes
1answer
35 views
Best install flow for a new rvm/ruby/pg/rails setup
I've reformatted my Mac Mountain Lion machine due to lots errors in rails development, broken links, outdated versions, etc, etc. I'm trying to install RVM, Ruby, Postgresl and Rails. I've installed ...
0
votes
1answer
37 views
No value specified for parameter 1
I am using Hiberante to connect to postgres database. I am trying to insert a record into the database. I have the values for the record in a string array which I got from a csv file. This is my dao ...
0
votes
1answer
23 views
perform true on joined tables
In PostgreSQL 8.4.13 I have two tables representing card games (each with 3 players) and the score results of those games. The players are identified by id column and the games by gid:
# \d ...
1
vote
0answers
15 views
PostgreSQL User-defined Aggregate stype is not always initialized properly
I've defined aggregate function with following stype
CREATE TYPE sumstglobal_contextcasttest_stype AS (a integer[],
"partResults" integer[],
"numberOfElements" integer,
...
0
votes
1answer
12 views
PostgreSQL Exception handling detail with GET STACKED DIAGNOSTICS
I am using simple function for exception handling the code is..
CREATE OR REPLACE FUNCTION test(INT4) RETURNS void as $$
DECLARE
v_state TEXT;
v_msg TEXT;
v_detail TEXT;
...
0
votes
1answer
20 views
Hibernate - my table is not mapped
I want to make a simple query with a getValueByLabel Method:
Here is my code:
public Config getValueByLabel(String label) throws EntityPersistException{
try {
Query query = ...
1
vote
1answer
34 views
indexing multi-column index with Rails / Postgresql
I have a doubt about correct indexing. I use rails 3.2.13, using Posgresql behind. BTW, Probably more a relational databases/indexing question...
I have this table:
# Table name: exams
#
# id ...
0
votes
1answer
33 views
Cannot start Postgres server [closed]
I'm using Windows 7 32-bit version. I've installed Postgres 9.2. I've initiated database using
initdb -U postgres -A password -E utf8 -W -D "POSTGRESQL_ROOT\data"
It has been created successfully. ...
0
votes
2answers
33 views
Longest matching substring
How would you search for the longest match within a varchar variable? For example, table GOB has entries as follows:
magic_word | prize
===================
sh| $0.20
sha| $0.40
...
0
votes
1answer
22 views
we're sorry, but something went wrong on heroku when a user tries signing up [closed]
I can't correctly pinpoint what exactly is causing the issue
This is a new website I just pushed to heroku, ran heroku rake db:migrate, and heroku restart
It works just fine locally but this happens ...
0
votes
1answer
22 views
jqgrid pagination with postgresql
Until now I was using jqgrid with mysql and php. My code is adapted to the examples given in the jqGrid Demos site.
The data provided by the javascript part are:
page =1
rows =8
sord=asc
$page = ...
0
votes
1answer
15 views
An error occurred in an after hook NoMethodError: undefined method `each' for nil:NilClass (AngularJS)
I'm using Rails 3.2.13 with postgres, rspec 2.13, capybara 2.0.3 and database_cleaner 0.9.1. I'm also using AngularJS. I have a spec with js:true which tests the submission of a form (creating a ...
1
vote
1answer
25 views
“ERROR: extra data after last expected column” when using PostgreSQL COPY
Please bear with me as this is my first post.
I'm trying to run the COPY command in PostgreSQL-9.2 to add a tab delimited table from a .txt file to a PostgreSQL database such as:
COPY raw_data FROM ...
-3
votes
0answers
33 views
can anyone check if this software is still working? [closed]
https://github.com/gluefinance/pov/
I tried to clone and install but it seems like there is a bit of a problem when I try "psql user -f $PGSRC/postgresql-9.1alpha3/contrib/pgcrypto/pgcrypto.sql as ...
0
votes
1answer
52 views
Can't connect to the postgres server ls: /tmp/.s.PGSQL.5432: No such file or directory
Following along with this Railscast http://railscasts.com/episodes/342-migrating-to-postgresql, I just installed postgres on my Mac Lion using HomeBrew, (even though it apparently comes installed with ...
2
votes
3answers
44 views
query inside function returns NULL, query returns a value
Disclaimer: I am new to PostgreSQL, and even newer to functions in plpgSQL. I've read the documentation but I am stumped.
Anyway, I have this function, to pick a charge band out of a table for ...
0
votes
0answers
21 views
Particular column not saving in Production only? Heroku/RoR/PostgreSQL
i can't for the life of me figure out why one particular column in my User table is not being updated--but only in Production on Heroku (Ruby on Rails, PosgreSQL).
I have a user avatar_url string ...
0
votes
0answers
19 views
Hibernate Postgresql Schema
I am accessing Postgresql db using hibernate POJO classes and mapping . Now I added a new schema called 'OCS' and not able to generate classes and mapping.Here is my hibernate.cfg.xml
...
-2
votes
1answer
24 views
Change the starting value of a serial - Postgresql
I've a little problem with serial : From a file, I filled my database in which I have a client ID (it is a serial and it is my primary key). I have 300 clients so 300 client ID (1 to 300). Now my ...
1
vote
2answers
21 views
Divide records into groups - quick solution
I need to divide with UPDATE command rows (selected from subselect) in PostgreSQL table into groups, these groups will be identified with integer value in one of its columns. These groups should be ...
0
votes
1answer
20 views
Postgresql error when using Rails' uniq method
I have an Item model that belongs to a Product model. Product has a properties column of hstore type. I want to return a set of unique items that belong to a product, and that do not include the ...