postgresql-9.0

Slow PostgreSQL query in production - help me understand this explain analyze output

若如初见. 提交于 2020-12-29 04:30:24
问题 I have a query that is taking 9 minutes to run on PostgreSQL 9.0.0 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46), 64-bit This query is automatically generated by hibernate for my application. It's trying to find all of the "teacher members" in a school. A membership is a user with a role in a group. There are several types of groups, but here what matters are schools and services. If someone is a teacher member in a service and a member in this

Slow PostgreSQL query in production - help me understand this explain analyze output

青春壹個敷衍的年華 提交于 2020-12-29 04:27:28
问题 I have a query that is taking 9 minutes to run on PostgreSQL 9.0.0 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46), 64-bit This query is automatically generated by hibernate for my application. It's trying to find all of the "teacher members" in a school. A membership is a user with a role in a group. There are several types of groups, but here what matters are schools and services. If someone is a teacher member in a service and a member in this

The difference in ordering of enum type literals between PostgreSQL 9.0 and 9.1

六月ゝ 毕业季﹏ 提交于 2020-01-24 09:29:48
问题 There has been some curious update in the way enum types work between PostgreSQL 9.0 and 9.1. The pg_catalog.pg_enum table has a new column enumsortorder in PostgreSQL 9.1. This order seems to override the previous enum ordering based on OIDs. PostgreSQL 9.0 Documentation The OIDs for a particular enum type are guaranteed to be ordered in the way the type should sort, but there is no guarantee about the ordering of OIDs of unrelated enum types. PostgreSQL 9.1 Documentation The OIDs for pg

The difference in ordering of enum type literals between PostgreSQL 9.0 and 9.1

≡放荡痞女 提交于 2020-01-24 09:29:46
问题 There has been some curious update in the way enum types work between PostgreSQL 9.0 and 9.1. The pg_catalog.pg_enum table has a new column enumsortorder in PostgreSQL 9.1. This order seems to override the previous enum ordering based on OIDs. PostgreSQL 9.0 Documentation The OIDs for a particular enum type are guaranteed to be ordered in the way the type should sort, but there is no guarantee about the ordering of OIDs of unrelated enum types. PostgreSQL 9.1 Documentation The OIDs for pg

Is there any difference between integer and bit(n) data types for a bitmask?

老子叫甜甜 提交于 2020-01-01 07:50:07
问题 I am working with a table in a PostgreSQL database that has several boolean columns that determine some state (e.g. published , visible , etc.). I want to make a single status column that will store all these values as well as possible new ones in a form of a bitmask. Is there any difference between integer and bit(n) in this case? This is going to be a rather big table, because it stores objects that users create via a web-interface. So I think I will have to use (partial) indexes for this

PostgreSQL Permission denied Error on Unix domain socket “/var/pgsql_socket/.s.PGSQL.5432” - Lion Server 10.7.3 or Lion Server 10.7.4

喜你入骨 提交于 2019-12-29 01:47:11
问题 I recently had major permission problems using Lion Server where permissions would change on folders at will. During this time I had started getting the following error when trying to do a rake db:migrate command: rake aborted! could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"? This had been working before when I first created a Rails 3.2.3 application while running 10.7.2. All of a

JDBC PostgreSQL: Unable to retrieve records

纵饮孤独 提交于 2019-12-25 06:53:06
问题 I've been grinding my teeth in this issue since yesterday. I wanted to retrieve a record in the database using a view and here is my code: try { Class.forName("org.postgresql.Driver").newInstance(); Connection Conn = DriverManager.getConnection("jdbc:postgresql://{ipaddress}/database?user=postgres&password=password"); Statement Stmt = Conn.createStatement(); String sqlCommand = "SELECT num, ip_address, ftp_user, ftp_password, ftp_location, site FROM table_view WHERE site = 'test' "; ResultSet

SQL two criteria from one group-by

Deadly 提交于 2019-12-24 12:34:59
问题 I have a table with some "functionally duplicate" records - different IDs, but the 4 columns of "user data" (of even more columns) are identical. I've got a query working that will select all records that have such duplicates. Now I want to select, from each group of duplicates, first any of them that have column A not null - and I've verified from the data that there are at most 1 such rows per group - and if there are none in this particular group, then the minimum of column ID . How do I

ERROR: function unnest(integer[]) does not exist in postgresql

ぃ、小莉子 提交于 2019-12-23 20:01:16
问题 SELECT UNNEST(ARRAY[1,2,3,4]) While executing the above query I got the error like this: ERROR: function unnest(integer[]) does not exist in postgresql. I am using PostgreSQL 8.3 and I have installed the _int.sql package in my db for integer array operation. How to resolve this error? 回答1: unnest() is not part of the module intarray , but of standard PostgreSQL. However, you need version 8.4 or later for that. So you can resolve this by upgrading to a more recent version, preferably the

INFO output despite “SET client_min_messages TO WARNING” just before

本小妞迷上赌 提交于 2019-12-19 05:59:45
问题 postgresql-9.0.15 on CentOS 6.5. I have a plperlu function that outputs an INFO message. I want to suppress it during testing (using psql, which also behaves as below), but I can't even seem to do it from a pgAdminIII (1.18.1 for win2003) query window: SET client_min_messages TO WARNING; select my_info_outputting_function('lalala') I run that and look in the "messages" tab, and there's my INFO message. (This may appear similar to How to suppress INFO messages when running psql scripts , but I