Re: [GENERAL] How does connect privilege works?

2012-08-07 Thread Craig Ringer
On 08/07/2012 11:51 AM, Shridhar Daithankar wrote: testdb2=# revoke connect ON database testdb2 FROM testuser1; REVOKE You can't revoke a permission that isn't set. PostgreSQL doesn't have explicit deny rules, so you can only remove a grant. The documentation on databases doesn't seem to

[GENERAL] JSON in 9.2: limitations

2012-08-07 Thread Craig Ringer
(Reposted as the list manager appears to have eaten the first copy): Hey all It seems to be surprisingly hard to build JSON structures with PostgreSQL 9.2's json features, because: - There's no aggregate, function or operator that merges two or more objects; and - there's no single-value

Re: [GENERAL] How does connect privilege works?

2012-08-07 Thread Albe Laurenz
Shridhar Daithankar wrote: I am trying to setup a cluster for trac databases and want to isolate each db, by assigning a specific user to a DB. I followed the documentation but as shown in the following example, limiting access by connect does not seem to be working. What am I missing?

Re: [GENERAL] warnings about invalid search_path

2012-08-07 Thread Gabriele Bartolini
Hi Samba, first: do not worry, it is perfectly normal. On Tue, 7 Aug 2012 16:25:14 +0530, Samba saas...@gmail.com wrote: Hi all, I'm seeing some weired errors in the postgres logs after upgrading to postgres-9.1(.3) about the schema added by default to search patch WARNING:  invalid value

[GENERAL] Memory error in user-defined aggregation function

2012-08-07 Thread Adriaan Joubert
Hi, I've implemented an aggregation function to compute quartiles in C borrowing liberally from orafce code. I uses this code in a windowing context and it worked fine until today - and I'm not sure what changed. This is on 9.1.2 and I have also tried it on 9.1.4. What I have determined so far

[GENERAL] Interval 1 month is equals to interval 30 days - WHY?

2012-08-07 Thread Dmitry Koterov
Hello. I've just discovered a very strange thing: SELECT '1 mon'::interval = '30 days'::interval -- TRUE??? This returns TRUE (also affected when I create an unique index using an interval column). Why? I know that Postgres stores monthes, days and seconds in interval values separately. So

Re: [GENERAL] Clogging problem

2012-08-07 Thread Marek Kielar
Dnia 6 sierpnia 2012 17:00 Adrian Klaver adrian.kla...@gmail.com napisał(a): The clog has somewhat re-formed - the full listing of lsof (filtered for unique files) for postmaster(s) on the database mount is here: http://BillionUploads.com/ya9kjv78t9es/postmaster_files_sorted.csv.html

Re: [GENERAL] Interval 1 month is equals to interval 30 days - WHY?

2012-08-07 Thread Dmitry Koterov
...and even worse: SELECT ('1 year'::interval) = ('360 days'::interval); -- TRUE :-) SELECT ('1 year'::interval) = ('365 days'::interval); -- FALSE :-) On Tue, Aug 7, 2012 at 4:42 PM, Dmitry Koterov dmi...@koterov.ru wrote: Hello. I've just discovered a very strange thing: SELECT '1

Re: [GENERAL] Where is diskchecker.pl ?

2012-08-07 Thread Magnus Hagander
On Mon, Aug 6, 2012 at 6:54 PM, Rodrigo Gonzalez lis...@estrads.com.ar wrote: On 06/08/12 13:31, Bruce Momjian wrote: For longer terms, perhaps we should set up an URL forwarder or something that the docs can link through in the cases where we really need this, so we can more easily update the

[GENERAL] pg_xlog growth on slave with streaming replication

2012-08-07 Thread Mike Roest
Hey Everyone, I've got a bit of an interesting issue going on with pg_xlog growing on a streaming replication slave. We're running postgres 9.1.1 x64 built from source on Centos 5.8 x64. On both the master and the slave we have wal_keep_segments configured for 1000 wal_keep_segments = 1000

Re: [GENERAL] warnings about invalid search_path

2012-08-07 Thread Samba
Thanks Gabriele for those pointers, I could now narrow it down to two things: 1. system_data user logging into other databases [one of those may be the default 'postgres'] which does not have system_data schema 2. other users [like 'postgres'] logging into their own or even other

[GENERAL] Are stored procedures always kept in memory?

2012-08-07 Thread Roman Golis
We run several instances of postgre in different countries, and we try keeping them as same as possible, in terms of structure of the tables and function definitions (except the content of schema config, which differs between dbs). So if we need to implement some different algorithm per

Re: [GENERAL] warnings about invalid search_path

2012-08-07 Thread Tom Lane
Samba saas...@gmail.com writes: I'm seeing some weired errors in the postgres logs after upgrading to postgres-9.1(.3) about the schema added by default to search patch WARNING: invalid value for parameter search_path: system_data DETAIL: schema system_data does not exist ... Could anyone

Re: [GENERAL] Are stored procedures always kept in memory?

2012-08-07 Thread Pavel Stehule
Hello Now my questions is: Are the stored functions (both plpgsql and plain sql functions) kept always in a memory? Or they are stored similarly like tables, on the disk, reading them into memory when called and possibly release them from memory, if memory is needed for something else?

