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
499
votes
11 answers

Postgres DB Size Command

What is the command to find the size of all the databases? I am able to find the size of a specific database by using following command: select pg_database_size('databaseName');
Beautiful Mind
  • 5,828
  • 4
  • 23
  • 42
444
votes
12 answers

Permission denied for relation

I tried to run simple SQL command: select * from site_adzone; and I got this error ERROR: permission denied for relation site_adzone What could be the problem here? I tried also to do select for other tables and got same issue. I also tried to…
Bob
  • 8,392
  • 12
  • 55
  • 96
304
votes
25 answers

Postgresql - unable to drop database because of some auto connections to DB

Whenever I try to drop database I get the following error: ERROR: database "pilot" is being accessed by other users DETAIL: There is 1 other session using the database. When I use: SELECT pg_terminate_backend(pg_stat_activity.pid) FROM…
Andrius
  • 19,658
  • 37
  • 143
  • 243
277
votes
7 answers

PostgreSQL query to list all table names?

Is there any query available to list all tables in my Postgres DB. I tried out one query like: SELECT table_name FROM information_schema.tables WHERE table_schema='public' But this query returns views also. How can i get only…
jobi88
  • 3,865
  • 8
  • 21
  • 15
252
votes
3 answers

How do I query using fields inside the new PostgreSQL JSON datatype?

I am looking for some docs and/or examples for the new JSON functions in PostgreSQL 9.2. Specifically, given a series of JSON records: [ {name: "Toby", occupation: "Software Engineer"}, {name: "Zaphod", occupation: "Galactic President"} ] How…
Toby Hede
  • 36,755
  • 28
  • 133
  • 162
206
votes
32 answers

Postgresql 9.2 pg_dump version mismatch

I am trying to dump a Postgresql database using the pg_dump tool. $ pg_dump books > books.out How ever i am getting this error. pg_dump: server version: 9.2.1; pg_dump version: 9.1.6 pg_dump: aborting because of server version mismatch The…
Chris Colla
  • 2,163
  • 2
  • 13
  • 5
131
votes
6 answers

Export and import table dump (.sql) using pgAdmin

I have pgAdmin version 1.16.1 installed on my machine. For exporting a table dump, I do: Right click on the table => Choose backup => Set Format to Plain => Save the file as some_name.sql Then I remove the table. Ok, now I need to import the backup…
Oto Shavadze
  • 40,603
  • 55
  • 152
  • 236
123
votes
14 answers

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I am trying to open a program for the first time on Windows XP Pro that uses PostgreSQL 9. I'm getting an error message that says : A problem was encountered while trying to log into or create the production database. Details: [Microsoft][ODBC…
user2437443
  • 2,067
  • 4
  • 23
  • 38
120
votes
3 answers

How to make a select with array contains value clause in psql

I have column arr which is of type array. I need to get rows, where arr column contains value s This query: SELECT * FROM table WHERE arr @> ARRAY['s'] gives the error: ERROR: operator does not exist: character varying[] @> text[] Why does it…
Oto Shavadze
  • 40,603
  • 55
  • 152
  • 236
112
votes
2 answers

How to Disconnect from a database and go back to the default database in PostgreSQL?

I'm using PostgreSql version : postgres=# select version(); version ------------------------------------------------------------- PostgreSQL 9.2.4, compiled by Visual C++ build 1600, 64-bit (1 row) i had connected to a…
09Q71AO534
  • 4,300
  • 13
  • 44
  • 68
108
votes
5 answers

Now() without timezone

I have a column added_at of type timestamp without time zone. I want it's default value to be the current date-time but without time zone. The function now() returns a timezone as well. How do I solve that problem?
Incerteza
  • 32,326
  • 47
  • 154
  • 261
100
votes
2 answers

PostgreSql INSERT FROM SELECT RETURNING ID

In PostgreSql 9.2.4 I have two tables: user (id, login, password, name) and dealer (id, user_id). And I want to insert into both tables returning id of created dealer. Currently I'm doing it with two queries: WITH rows AS ( INSERT INTO "user" …
Nailgun
  • 3,999
  • 4
  • 31
  • 46
98
votes
20 answers

Socket File "/var/pgsql_socket/.s.PGSQL.5432" Missing In Mountain Lion (OS X Server)

I just upgraded my MacMini Server from Lion Server to Mountain Lion using OS X Server. I am having the same problem with PostgreSQL that I did last year when I first installed Lion Server. When I try to do any kind of PostgreSQL terminal command I…
92
votes
1 answer

Failed to find conversion function from unknown to text

In one of my select statements I've got the following error: ERROR: failed to find conversion function from unknown to text ********** Error ********** ERROR: failed to find conversion function from unknown to text SQL state: XX000 This was easy…
Tomas Greif
  • 21,685
  • 23
  • 106
  • 155
87
votes
4 answers

Connecting PostgreSQL 9.2.1 with Hibernate

I have a blank Spring MVC project, and I've installed Hibernate and the PostgreSQL drivers using Maven. I'm running short on complete tutorials that show how to connect PostgreSQL with Hibernate. Any help here?
Hrishikesh Choudhari
  • 11,617
  • 18
  • 61
  • 74
1
2 3
75 76