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
23
votes
4 answers

42501: INSUFFICIENT PRIVILEGE ERROR while querying in Postgresql

I am trying to query a database table in postgresql, but every time I run the below query it gives me the INSUFFICIENT PRIVILEGE error. What possibly could be the reason for such permission denied error. Also, I am using pgadmin tool in windows to…
AKIWEB
  • 19,008
  • 67
  • 180
  • 294
23
votes
2 answers

Postgresql: optimizing columns size for numeric fields

I dont understand how Postgresql (9.2) calculate the column size (in kb), I have this tables: Table d2: Column | Type | ---------+---------------| id | serial | n | numeric(17,2) | Table d4: Column | Type …
Strae
  • 18,807
  • 29
  • 92
  • 131
23
votes
3 answers

PostgreSQL - how should I use first_value()?

This answer to shows how to produce High/Low/Open/Close values from a ticker: Retrieve aggregates for arbitrary time intervals I am trying to implement a solution based on this (PG 9.2), but am having difficulty in getting the correct value for…
Brent.Longborough
  • 9,567
  • 10
  • 42
  • 62
21
votes
1 answer

Postgres LIKE with column value as substring

I'm trying to compose a WHERE statement that will match rows where a column value is a substring of another string. For example, I might have an event record with a name field of Edward Sharpe. I'd like to do something like: SELECT * FROM events…
amd
  • 512
  • 1
  • 5
  • 13
21
votes
7 answers

Connection refused (PGError) (postgresql and rails)

I keep getting this error when i try to run my localhost using "$rails s": (Mac OSX 10.8.3) (ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]) (Rails 3.2.11) (psql (PostgreSQL) 9.2.2 ) **installed with homebrew I have been doing a…
21
votes
2 answers

Getting Affected Rows by UPDATE statement in RAW plpgsql

This has been asked multiple times here and here, but none of the answers are suitable in my case because I do not want to execute my update statement in a PL/PgSQL function and use GET DIAGNOSTICS integer_var = ROW_COUNT. I have to do this in raw…
anon
20
votes
1 answer

How to get a pg_dump -s to include the CREATE DATABASE command?

I have a postgresql db server that has multiple database in it. postgres=# \list List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges …
dot
  • 14,928
  • 41
  • 110
  • 218
20
votes
2 answers

How to force drop index relation in postgresql?

In PostgreSQL 9.2 / PostGIS 2.0.2 I had an index on a spatial column, created with CREATE INDEX tiger_data_sld_the_geom_gist ON tiger_data.sld USING gist(the_geom); Subsequently dropped the index with DROP INDEX tiger_data_sld_the_geom_gist; But…
kentr
  • 969
  • 1
  • 11
  • 21
20
votes
2 answers

PostgreSQL create index on cast from string to date

I'm trying to create an index on the cast of a varchar column to date. I'm doing something like this: CREATE INDEX date_index ON table_name (CAST(varchar_column AS DATE)); I'm getting the error: functions in index expression must be marked…
Topo
  • 4,783
  • 9
  • 48
  • 70
20
votes
3 answers

Add conditional constraint check

I'm using PostgreSQL 9.2 and need to add a conditional constraint on a column. Essentially, I want to make sure that a column is false when two other columns have a certain value. Table definition: gid | int_unsigned | not null…
PREEB
  • 1,320
  • 2
  • 14
  • 27
19
votes
4 answers

Does postgresql index update on inserting new row?

Sorry if this is a dumb question but do i need to reindex my table every time i insert rows, or does the new row get indexed when added?
user2104778
  • 992
  • 1
  • 14
  • 38
19
votes
2 answers

PostgreSQL: How to list all available datatypes?

Question: In PostgreSQL (using SQL, not the console), how can I list all available datataypes ? Ideally like this: http://www.java2s.com/Code/PostgreSQL/Postgre-SQL/Displaysalldatatypesintheconnecteddatabasewithcomments.htm It should also list user…
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
18
votes
3 answers

Installing newest version of Rails 4 with Postgres - The PGconn, PGresult, and PGError constants are deprecated

I'm not able to find this warning on Google so asking Stackowerflower's help. I want to install Rails 4.2.8 on fresh Centos 7 box. Postgres version is 9.2.18. Ruby version is 2.3.4. When Rails is installed I configure config/database.yml file as…
laimison
  • 1,409
  • 3
  • 17
  • 39
18
votes
2 answers

Query giving division by zero error in PostgreSQL

I am trying to run the following query which results me postgres error: division by zero select request_count, response_count, (response_count*100) / (request_count+response_count) AS proportion from total_dummy_table; How can I…
AKIWEB
  • 19,008
  • 67
  • 180
  • 294
18
votes
2 answers

How to check statistics targets used by ANALYZE?

How do I check the current statistics targets used by ANALYZE?
jpmc26
  • 28,463
  • 14
  • 94
  • 146