Re: [GENERAL] warnings about invalid search_path

2012-08-07 Thread Albe Laurenz
Samba wrote: I'm seeing some weired errors in the postgres logs after upgrading to postgres-9.1(.3) about the schema added by default to search patch WARNING: invalid value for parameter search_path: system_data DETAIL: schema system_data does not exist We do have a user named

Re: [GENERAL] warnings about invalid search_path

2012-08-07 Thread Samba
Hi all, I now realize that the issue is indeed occurring when users who have system_data in their search_path log in to other databases that does not have that schema. Could someone explain how to add schema(s) into search_path for a database [not to user/role] irrespective of whichever user

Re: [GENERAL] warnings about invalid search_path

2012-08-07 Thread Scott Marlowe
On Tue, Aug 7, 2012 at 7:15 AM, Samba saas...@gmail.com wrote: Thanks Gabriele for those pointers, I could now narrow it down to two things: system_data user logging into other databases [one of those may be the default 'postgres'] which does not have system_data schema other users [like

Re: [GENERAL] Memory error in user-defined aggregation function

2012-08-07 Thread Tom Lane
Adriaan Joubert adriaan.joub...@gmail.com writes: I've implemented an aggregation function to compute quartiles in C borrowing liberally from orafce code. I uses this code in a windowing context and it worked fine until today - and I'm not sure what changed. This is on 9.1.2 and I have also

Re: [GENERAL] Memory error in user-defined aggregation function

2012-08-07 Thread Adriaan Joubert
Hi, Finally got this running under the debugger and figured out what is going on. I had been under the impression that if (PG_ARGISNULL(0)) PG_RETURN_NULL(); state = (quartile_state *) PG_GETARG_POINTER(0); would ensure that state was never a null pointer.

[GENERAL] Interval to months

2012-08-07 Thread Aram Fingal
I have a field which contains an interval value and I sometimes need to represent the full interval (not a part) as a decimal number of months. For example, 5 years 6 mons 3 days as 66.1 months. I've been trying to figure out how to do this and haven't found a definitive answer. The

Re: [GENERAL] Interval to months

2012-08-07 Thread Steve Atkins
On Aug 7, 2012, at 8:41 AM, Aram Fingal fin...@multifactorial.com wrote: I have a field which contains an interval value and I sometimes need to represent the full interval (not a part) as a decimal number of months. For example, 5 years 6 mons 3 days as 66.1 months. I've been trying to

[GENERAL] Feature Request - Postgres FDW

2012-08-07 Thread David Greco
Surprised to see this isn't offered as a Foreign Data Wrapper- one to other Postgres servers. I was attempting to replace some uses I have of dbilink, and found a couple places where I am using it to connect to Postgres. One is for pseudo Autonomous Transactions- a db link to the same postgres

Re: [GENERAL] JSON in 9.2: limitations

2012-08-07 Thread Merlin Moncure
On Tue, Aug 7, 2012 at 3:20 AM, Craig Ringer ring...@ringerc.id.au wrote: (Reposted as the list manager appears to have eaten the first copy): Hey all It seems to be surprisingly hard to build JSON structures with PostgreSQL 9.2's json features, because: - There's no aggregate, function or

Re: [GENERAL] can we avoid pg_basebackup on planned switches?

2012-08-07 Thread Fujii Masao
On Mon, Aug 6, 2012 at 3:29 AM, Ben Chobot be...@silentmedia.com wrote: On Aug 5, 2012, at 11:12 AM, Fujii Masao wrote: On Sat, Jul 28, 2012 at 2:00 AM, Ben Chobot be...@silentmedia.com wrote: We make heavy use of streaming replication on PG 9.1 and it's been great for us. We do have one

Re: [GENERAL] Feature Request - Postgres FDW

2012-08-07 Thread Kevin Grittner
David Greco david_gr...@harte-hanks.com wrote: Surprised to see this isn't offered as a Foreign Data Wrapper- one to other Postgres servers. People have been working on it. It seems quite likely to be included in the 9.3 release next year. -Kevin -- Sent via pgsql-general mailing list

Re: [GENERAL] Feature Request - Postgres FDW

2012-08-07 Thread Andreas Kretschmer
Kevin Grittner kevin.gritt...@wicourts.gov wrote: David Greco david_gr...@harte-hanks.com wrote: Surprised to see this isn't offered as a Foreign Data Wrapper- one to other Postgres servers. People have been working on it. It seems quite likely to be included in the 9.3 release next

Re: [GENERAL] Feature Request - Postgres FDW

2012-08-07 Thread David Greco
Great thanks. I see there is talk of 9.3 including autonomous transaction support as well. -Original Message- From: Kevin Grittner [mailto:kevin.gritt...@wicourts.gov] Sent: Tuesday, August 07, 2012 1:04 PM To: David Greco; pgsql-general@postgresql.org Subject: Re: [GENERAL] Feature

Re: [GENERAL] can we avoid pg_basebackup on planned switches?

2012-08-07 Thread Ben Chobot
On Aug 7, 2012, at 9:32 AM, Fujii Masao wrote: On Mon, Aug 6, 2012 at 3:29 AM, Ben Chobot be...@silentmedia.com wrote: Oh, I would have though that doing a clean shutdown of the old master (step 1) would have made sure that all the unstreamed wal records would be flushed to any connected

Re: [GENERAL] can we avoid pg_basebackup on planned switches?

2012-08-07 Thread Sergey Konoplev
On Sun, Aug 5, 2012 at 10:12 PM, Fujii Masao masao.fu...@gmail.com wrote: Have we just avoided running pg_basebackup, or have we just given ourselves data corruption? If you change your operations in the above-mentioned way, I think you can avoid pg_basebackup on the planned switch. I've not

Re: [GENERAL] JSON in 9.2: limitations

2012-08-07 Thread Merlin Moncure
On Tue, Aug 7, 2012 at 11:31 AM, Merlin Moncure mmonc...@gmail.com wrote: On Tue, Aug 7, 2012 at 3:20 AM, Craig Ringer ring...@ringerc.id.au wrote: (Reposted as the list manager appears to have eaten the first copy): Hey all It seems to be surprisingly hard to build JSON structures with

[GENERAL] Using Insert with case

2012-08-07 Thread Bob Pawley
Hi select case when somevariable = 2 then (insert into pipe (line) select bob.edge_data.edge_id from bob.edge_data, bob.node, pipe where st_intersects(st_startpoint(bob.edge_data.geom), bob.node.geom) and bob.node.node_id = 415 and pipe.id = 1) I am

Re: [GENERAL] Using Insert with case

2012-08-07 Thread Chris Angelico
On Wed, Aug 8, 2012 at 8:26 AM, Bob Pawley rjpaw...@shaw.ca wrote: Hi select case when somevariable = 2 then (insert into pipe (line) ... I am attempting to use the above. However, with or without the enclosing brackets I get a syntax error on the word into. Utterly untested, but does

Re: [GENERAL] Using Insert with case

2012-08-07 Thread Alban Hertroys
On 8 Aug 2012, at 24:26, Bob Pawley wrote: Hi select case when somevariable = 2 then (insert into pipe (line) select bob.edge_data.edge_id from bob.edge_data, bob.node, pipe where st_intersects(st_startpoint(bob.edge_data.geom), bob.node.geom) and

Re: [GENERAL] Using Insert with case

2012-08-07 Thread Bob Pawley
Hi Alban Probably no difference except I have four cases and I was trying, in an attempt to save processing time, to compact commands a little. Bob -Original Message- From: Alban Hertroys Sent: Tuesday, August 07, 2012 3:40 PM To: Bob Pawley Cc: Postgresql Subject: Re: [GENERAL]

Re: [GENERAL] Using Insert with case

2012-08-07 Thread David Johnston
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Bob Pawley Sent: Tuesday, August 07, 2012 6:26 PM To: Postgresql Subject: [GENERAL] Using Insert with case Hi   select case when somevariable = 2     then (insert into pipe (line)     select

[GENERAL] PostgreSQL 9.1 product code

2012-08-07 Thread Haiming Zhang
Hi all, I am Haiming, a software engineer. One of our product is depending on PostgreSQL. We know the product code for 8.2 and 8.3 is {B823632F-3B72-4514-8861-B961CE263224}. Anyone who knows the product code for postresql 9.1 could you please provide it and how can we find the product code

Re: [GENERAL] Problem running ALTER TABLE..., ALTER TABLE waiting

2012-08-07 Thread Sergey Konoplev
On Wed, Aug 8, 2012 at 3:03 AM, Brian McNally bmcna...@uw.edu wrote: [root@gvsdb-dev tmp]# gdb /usr/pgsql-9.0/bin/postmaster 1160 GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-32.el5_6.2) (gdb) bt #0 0x00378f8d5497 in semop () from /lib64/libc.so.6 #1 0x005bc1c3 in

Re: [GENERAL] JSON in 9.2: limitations

2012-08-07 Thread Craig Ringer
On 08/08/2012 03:45 AM, Merlin Moncure wrote: Given that you can do that, if you had the ability to emit json from an hstore the OP's problem would be trivially handled. That's where my thinking went at first too, but there's a wrinkle with that: json represents the number 1 and the string 1

Re: [GENERAL] PostgreSQL 9.1 product code

2012-08-07 Thread Craig Ringer
On 08/08/2012 08:17 AM, Haiming Zhang wrote: Hi all, I am Haiming, a software engineer. One of our product is depending on PostgreSQL. We know the product code for 8.2 and 8.3 is {B823632F-3B72-4514-8861-B961CE263224}. Anyone who knows the product code for postresql 9.1 could you please

Re: [GENERAL] timestamp with timezone and time zone name

2012-08-07 Thread Shridhar Daithankar
On Tuesday 07 Aug 2012 12:21:04 AM Tom Lane wrote: Shridhar Daithankar ghodech...@ghodechhap.net writes: I am wondering, why following two values result in a shift by 3.5 hours. I would expect them to be identical. I understand that canonical time zone names could be ambiguous at times