Re: [GENERAL] infinite recursion detected in rules for relation

2015-02-13 Thread pinker
hmm I wanted to show only rows that was inserted today, so instead of who='me' wanted to filter for instance where timestamp_column=CURRENT_DATE. Yes, a view would be a solution but I thouhgt that's the case rules were made for? Isn't it? -- View this message in context:

Re: [GENERAL] Initializing JsonbValue from cstring

2015-02-13 Thread Pavel Stehule
Hi you can call input function - jsonb_in Jsonb *targetjsonbvar = DatumGetJsonb(DirectFunctionCall1(json_in, CStringGetDatum(cstrvalue))); Regards Pavel Stehule 2015-02-13 11:32 GMT+01:00 Igor Stassiy istas...@gmail.com: Hi, Is there a way to initialize JsonbValue from cstring from

[GENERAL] Initializing JsonbValue from cstring

2015-02-13 Thread Igor Stassiy
Hi, Is there a way to initialize JsonbValue from cstring from public c api in postgres 9.4? Without the use of functions declared with PG_FUNCTION_ARGS http://doxygen.postgresql.org/fmgr_8h.html#adf4dec9b7d23f1b4c68477affde8b7ff . I posted the following question earlier, but received no reply.

[GENERAL] No repo for postgresql 9.4 for raspberry pi 2

2015-02-13 Thread seb
No 9.4 available for debian trusty, only option is to build from source. ​​ There is only i386 and amd64, no arm in postgres repo for current production debian, trusty. http://apt.postgresql.org/pub/repos/apt/dists/trusty-pgdg/9.4/ ​The debian testing jessie has 9.4 for my raspberry pi 2, which

Re: [GENERAL] segmentation fault postgres 9.3.5 core dump perlu related ?

2015-02-13 Thread Guy Helmer
On Feb 12, 2015, at 3:21 PM, Day, David d...@redcom.com wrote: Update/Information sharing on my pursuit of segmentation faults FreeBSD 10.0-RELEASE-p12 amd64 Postgres version 9.3.5 Below are three postgres core files generated from two different machine ( Georgia and Alabama ) on

[GENERAL] SELECT, GROUP BY, and aggregates

2015-02-13 Thread Ryan Delaney
Why couldn't an RDBMS such as postgres interpret a SELECT that omits the GROUP BY as implicitly grouping by all the columns that aren't part of an aggregate? If I do this, Postgres throws an exception that I cannot SELECT a series of columns including an aggregate without a corresponding GROUP BY

Re: [GENERAL] Unknown error while running postgresql_installer_dc46cfee2c\getlocales.exe

2015-02-13 Thread George Weaver
Hi Glenn, No, and neither did I receive any responses. I did find the following reference that 9.4 is officially not supported on XP, Server 2003 or Vista, however I have not seen anything official on the PostgreSQL or Enterprise DB sites.

[GENERAL] domain gets cast to a text type

2015-02-13 Thread Igor Stassiy
Hi, you might not be able to run this code, but maybe you know why is there a type conversion with domain and the concept might apply to other examples as well. I have the following code: CREATE FUNCTION get_key_jsonb(key text, j jsonb) RETURNS text LANGUAGE plv8 IMMUTABLE STRICT AS $$

Re: [GENERAL] How to hide stored procedure's bodies from specific user

2015-02-13 Thread Merlin Moncure
On Fri, Feb 13, 2015 at 5:17 AM, Saimon Lim aimon.s...@gmail.com wrote: Thanks for your help I want to restrict some postgres users as much as possible and allow them to execute a few my own stored procedures only. If I block access using: REVOKE ALL ON pg_catalog.pg_proc FROM PUBLIC;

Re: [GENERAL] segmentation fault postgres 9.3.5 core dump perlu related ?

