Re: [GENERAL] PostgreSQL 9.2 and PGBOUNCER

2013-01-08 Thread a...@hsk.hk
Hi, Thanks for your reply. Below is the pgbouncer.ini === [databases] ; use db:postgres for connection testing postgres = port=5432 dbname=postgres [pgbouncer] listen_port = 6543 listen_addr = 127.0.0.1 admin_users = postgres auth_type = md5 auth_file = users.txt server_reset_query = DISCARD

Re: [GENERAL] PostgreSQL 9.2 and PGBOUNCER

2013-01-08 Thread Birta Levente
!! Please do not top post !! On 08/01/2013 10:21, a...@hsk.hk wrote: Hi, Thanks for your reply. Below is the pgbouncer.ini === [databases] ; use db:postgres for connection testing postgres = port=5432 dbname=postgres As I said before, with this you can only connect database postgres.

Re: [GENERAL] lc_time not working? Solved.

2013-01-08 Thread J. Hondius
Thanks very much Tom and Adrian. Solved. I will RTFM better next time. Thanks again, Joek Adrian Klaver schreef: On 01/07/2013 07:56 AM, Tom Lane wrote: Adrian Klaver adrian.kla...@gmail.com writes: On 01/07/2013 06:45 AM, J. Hondius wrote: I'm not getting my PostgreSQL 9.2 to return the

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-08 Thread Stevo Slavić
In Java world, for this purpose I tend to use JPA/Hibernate with Envers http://www.jboss.org/envers - db vendor agnostic solution. Kind regards, Stevo Slavic. On Tue, Jan 8, 2013 at 6:32 AM, Craig Ringer cr...@2ndquadrant.com wrote: On 4/01/2013 12:09 AM, Adrian Klaver wrote: On 01/03/2013

Re: [GENERAL] PostgreSQL 9.2 and PGBOUNCER

2013-01-08 Thread a...@hsk.hk
On 8 Jan 2013, at 5:04 PM, Birta Levente wrote: The pooler is between client and postgresql server. So, if you want to connect through the pooler you need to connect on 6543. But I think you really need to read some documentation about pgbouncer. Thanks, I can connect to any testing DB

[GENERAL] When to run Vacuum in postgres 9.0.4

2013-01-08 Thread Anjali Arora
Hi all, I have a large dataset and I have crawled it two and three times; hence reltuples has increased. So I need some way to find out vacuum is needed on the system. Please help me in finding out some parameter or statistics which will tell me vacuum is required on the database. Regards,

[GENERAL] Questions about 9.2 unique constraints

2013-01-08 Thread a...@hsk.hk
Hi, In PostgreSQL 9.0.x we must define a constraint as DEFERRABLE on the create table, we cannot define DEFERRABLE on create table as select, how is this restriction in 9.2 now? Also, in 9.2 can deferrable uniqueness be mixed with Foreign keys? Thanks -- Sent via pgsql-general mailing

[GENERAL] Using composite types within PLPGSQL Function

2013-01-08 Thread Graeme Hinchliffe
Hi, I am trying to use a composite type within a function, I have tried SELECT INTO and direct assignment to set the value of a single element within the composite variable with no joy. I hope this is simply a case of my not knowing the correct syntax? My example code is :

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-08 Thread Wolfgang Keller
For several reasons (including operational and legal) once data are entered in a table they cannot be changed or deleted without an audit trail of the change, when it occurred, who made the change, and the reason for it. Besides the need for storing additional information that the user who

[GENERAL] Query with LIMIT but as random result set?

2013-01-08 Thread Stefan Keller
Hi I have a query like this SELECT ST_AsText(way) geom, name AS label FROM osm_point LIMIT 10; When I repeatedly do this, the result set will be always the same. I have observed this only empirically and I know that the ordering of the result set is undefined without ORDER BY. There are

Re: [GENERAL] Query with LIMIT but as random result set?

