for PostgreSQL questions specific to version 9.1.
1
vote
1answer
18 views
Why would ALTER TABLE DROP CONSTRAINT on an empty table take a long time?
I am trying to load several million rows of data into a table (a "follow" table that contains two foreign keys to the user table, and the associated indexes on those keys) in a single transaction. My ...
1
vote
1answer
19 views
Write output to file in postgreSQL?
I need to print a table column out to a text file in postgres, just a simple SELECT "column_name" FROM "table." I'm pretty sure there is a way to do this but I can't remember the syntax. Can anyone ...
0
votes
0answers
6 views
Find and count consecutive records in ruby on rails
I have an app that tracks employee times. Employees are required to have at least 2 days off every 12 days... An employee should enter a record with boolean true for day_off...but, in case they ...
0
votes
1answer
7 views
SSRS: Trying to Filter an Expression
I have calculated the % between 2 numbers using an expression in a table.
I want to only filter the results that are below -20%
I have tried going to 'Tablix Properties' -> 'Filters' and then input
...
0
votes
1answer
14 views
column spree_preferences.key does not exist
When I run
rake db:migrate
I get the following error message.
PG::Error: ERROR: column spree_preferences.key does not exist`
Anyone can please tell me how to fix this error.
0
votes
1answer
24 views
Postgre SQL incorrect syntaxt near If
I'm trying to create function but it's having error at If statement don't know what's the problem with it.
CREATE FUNCTION uspgetcountrylistwithpagenumber(IN "PageNumber" integer, IN "PageSize" ...
0
votes
1answer
19 views
Need help to review Postgre SQL query
I have following Postgre SQL Query
declare
_sql varchar varying(50);
_whereClause varchar varying(50);
_whereClause:='and 1=1'
execute 'SELECT count(*) FROM test t WHERE 1=1' || ...
0
votes
0answers
10 views
How can i do pattern matching in postgreSQL when the pattern is to be entered by the user?
If data to be matched is
ABC
DEFA
etc...
but the user has to enter the pattern or alphabet that has to be matched
1
vote
1answer
21 views
PostgreSQL - CTE upsert returning modified rows
I've written an 'upsert' query using CTEs that looks something like this:
WITH
new_data (id, value) AS (
VALUES (1, 2), (3, 4), ...
),
updated AS (
UPDATE table t set
value = ...
1
vote
1answer
28 views
Returning a table from a cursor
I have a function that returns a table of calculated values based on a customer id. I need to get values for all customers; I made a cursor but I can't make it return the set.
Customer table:
id ...
0
votes
0answers
24 views
Postgresql: No data left on drive, how can I wipe it and start over? [migrated]
I have a system with a non-critical postgres database that was unmonitored and consumed all available space on its drive. The OS is unaffected so I am free to delete files.
I would like to just ...
0
votes
0answers
8 views
rails import delimitated file into hstore column
Is it possible to import a delimitated file with some of the data bing imported into an hstore column. Also, being able to specify which columns the data is intended for on import (like importing ...
-2
votes
1answer
34 views
Which books or materials will guide me to learn PostgreSQL quick and easy (agile)? [closed]
Please suggest me some materials or books even preferable links of preparing PostgrSQL quickly and easily and in-depth!
And even few links or queries to refer the concepts in depth!!
0
votes
1answer
27 views
Error “invalid byte sequence” while restoring PostgreSQL database
Today when I am trying to restore my postgresql database(8.1.22) from production using pgadmin3. After restoring it thrown some errors like WARNING: errors ignored on restore: 4 and i found that out ...
0
votes
0answers
55 views
No managed connections available within configured blocking timeout (JBoss 7 and Postgres)
Periodically i get error :
ERROR JDBCExceptionReporter --> javax.resource.ResourceException: IJ000453:
Unable to get managed connection for java:jboss/datasources/myDB
08:12:05,928 ERROR ...