2015-02-13 Thread Day, David
Guy, No I had not seen that bug report before. ( https://rt.perl.org/Public/Bug/Display.html?id=122199 ) We did migrate from FreeBSD 9.x (2?) and I think it true that we were not experiencing the problem at time. So it might be a good fit/explanation for our current experience There were a

Re: [GENERAL] Unknown error while running postgresql_installer_dc46cfee2c\getlocales.exe

2015-02-13 Thread Bill Moran
Purely out of curiosity ... All support for Windows XP was dropped in April of last year ... and this was many years after mainstream support was dropped (2009). What possible reason could you have for still running Windows XP? Furthermore, do you actually expect application vendors to still

Re: [GENERAL] Unknown error while running postgresql_installer_dc46cfee2c\getlocales.exe

2015-02-13 Thread Bald, Glenn
I would not be using xp if I had a choice. Actually would not be using Windows if I had my own way. Its all to do with Legacy systems. I have installed 9.3.6.1. which should be fine. This seem to be working, or it has installed. I will test when I get the time. -Original Message-

Re: [GENERAL] Collection

2015-02-13 Thread Pavel Stehule
2015-02-13 14:13 GMT+01:00 Ramesh T rameshparnandit...@gmail.com: COLLECT Hi Depends on what you needs. The collections are not supported by PostgreSQL - use a arrays instead. http://www.postgresql.org/docs/9.4/static/arrays.html Regards Pavel Stehule

Re: [GENERAL] infinite recursion detected in rules for relation

2015-02-13 Thread David G Johnston
User created rules are almost never the correct solution. There are too many cavets and views can accomplish nearly everything that a user might want. David J. On Friday, February 13, 2015, pinker [via PostgreSQL] ml-node+s1045698n583782...@n5.nabble.com wrote: hmm I wanted to show only rows

[GENERAL] Collection

2015-02-13 Thread Ramesh T
cast(COLLECT (r_id) as num) in oracle.. is their *collect *function in postgres plpgsql?or any alternate for this..? thanks in advance,

Re: [GENERAL] What's a reasonable maximum number for table partitions?

2015-02-13 Thread Bill Moran
On Fri, 13 Feb 2015 11:12:13 -0500 Vick Khera vi...@khera.org wrote: On Thu, Feb 12, 2015 at 7:44 PM, Tim Uckun timuc...@gmail.com wrote: Does anybody have experience with huge number of partitions if so where did you start running into trouble? I use an arbitrary 100-way split for a

Re: [GENERAL] What's a reasonable maximum number for table partitions?

2015-02-13 Thread Vick Khera
On Fri, Feb 13, 2015 at 11:29 AM, Seref Arikan serefari...@kurumsalteknoloji.com wrote: Hi Bill, Could you point at some resource(s) that discuss inserting directly into the partition? Would it be possible to read directly from the partition as well? When preparing your SQL statement, you

Re: [GENERAL] What's a reasonable maximum number for table partitions?

2015-02-13 Thread Seref Arikan
Thanks, google it is then ;) On Fri, Feb 13, 2015 at 4:31 PM, Bill Moran wmo...@potentialtech.com wrote: On Fri, 13 Feb 2015 16:29:02 + Seref Arikan serefari...@kurumsalteknoloji.com wrote: Hi Bill, Could you point at some resource(s) that discuss inserting directly into the

Re: [GENERAL] infinite recursion detected in rules for relation

2015-02-13 Thread David G Johnston
On Fri, Feb 13, 2015 at 8:24 AM, pinker [via PostgreSQL] ml-node+s1045698n583786...@n5.nabble.com wrote: Ok, but in this particular case I don't see any caveats ​You mean other than the infinite recursion, right?​ and think that could be classic case for rule to be used. If it is almost

Re: [GENERAL] What's a reasonable maximum number for table partitions?

2015-02-13 Thread Seref Arikan
Hi Bill, Could you point at some resource(s) that discuss inserting directly into the partition? Would it be possible to read directly from the partition as well? Regards Seref On Fri, Feb 13, 2015 at 4:15 PM, Bill Moran wmo...@potentialtech.com wrote: On Fri, 13 Feb 2015 11:12:13 -0500 Vick

Re: [GENERAL] What's a reasonable maximum number for table partitions?

2015-02-13 Thread Seref Arikan
Ah, I should have thought that it would be simple. Thanks a lot Vick. Regards Seref On Fri, Feb 13, 2015 at 4:54 PM, Vick Khera vi...@khera.org wrote: On Fri, Feb 13, 2015 at 11:29 AM, Seref Arikan serefari...@kurumsalteknoloji.com wrote: Hi Bill, Could you point at some resource(s) that

Re: [GENERAL] Collection

2015-02-13 Thread Raymond O'Donnell
On 13/02/2015 13:13, Ramesh T wrote: cast(COLLECT (r_id) as num) in oracle.. is their *collect *function in postgres plpgsql?or any alternate for this..? I don't use Oracle, but I think array_agg() is the closest - it aggregates the column into an array. postgres=# create table test(a

Re: [GENERAL] infinite recursion detected in rules for relation

2015-02-13 Thread pinker
Ok, but in this particular case I don't see any caveats and think that could be classic case for rule to be used. If it is almost never the correct solution why rules still exists at all? -- View this message in context:

Re: [GENERAL] What's a reasonable maximum number for table partitions?

2015-02-13 Thread Bill Moran
On Fri, 13 Feb 2015 16:29:02 + Seref Arikan serefari...@kurumsalteknoloji.com wrote: Hi Bill, Could you point at some resource(s) that discuss inserting directly into the partition? Not off the top of my head, I would have to google just like you would. Would it be possible to read

Re: [GENERAL] What's a reasonable maximum number for table partitions?