2013-01-08 Thread Adrian Klaver
On 01/08/2013 07:20 AM, Stefan Keller wrote: Hi I have a query like this SELECT ST_AsText(way) geom, name AS label FROM osm_point LIMIT 10; When I repeatedly do this, the result set will be always the same. I have observed this only empirically and I know that the ordering of the

Re: [GENERAL] Using composite types within PLPGSQL Function

2013-01-08 Thread Leif Biberg Kristensen
Tirsdag 8. januar 2013 16.10.03 skrev Graeme Hinchliffe : My example code is : CREATE TYPE testtype AS ( a INTEGER, b INTEGER ); CREATE OR REPLACE FUNCTION test() RETURNS INTEGER AS $$ DECLARE x testtype; BEGIN (x).a:=1; RETURN 1; END $$ LANGUAGE plpgsql; This throws up

Re: [GENERAL] [Solved] Corrupt indexes on slave when using pg_bulkload on master

2013-01-08 Thread James Cowell
I seem to have solved my problem, out of frustration I downloaded the source to see what I could work out (although it's a good while since I did C) and I found these comments in nbtsort-9.1.c:    * Formerly the index pages being built were kept in shared buffers, but  * that is of no value

Re: [GENERAL] Picking the first of an order in an aggregate query

2013-01-08 Thread Vincent Veyron
Le lundi 31 décembre 2012 à 20:55 -0500, Robert James a écrit : On 12/31/12, François Beausoleil franc...@teksol.info wrote: Le 2012-12-31 à 15:38, Robert James a écrit : DISTINCT is a very simple solution! But I have one problem: In addition to the FIRST fields, I also do want some

Re: [GENERAL] [postgis-users] Query with LIMIT but as random result set?

2013-01-08 Thread Stefan Keller
Hi, Thanks a lot to Adrian, Nicolas and Brooks. ... ORDER BY random() LIMIT 10; works ok. But with the following option it gets more tricky assume: And as an option the (limited) resultset should be spatially distributed (not clustered). I'm thinking about some radial spatial distribution

[GENERAL] pgxs missing magic block ... PG_MODULE_MAGIC with MODULE_big

2013-01-08 Thread David Fuhry
Hi, I'm trying to add a C-Language function but getting the following error: $ psql -f test_cfunc.sql psql:test_cfunc.sql:3: ERROR: incompatible library /usr/local/pgsql/lib/test_cfunc.so: missing magic block HINT: Extension libraries are required to use the PG_MODULE_MAGIC macro. I am calling

Re: [GENERAL] pgxs missing magic block ... PG_MODULE_MAGIC with MODULE_big

2013-01-08 Thread David Fuhry
Forgot to mention, I am on 9.2.1. SELECT version(); reports: PostgreSQL 9.2.1 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.4.5-8) 4.4.5, 64-bit -Dave On Tue, Jan 8, 2013 at 12:30 PM, David Fuhry dfu...@gmail.com wrote: Hi, I'm trying to add a C-Language function but getting the

Re: [GENERAL] pgxs missing magic block ... PG_MODULE_MAGIC with MODULE_big

2013-01-08 Thread Tom Lane
David Fuhry dfu...@gmail.com writes: Hi, I'm trying to add a C-Language function but getting the following error: $ psql -f test_cfunc.sql psql:test_cfunc.sql:3: ERROR: incompatible library /usr/local/pgsql/lib/test_cfunc.so: missing magic block HINT: Extension libraries are required to use

Re: [GENERAL] [Solved] Corrupt indexes on slave when using pg_bulkload on master

