Questions tagged [postgresql-9.2]

for PostgreSQL questions specific to version 9.2.

On 10 September 2012, PostgreSQL 9.2.0 was released. It was End Of Life as of September 2017. Major enhancements in PostgreSQL 9.2 include:

  • Allow queries to retrieve data only from indexes, avoiding heap access (index-only scans)
  • Allow the planner to generate custom plans for specific parameter values even when using prepared statements
  • Improve the planner's ability to use nested loops with inner index scans
  • Allow streaming replication slaves to forward data to other slaves (cascading replication)
  • Allow pg_basebackup to make base backups from standby servers
  • Add a pg_receivexlog tool to archive WAL file changes as they are written
  • Add the SP-GiST (Space-Partitioned GiST) index access method
  • Add support for range data types
  • Add a JSON data type
  • Add a security_barrier option for views
  • Allow libpq connection strings to have the format of a URI
  • Add a single-row processing mode to libpq for better handling of large result sets

The official documentation for this version is available at: http://www.postgresql.org/docs/9.2/static/index.html

1126 questions
13
votes
1 answer

PostgresQL: how to start up the database server and create a database

When I try to run a server: postgres@ubuntu:~$ /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data LOG: could not bind IPv4 socket: Address already in use HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and…
Kifsif
  • 3,477
  • 10
  • 36
  • 45
12
votes
1 answer

psql: FATAL: PAM authentication failed for user

PostgreSQL 9.2.4 I cannot login anymore with a user that has worked in the past. I assume a configuration problem. So for testing I created a test user role 'testing' with the same options as the role in question (as the 'postgres' user who is still…
Markus L
  • 932
  • 2
  • 20
  • 38
12
votes
3 answers

Create a temp table (if not exists) for use into a custom procedure

I'm trying to get the hang of using temp tables: CREATE OR REPLACE FUNCTION test1(user_id BIGINT) RETURNS BIGINT AS $BODY$ BEGIN create temp table temp_table1 ON COMMIT DELETE ROWS as SELECT table1.column1, table1.column2 FROM table1 …
Incerteza
  • 32,326
  • 47
  • 154
  • 261
12
votes
2 answers

VACUUM cannot be executed from a function or multi-command string

I have written a script, using PL/pgSQL, that I run in pgAdmin III. The script deletes existing DB contents and then adds a bunch of "sample" data for the desired testing scenario (usually various types of load tests). Once the data is loaded, I…
Robert N
  • 1,156
  • 2
  • 14
  • 32
12
votes
1 answer

Re-enable Rails 4 auto-EXPLAIN

Automatic EXPLAIN on slow-running SQL queries. This feature has been removed from Rails 4. config.active_record.auto_explain_threshold_in_seconds = 0.5 We find it useful, in controlled circumstances. I came up short in searching for answers to the…
12
votes
4 answers

Retrieve the nextval from a sequence using activerecord in Ruby on Rails 3.2.14 / Ruby 2.0.0 / PostgreSQL 9.2.4

This should be SO simple. I want to retrieve the nextval of a sequence... it's not a default value... it's not a primary key... it's not a foreign key. In rare cases, I need a sequence number for a user supplied value. I've tried the…
12
votes
1 answer

Postgresql tree data structure

I have installed Postgresql 9.2 and would like to use LTREE data type. When I try to create table as in the documentation. CREATE TABLE test (path ltree); I have error: type ltree does not exist I use pgAdmin III for this query. What am I doing…
Alex
  • 11,451
  • 6
  • 37
  • 52
11
votes
1 answer

Postgres calling a void function

I have a void plsql function: CREATE OR REPLACE FUNCTION do_something(p_id BIGINT) RETURNS void AS $$ BEGIN insert .... END; $$ LANGUAGE plpgsql SECURITY DEFINER; I want to call this function from another plsql function, but inside a query…
ozczecho
  • 8,649
  • 8
  • 36
  • 42
11
votes
2 answers

Convert a postgres db schema to a json format

I am looking for a way to convert a postgres db schema to a JSON format data. e.g.: {"Table" : {"name": "varchar(20)", "Age" : "int" }, } Could someone help me with this?
user3396639
  • 111
  • 1
  • 4
11
votes
1 answer

Postgres nested JSON array using row_to_json

I am trying to create nested json array using 2 tables. I have 2 tables journal and journaldetail. Schema is - journal : journalid, totalamount journaldetail : journaldetailid, journalidfk, account, amount Relation between journal and journaldetail…
Bhoomi
  • 781
  • 6
  • 22
11
votes
10 answers

Django DatabaseError: relation "django_site"

I currently have a django app am developing on my PC with data in my db but when i try running this app on a test server i get the error below DatabaseError: relation "django_site" does not exist LINE 1: ..."django_site"."domain",…
user1940979
  • 895
  • 1
  • 13
  • 29
11
votes
1 answer

Select from a table variable

I am trying to save the result of a SELECT query, pass it, and reuse it in another PL/pgSQL function: DECLARE table_holder my_table; --the type of table_holder is my_table; result text; BEGIN SELECT * INTO table_holder FROM table_holder ; …
Xin
  • 737
  • 3
  • 10
  • 27
11
votes
8 answers

PostgreSQL 9.2.4 (Windows 7) - Service won't start, "could not load pg_hba.conf"

I am trying to get Postgres 9.2.4 to run as a service on Windows 7. After installing postgres, the service was running fine. However, after setting postgres up as a server for another program, the service stopped running. When I try to start the…
11
votes
1 answer

How do I create a function in PostgreSQL using evolutions in the Play framework?

With the Play Framework 2.1 I have the following SQL defined in my evolution: CREATE OR REPLACE FUNCTION idx(myArray anyarray, myElement anyelement) RETURNS int AS $$ SELECT i FROM ( SELECT…
11
votes
4 answers

Change table column names to upper case in postgres

I am using postgres 9.2. I need to change all column name to UPPER CASE for all tables in postgres db. Is there any way to do this?? Do i need to change any configurations in postgres?
jobi88
  • 3,865
  • 8
  • 21
  • 15