2015-02-13 Thread Vick Khera
On Thu, Feb 12, 2015 at 7:44 PM, Tim Uckun timuc...@gmail.com wrote: Does anybody have experience with huge number of partitions if so where did you start running into trouble? I use an arbitrary 100-way split for a lot of tracking info. Just modulo 100 on the ID column. I've never had any

Re: [GENERAL] SELECT, GROUP BY, and aggregates

2015-02-13 Thread Bill Moran
Ryan Delaney ryan.dela...@gmail.com writes: Why couldn't an RDBMS such as postgres interpret a SELECT that omits the GROUP BY as implicitly grouping by all the columns that aren't part of an aggregate? I'm Mr. Curious today ... Why would you think that such a thing is necessary or

Re: [GENERAL] SELECT, GROUP BY, and aggregates

2015-02-13 Thread Jeff Janes
On Fri, Feb 13, 2015 at 10:26 AM, Bill Moran wmo...@potentialtech.com wrote: Ryan Delaney ryan.dela...@gmail.com writes: Why couldn't an RDBMS such as postgres interpret a SELECT that omits the GROUP BY as implicitly grouping by all the columns that aren't part of an aggregate? I'm

[GENERAL] Contrib build fault for pgdg postgres 9.2 at debian 6 (squeeze)

2015-02-13 Thread Sergey Burladyan
Hello All! I install postgresql-server-dev-9.2 from 'deb http://apt.postgresql.org/pub/repos/apt/ squeeze-pgdg main' and try to build contrib module from 9.2 but it fault with error: $ make USE_PGXS=1 PG_CONFIG=/usr/lib/postgresql/9.2/bin/pg_config gcc -g -O2 -I/usr/include/mit-krb5 -fPIC

Re: [GENERAL] SELECT, GROUP BY, and aggregates

2015-02-13 Thread Tom Lane
Ryan Delaney ryan.dela...@gmail.com writes: Why couldn't an RDBMS such as postgres interpret a SELECT that omits the GROUP BY as implicitly grouping by all the columns that aren't part of an aggregate? Per SQL standard, a SELECT with aggregates but no GROUP BY is supposed to give exactly one

Re: [GENERAL] Contrib build fault for pgdg postgres 9.2 at debian 6 (squeeze)

2015-02-13 Thread Tom Lane
Sergey Burladyan eshkin...@gmail.com writes: I install postgresql-server-dev-9.2 from 'deb http://apt.postgresql.org/pub/repos/apt/ squeeze-pgdg main' and try to build contrib module from 9.2 but it fault with error: $ make USE_PGXS=1 PG_CONFIG=/usr/lib/postgresql/9.2/bin/pg_config gcc

Re: [GENERAL] SELECT, GROUP BY, and aggregates

2015-02-13 Thread Bill Moran
On Fri, 13 Feb 2015 10:48:13 -0800 Jeff Janes jeff.ja...@gmail.com wrote: On Fri, Feb 13, 2015 at 10:26 AM, Bill Moran wmo...@potentialtech.com wrote: Ryan Delaney ryan.dela...@gmail.com writes: Why couldn't an RDBMS such as postgres interpret a SELECT that omits the GROUP BY as

[GENERAL] How can I refer to an ANYELEMENT variable in postgresql dynamic SQL?

2015-02-13 Thread Christopher Currie
Cross-posting from stackoverflow in the hope of getting some additional eyes on the question. http://stackoverflow.com/questions/28505782/how-can-i-refer-to-an-anyelement-variable-in-postgresql-dynamic-sql I'm trying to write a PostgreSQL function for table upserts that can be used for any

Re: [GENERAL] SELECT, GROUP BY, and aggregates

2015-02-13 Thread Peter Eisentraut
On 2/13/15 1:48 PM, Jeff Janes wrote: I waste an inordinate amount of time retyping select lists over into the group by list, or copying and pasting and then deleting the aggregate clauses. It is an entirely pointless exercise. I can't fault PostgreSQL for following the standard, but its too

Re: [GENERAL] SELECT, GROUP BY, and aggregates

2015-02-13 Thread Brian Dunavant
To lower the amount of time spent copy pasting aggregate column names, it's probably worth noting Postgres will allow you to short cut that with the column position. For example: select long_column_name_A, long_column_name_b, count(1) from foo group by 1,2 order by 1,2 This works just fine.

Re: [GENERAL] SELECT, GROUP BY, and aggregates

2015-02-13 Thread Igor Neyman
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Brian Dunavant Sent: Friday, February 13, 2015 2:11 PM To: Bill Moran Cc: Jeff Janes; Ryan Delaney; pgsql-general@postgresql.org Subject: Re: [GENERAL] SELECT, GROUP BY,

Re: [GENERAL] Unknown error while running postgresql_installer_dc46cfee2c\getlocales.exe