2013-01-08 Thread Tom Lane
James Cowell jcow...@btinternet.com writes: I enabled archive mode (which I didn't care about before as the database only holds 36 hours of data) and the indexes seem to replicate over fine.  I suppose the problem here is lack of documentation, but at least the code is well commented :)

Re: [GENERAL] pgxs missing magic block ... PG_MODULE_MAGIC with MODULE_big

2013-01-08 Thread David Fuhry
Thank you Tom, you are correct. Adding the line: OBJS = test_cfunc.o to the Makefile resolved the problem. -Dave On Tue, Jan 8, 2013 at 12:55 PM, Tom Lane t...@sss.pgh.pa.us wrote: David Fuhry dfu...@gmail.com writes: Hi, I'm trying to add a C-Language function but getting the following

[GENERAL] Discerning when functions had execute revoked from public

2013-01-08 Thread Todd Kover
I am trying to write something that will enumerate grants/revokes on functions to make sure they are adjusted properly after said function is drop/recreated, should that happen. This will also be used to validate that permissions are what they should be. According to:

[GENERAL] query by partial timestamp

2013-01-08 Thread Kirk Wythers
I have a column of type TIMESTAMP, I'd like to query all records from 2011. If it were text I could use a partial such as: WHERE text ~ '2011' There must be a simple way to pull the year part out of a timestamp format. Thanks in advance. -- Sent via pgsql-general mailing list

Re: [GENERAL] query by partial timestamp

2013-01-08 Thread Raymond O'Donnell
On 08/01/2013 22:19, Kirk Wythers wrote: I have a column of type TIMESTAMP, I'd like to query all records from 2011. If it were text I could use a partial such as: WHERE text ~ '2011' There must be a simple way to pull the year part out of a timestamp format. Thanks in advance. You want

Re: [GENERAL] query by partial timestamp

2013-01-08 Thread Raymond O'Donnell
On 08/01/2013 22:26, Raymond O'Donnell wrote: On 08/01/2013 22:19, Kirk Wythers wrote: I have a column of type TIMESTAMP, I'd like to query all records from 2011. If it were text I could use a partial such as: WHERE text ~ '2011' There must be a simple way to pull the year part out of a

Re: [GENERAL] query by partial timestamp

2013-01-08 Thread Rob Sargent
On 01/08/2013 03:39 PM, Raymond O'Donnell wrote: On 08/01/2013 22:26, Raymond O'Donnell wrote: On 08/01/2013 22:19, Kirk Wythers wrote: I have a column of type TIMESTAMP, I'd like to query all records from 2011. If it were text I could use a partial such as: WHERE text ~ '2011' There must be

Re: [GENERAL] query by partial timestamp

2013-01-08 Thread Steve Crawford
On 01/08/2013 02:19 PM, Kirk Wythers wrote: I have a column of type TIMESTAMP, I'd like to query all records from 2011. If it were text I could use a partial such as: WHERE text ~ '2011' There must be a simple way to pull the year part out of a timestamp format. Thanks in advance.

Re: [GENERAL] Discerning when functions had execute revoked from public

2013-01-08 Thread Tom Lane
Todd Kover kov...@omniscient.com writes: This revocation from public happens in our environment. Trouble is, I can not find where an indiciation that execute has been revoked from public in pg_catalog.pg_proc (or any other table for that matter). Is there a way to find this somewhere in the

Re: [GENERAL] query by partial timestamp

2013-01-08 Thread Gavan Schneider
On Tuesday, January 8, 2013 at 09:26, Raymond O'Donnell wrote: On 08/01/2013 22:19, Kirk Wythers wrote: I have a column of type TIMESTAMP, I'd like to query all records from 2011. If it were text I could use a partial such as: WHERE text ~ '2011' There must be a simple way to pull the year

Re: [GENERAL] query by partial timestamp

2013-01-08 Thread Tom Lane
Gavan Schneider pg-...@snkmail.com writes: From my perspective there are at least three ways to attack this problem: (I have not tested these, so apologies for the stupid syntax errors.) 1. SELECT ... WHERE 2011 = extract(YEAR FROM col_of_type_timestamp); 2. SELECT ... WHERE

Re: [GENERAL] Discerning when functions had execute revoked from public

2013-01-08 Thread Jerry Sievers
Todd, there is no auditing that will answer the question *when* (in terms of when change took place), strictly speaking. But anyway, have a look at the functions acl* and inparticular aclexplode as seen below. If I understand correctly how it works, public execute is granted in the default case

Re: [GENERAL] Discerning when functions had execute revoked from public

2013-01-08 Thread Tom Lane
Jerry Sievers gsiever...@comcast.net writes: If I understand correctly how it works, public execute is granted in the default case of no rows returned as seen in the first case AND when we get a row with grantee=0 and privilege='execute'. select (aclexplode(proacl)).* from pg_proc where

Re: [GENERAL] currval of sequence xxx_seq is not yet defined in this session?

2013-01-08 Thread kenyon
Thanks for your reply! yeath,I quite accept your opinion,once i guess the drive adds savepoint between the two SQL,but not sure i want to get the last insert id to ensure the INSERT correctly ,so i called currval(). as the error occurs seldom,i find it's difficult to trace the problem or the

[GENERAL] Installation

2013-01-08 Thread James
Hello, I was just wondering if it is possible to set the postgresql default folder to a data drive? I tried to change the default from my system drive because it was taking up far too much space, but it was having none of it and continued to install on my system drive. Regards, James. --

Re: [GENERAL] query by partial timestamp

2013-01-08 Thread Kirk Wythers
On Jan 8, 2013, at 6:48 PM, Tom Lane t...@sss.pgh.pa.us wrote: The OP didn't suggest how many years his data covers, but it's quite possible that pulling a full year's worth of data will read enough of the table that there's no point in worrying about whether an index could be used anyway.

[GENERAL] Getting PLPython to work with PostgreSQL 9.2

2013-01-08 Thread ledocf
Hi, I have recently installed PostgreSQL 9.2 on my Windows 7 64bit computer. In addition I have installed Python 3.3. I am new to PostgreSQL, and wish to play with its support for Python. I tried to run the command: CREATE EXTENSION plpython3u Only to receive the error: Could not load

[GENERAL] Error: absolute path not allowed

2013-01-08 Thread Wolf Schwurack
I am getting a repeating error and not sure what why. 2013-01-08 06:12:08 MSTERROR: absolute path not allowed 2013-01-08 06:12:08 MSTSTATEMENT: SELECT pg_read_file($1, 0, 1048576) 2013-01-08 06:42:10 MSTERROR: absolute path not allowed 2013-01-08 06:42:10 MSTSTATEMENT: SELECT pg_read_file($1,

[GENERAL] How to store clickmap points?

2013-01-08 Thread aasat
Hi, I want to store clickmap points (X, Y and hits value) for website I currently have table like this CREATE TABLE clickmap ( page_id integer, date date, x smallint, y smallint, hits integer ) But this generated about 1M rows per day. Can Postgres have better method to store this

Re: [GENERAL] Error: absolute path not allowed

2013-01-08 Thread Scott Marlowe
On Tue, Jan 8, 2013 at 8:09 AM, Wolf Schwurack w...@uen.org wrote: I am getting a repeating error and not sure what why. 2013-01-08 06:12:08 MSTERROR: absolute path not allowed 2013-01-08 06:12:08 MSTSTATEMENT: SELECT pg_read_file($1, 0, 1048576) 2013-01-08 06:42:10 MSTERROR: absolute

Re: [GENERAL] Error: absolute path not allowed

2013-01-08 Thread Raghavendra
On Tue, Jan 8, 2013 at 8:39 PM, Wolf Schwurack w...@uen.org wrote: I am getting a repeating error and not sure what why. ** ** 2013-01-08 06:12:08 MSTERROR: absolute path not allowed 2013-01-08 06:12:08 MSTSTATEMENT: SELECT pg_read_file($1, 0, 1048576) 2013-01-08 06:42:10