On Wed, Mar 10, 2010 at 12:26 AM, Bryce Nesbitt wrote:
> I'm setting up remote monitoring of postgres, but running into an
> uncomfortable situation with permissions.
> Basically it seems hard to set up a secure "read only" role, yet also allow
> proper monitoring.
>
> A brief writeup of that is h
On Fri, Oct 24, 2008 at 10:24 AM, Tony Wasson <[EMAIL PROTECTED]> wrote:
> On Fri, Oct 24, 2008 at 8:04 AM, Steve Midgley <[EMAIL PROTECTED]> wrote:
>> At 11:28 AM 10/23/2008, Joe wrote:
>>>
>>> Steve Midgley wrote:
>>>>>
>>>>> #
On Fri, Oct 24, 2008 at 8:04 AM, Steve Midgley <[EMAIL PROTECTED]> wrote:
> At 11:28 AM 10/23/2008, Joe wrote:
>>
>> Steve Midgley wrote:
# (invoiceid, txid)
(A, 1)
(A, 3)
(B, 1)
(B, 2)
(C, 5)
(D, 6)
(D, 7)
(E, 8)
(F, 8)
For journalli
On Tue, Sep 30, 2008 at 5:16 AM, Glenn Gillen <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> I've got a table with a unique constraint across a few fields which I
> need to regularly import a batch of data into. Is there a way to do it
> with COPY without getting conflicts on the unique contraint? I hav
On Feb 6, 2008 6:08 PM, Medi Montaseri <[EMAIL PROTECTED]> wrote:
> I am learning my way into Accounting and was wondering how Accounting
> applications are designed. perhaps you could point the way
> As a DBA, (and keeping it simple) I am thinking I need a table for every
> account which mig
On 7/18/06, Tony Wasson <[EMAIL PROTECTED]> wrote:
On 7/18/06, Curtis Scheer <[EMAIL PROTECTED]> wrote:
> Does anyone have any examples of how I would make a stored procedure in
> plpgsql that would allow for passing a list or arrays of values to be used
> in an sql IN cla
On 7/18/06, Curtis Scheer <[EMAIL PROTECTED]> wrote:
Does anyone have any examples of how I would make a stored procedure in
plpgsql that would allow for passing a list or arrays of values to be used
in an sql IN clause? Like so: select * from table where field1 in (values).
Here's a very sim
On 5/12/06, Michael Joseph Tan <[EMAIL PROTECTED]> wrote:
hi,
im new in postgresql, generally new in databases.
im trying to make a function using PGAdminIII which returns several types,
example, my query is:
"select count(id) as requests, organization from connection_requests group
by organiz
I ended up writing a perl script to parse my SQL
and make a graphviz dot file. I then used graphviz to make a function
dependency chart. I can't promise it would catch every single case,
but I can provide you with the code if you wish to give it a whirl.
Tony Wasson
-
On 1/11/06, Jeff Boes <[EMAIL PROTECTED]> wrote:
> Stumped: is there any way to set up default values for psql variables
> within the .SQL file itself? Obviously, I can do something like:
>
> $ psql -f my_script -v MYVAR=${myvar:-mydefault}
>
> but I would prefer to have the value stored with the .
On 7/22/05, Jim Buttafuoco <[EMAIL PROTECTED]> wrote:
> Mark,
>
> Instead of RETURN NEXT rec.txt1; RETURN NEXT rec.txt2; just use RETURN NEXT
> rec;
>
> then your select statement would be
> select * from my_func() as (txt1 text,txt2 text);
>
> Jim
Besides a simple RETURN NEXT, you'll need to
On 7/19/05, Andreas Joseph Krogh <[EMAIL PROTECTED]> wrote:
> On Tuesday 19 July 2005 17:18, Richard Huxton wrote:
> > Andreas Joseph Krogh wrote:
> > > Hi all!
> > >
> > > Is there a way of echo'ing a string(like "raise notice 'this is id%',
> > > id") from plpgsql? I want to echo/print it to STDO
sible?
>
> Thanks alot.
>
> Your Friend,
>
> John Kopanas
You can do this by using array_to_string and using a space as your
delimiter. If you need to trim the quotes use the trim function also.
You can also see the split_on_commas example below -- you'd want to
split on
h left join p on (h.r=p.r and h.pos=r.pos and p.r_order=1)
where h.tn > 20
and h.tn < 30
Filtering within the join condition is very useful when doing a left outer join.
Here's another example "from the book" doing this type of filter
within the join:
http://www.postgresql
eriodic
summarization you run. This sounds like a "top N" report so a periodic
update out to work.
http://jonathangardner.net/PostgreSQL/materialized_views/matviews.html
Tony Wasson
---(end of broadcast)---
TIP 8: explain analyze is your friend
le row by using something like SELECT
build_keyword_table('123');
I also used this as my test data... It worked for me!
CREATE TABLE user_data (
id SERIAL,
user_id INTEGER,
keywords VARCHAR(256) NOT NULL,
add_date TIMESTAMP,
PRIMARY KEY(id)
);
INSERT
On 5/9/05, Mark Fenbers <[EMAIL PROTECTED]> wrote:
> I want to update a column in myTable. The value this column is set to
> depends on a nested select statement which sometimes returns 0 rows instead
> of 1. This is a problem since the column I'm trying to update is set to
> refuse nulls. Here
um_integer_array(somearr) FROM arraytest ;
sum_integer_array
-------
{1,3,5}
(1 row)
Tony Wasson
---(end of broadcast)---
TIP 8: explain analyze is your friend
x_sum
example in the docs.
-
CREATE OR REPLACE FUNCTION sum_intarray(INTEGER[],INTEGER[]) RETURNS
INTEGER[] LANGUAGE 'plpgsql' AS '
/*
|| Author: Tony Wasson
||
|| Overview: Experiment with arrays and aggregates
|| 3,2,1
||+ 0,2,2
|| ---
|| 3,4,3
||
|| Revisions
19 matches
Mail list logo