postgresql-9.0

INFO output despite “SET client_min_messages TO WARNING” just before

孤人 提交于 2019-12-01 04:46:30
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 don't want to disable INFO messages for my whole session, just part of it and then set the minimum

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-11-28 14:16:35
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 sudden I started having this error come up. I read many blogs about this error and tried to remove it but

Check if value exists in Postgres array

扶醉桌前 提交于 2019-11-26 15:02:37
I need a way to test if a value exists in a given array. So far I came up with something like this select '{1,2,3}'::int[] @> (ARRAY[]::int[] || value_variable::int) but I keep thinking there should be a simpler way to this, I just cant see it. Edit: Just realized I could do this select '{1,2,3}'::int[] @> ARRAY[value_variable::int] This is much better and I believe will suffice, but if you have other ways to do it please share. Erwin Brandstetter Simpler with the ANY construct : SELECT value_variable = ANY ('{1,2,3}'::int[]) The right operand of ANY (between parentheses) can either be a set

Check if value exists in Postgres array

旧时模样 提交于 2019-11-26 03:49:07
问题 I need a way to test if a value exists in a given array. So far I came up with something like this select \'{1,2,3}\'::int[] @> (ARRAY[]::int[] || value_variable::int) but I keep thinking there should be a simpler way to this, I just cant see it. Edit: Just realized I could do this select \'{1,2,3}\'::int[] @> ARRAY[value_variable::int] This is much better and I believe will suffice, but if you have other ways to do it please share. 回答1: Simpler with the ANY construct: SELECT value_variable =