Re: [GENERAL] rights for schema

2012-12-31 Thread Philipp Kraus
Am 31.12.2012 um 02:11 schrieb Adrian Klaver: > On 12/30/2012 04:06 PM, Christian Hammers wrote: >> Am Sun, 30 Dec 2012 15:54:32 +0100 >> schrieb Philipp Kraus : >> >>> Hello, >>> >>> can I set all rights to a schema and its content? I have different >>> schema and in the public schema all user

Re: [GENERAL] rights for schema

2012-12-31 Thread Philipp Kraus
Am 31.12.2012 um 02:11 schrieb Adrian Klaver: > On 12/30/2012 04:06 PM, Christian Hammers wrote: >> Am Sun, 30 Dec 2012 15:54:32 +0100 >> schrieb Philipp Kraus : >> >>> Hello, >>> >>> can I set all rights to a schema and its content? I have different >>> schema and in the public schema all user

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

2012-12-31 Thread Robert James
I have a query SELECT grouping_field, MIN(field_a), MIN(field_b) FROM ... GROUP BY grouping_field But, instead of picking the MIN field_a and MIN field_b, I'd like to pick field_a and field_b from the first record, according to an order I'll specify. In pseudo-SQL, it would be something li

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

2012-12-31 Thread Jack Christensen
On 12/31/2012 8:33 AM, Robert James wrote: I have a query SELECT grouping_field, MIN(field_a), MIN(field_b) FROM ... GROUP BY grouping_field But, instead of picking the MIN field_a and MIN field_b, I'd like to pick field_a and field_b from the first record, according to an order I'll s

Re: [GENERAL] rights for schema

2012-12-31 Thread Adrian Klaver
On 12/31/2012 05:41 AM, Philipp Kraus wrote: Am 31.12.2012 um 02:11 schrieb Adrian Klaver: Actually as of 9.0 that is not strictly true: http://www.postgresql.org/docs/9.2/interactive/sql-alterdefaultprivileges.html I have create a view for access a table and rules for modifiy the based t

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

2012-12-31 Thread Tom Lane
Jack Christensen writes: > On 12/31/2012 8:33 AM, Robert James wrote: >> SELECT grouping_field, FIRST(field_a), FIRST(field_b) >> FROM ... >> ORDER BY field_c DESC, field_d ASC, myfunc(field_e) ASC >> GROUP BY grouping_field >> >> How can I do that with Postgres? > select distinct on (grouping_f

Re: [GENERAL] UNION and pg_restore

2012-12-31 Thread Tom Lane
Bryan Lee Nuse writes: >> Now you're doubtless wondering why Postgres doesn't dodge this ambiguity >> for you. > This is exactly what I was wondering, of course. And I follow the reasoning > behind why it cannot, at present. If Postgres can't ensure that the view > definition is valid SQL, t

Re: [GENERAL] rights for schema

2012-12-31 Thread Philipp Kraus
Am 31.12.2012 um 15:54 schrieb Adrian Klaver: > On 12/31/2012 05:41 AM, Philipp Kraus wrote: >> >> Am 31.12.2012 um 02:11 schrieb Adrian Klaver: >> > >>> >>> Actually as of 9.0 that is not strictly true: >>> http://www.postgresql.org/docs/9.2/interactive/sql-alterdefaultprivileges.html >> >>

Re: [GENERAL] rights for schema

2012-12-31 Thread Philipp Kraus
Am 31.12.2012 um 18:02 schrieb Philipp Kraus: > > Am 31.12.2012 um 15:54 schrieb Adrian Klaver: > >> On 12/31/2012 05:41 AM, Philipp Kraus wrote: >>> >>> Am 31.12.2012 um 02:11 schrieb Adrian Klaver: >>> >> Actually as of 9.0 that is not strictly true: http://www.postgresql.o

[GENERAL] Permission for relationship but not for select is possible?

2012-12-31 Thread Edson Richter
I would like to have two schemas: MyDB.sales MyDB.security Users that have rights in sales schema should be able to select/insert/update/delete. The same users must have rights to check foreign keys against users table (but they are now allowed to execute select on this table). Is that possib

[GENERAL] trigger on adding / deleting / modify user on pg_authid

2012-12-31 Thread Philipp Kraus
Hello, can I create on PG 9.1 or newer a trigger or something other, that runs a function if a new user is added, changed, deleted to / on the database? I have got a "usertable" which stores some additional user information (full name, mail address, etc) and I would like to create default data i

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

2012-12-31 Thread Robert James
DISTINCT is a very simple solution! But I have one problem: In addition to the FIRST fields, I also do want some aggregate functions. More accurately, it would be: SELECT grouping_field, FIRST(field_a), FIRST(field_b), SUM(field_x), MAX(field_y) ... How should I do that? Should I do two queries

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

2012-12-31 Thread François Beausoleil
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 aggregate functions. More accurately, it would be: > > SELECT grouping_field, FIRST(field_a), FIRST(field_b), SUM(field_x), > MAX(

Re: [GENERAL] Insert Assertion Failed in strcoll_l.c:112

2012-12-31 Thread Tom Lane
Michael Arnold writes: > The locale is the same on both machines: "en_SG.UTF-8" > I've extracted the smallest set of code which still produces the > error. Unfortunately its still more than 1000 lines of code, as > without the thread and connection pools the error goes away. If only > 1 thread

Re: [GENERAL] rights for schema

2012-12-31 Thread Adrian Klaver
On 12/31/2012 09:02 AM, Philipp Kraus wrote: Am 31.12.2012 um 15:54 schrieb Adrian Klaver: On 12/31/2012 05:41 AM, Philipp Kraus wrote: Am 31.12.2012 um 02:11 schrieb Adrian Klaver: Actually as of 9.0 that is not strictly true: http://www.postgresql.org/docs/9.2/interactive/sql-alterdef

Re: [GENERAL] rights for schema

2012-12-31 Thread Philipp Kraus
Am 31.12.2012 um 22:18 schrieb Adrian Klaver: > On 12/31/2012 09:02 AM, Philipp Kraus wrote: >> >> Am 31.12.2012 um 15:54 schrieb Adrian Klaver: >> >>> On 12/31/2012 05:41 AM, Philipp Kraus wrote: Am 31.12.2012 um 02:11 schrieb Adrian Klaver: >>> > > Actually as of 9.

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

2012-12-31 Thread Robert James
On 12/31/12, François Beausoleil 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 aggregate functions. More accurately, it would be: >> >> SELECT grouping_field, FIR