Re: [SQL] How to get all users under a group

2006-09-13 Thread Emi Lu
To answer my own question: SELECT g.groname , u.usename AS "User name" FROM pg_catalog.pg_user u left join pg_catalog.pg_group g on(u.usesysid = ANY(g.grolist)) ORDER BY 1, 2; I know \du+ can get all group info for each user. Could someone tell me how to get all users under each group plea

[SQL] Aggregates with internal state type?

2006-09-13 Thread Markus Schaber
Hi, The PostgreSQL allows functions to define "internal" as parameter and return types for functions, when those are not visible from SQL. This lead me to the question whether it is possible to use "internal" as state type for an Aggregate whose functions are implemented in C. Thanks, Markus --

Re: [SQL] Aggregates with internal state type?

2006-09-13 Thread Tom Lane
Markus Schaber <[EMAIL PROTECTED]> writes: > This lead me to the question whether it is possible to use "internal" as > state type for an Aggregate whose functions are implemented in C. No, because the system has no idea what the representation of an "internal" state value might be, and in particu

Re: [SQL] Aggregates with internal state type?

2006-09-13 Thread Markus Schaber
Hi, Tom, Tom Lane wrote: > Markus Schaber <[EMAIL PROTECTED]> writes: >> This lead me to the question whether it is possible to use "internal" as >> state type for an Aggregate whose functions are implemented in C. > > No, because the system has no idea what the representation of an > "internal"

Re: [SQL] Aggregates with internal state type?

2006-09-13 Thread Tom Lane
Markus Schaber <[EMAIL PROTECTED]> writes: > Ah, I see. So there's no possibility to pass some void* kind of > intermediate data, I have to craft at least a dummy PostgreSQL datatype > for it. Right. My first thought would be to use bytea as the declared type --- doesn't put much burden on you ex

Re: [SQL] Aggregates with internal state type?

2006-09-13 Thread Markus Schaber
Hi, Tom, Tom Lane wrote: >> Ah, I see. So there's no possibility to pass some void* kind of >> intermediate data, I have to craft at least a dummy PostgreSQL datatype >> for it. > > Right. My first thought would be to use bytea as the declared type --- > doesn't put much burden on you except to

[SQL] How to delete multiple records

2006-09-13 Thread Javanesevn
Dear all, I execute this query on below: delete from PRODUCT where exists ( select product_id, item_id from PRODUCT where research_date < '2006-01-01' ) this query deleted all records data in PRODUCT table. The subquery