2015-02-13 Thread George Weaver
- Original Message - Purely out of curiosity ... All support for Windows XP was dropped in April of last year ... and this was many years after mainstream support was dropped (2009). What possible reason could you have for still running Windows XP? Furthermore, do you actually

Re: [GENERAL] What's a reasonable maximum number for table partitions?

2015-02-13 Thread Bill Moran
On Sat, 14 Feb 2015 11:14:10 +1300 Tim Uckun timuc...@gmail.com wrote: If I used modulo arithmetic how would the query optimizer know which table to include and exclude? For example say I did modulo 100 based on the field client_id. I create a base table with the trigger to insert the data

Re: [GENERAL] SELECT, GROUP BY, and aggregates

2015-02-13 Thread John McKown
I will take a bit of a contrarian position from the OP. I, personally, prefer that computer _languages_ do exactly and only what _I_ tell them to do. I do _NOT_ want them to things for me. IMO, that is why many programs are unreliable. They make an assumption which is not what the original

Re: [GENERAL] Hardware requirements for a PostGIS server

2015-02-13 Thread Mathieu Basille
Thanks to Gavin and Alban for additional considerations, all very useful. As for Linux, I have to admit that I am biased too! I use it heavily, which is the reason I would incline for its use. But after all, since I'm not going to administrate the server, the best choice will probably be IT

Re: [GENERAL] [HACKERS] question on Postgres smart shutdown mode

2015-02-13 Thread Jim Nasby
On 2/12/15 5:46 PM, Bo Tian wrote: I have a question on PG smart shutdown mode. When shutdown Postgres by issuing /Smart Shutdown /mode (SIGTERM) request, is there a way for client to be notified of this shutdown event? I tried PG_NOTIFY, but I cannot get any notification events when this

Re: [GENERAL] What's a reasonable maximum number for table partitions?

2015-02-13 Thread Bill Moran
On Sat, 14 Feb 2015 11:27:52 +1300 Tim Uckun timuc...@gmail.com wrote: This might get pretty crazy if I am doing queries like WHERE client_id in () or when I am trying to join some table with the client table. Maybe I can precalculate the ids that are going to go into each partition and set

Re: [GENERAL] What's a reasonable maximum number for table partitions?

2015-02-13 Thread Tim Uckun
This might get pretty crazy if I am doing queries like WHERE client_id in () or when I am trying to join some table with the client table. Maybe I can precalculate the ids that are going to go into each partition and set the constraint as where client_id in (some_huge_list). On Sat, Feb 14,

Re: [GENERAL] Question on session_replication_role

2015-02-13 Thread Vasudevan, Ramya
Here's the part that's slow. The index scan on each partition is taking ~2.5ms, and is being repeated 1847 times *for each partition*. What is the table partitioned on? The table is partitioned on registration_id. CREATE TABLE emailsubscription.reg_email_subscriptions_p00 (

[GENERAL] Re: How can I refer to an ANYELEMENT variable in postgresql dynamic SQL?

2015-02-13 Thread David G Johnston
Christopher Currie wrote Cross-posting from stackoverflow in the hope of getting some additional eyes on the question. http://stackoverflow.com/questions/28505782/how-can-i-refer-to-an-anyelement-variable-in-postgresql-dynamic-sql update_stmt := format( 'UPDATE %s SET %s WHERE %s',

Re: [GENERAL] What's a reasonable maximum number for table partitions?

2015-02-13 Thread Tim Uckun
If I used modulo arithmetic how would the query optimizer know which table to include and exclude? For example say I did modulo 100 based on the field client_id. I create a base table with the trigger to insert the data into the proper child table. Each table has the constraint (client_id % 100)

Re: [GENERAL] How to hide stored procedure's bodies from specific user

2015-02-13 Thread Saimon Lim
Thanks for your help I want to restrict some postgres users as much as possible and allow them to execute a few my own stored procedures only. If I block access using: REVOKE ALL ON pg_catalog.pg_proc FROM PUBLIC; REVOKE ALL ON FUNCTION pg_catalog.pg_get_functiondef(oid) FROM PUBLIC; the user

[GENERAL] Unknown error while running postgresql_installer_dc46cfee2c\getlocales.exe

2015-02-13 Thread Bald, Glenn
Hi George, Did you find a resolution? I have exactly the same problem. Same postgres version, same xp with sp3, same error log. Thanks in advance Glenn Glenn Bald | GIS Analyst | Information Services Forestry Commission Unknown error while running

[GENERAL] increasing varchar column size is taking too much time

2015-02-13 Thread AI Rumman
Hi, I started the following query in Postgresql 9.1 where only this sql is running on the host and it has been taking more than an hour and still running. alter table userdata.table1 alter column name type varchar(512); Here is the table description: d+ userdata.table1