--- Oliver Vecernik <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Searching Google I found a thread in July 2001
> concerning the facilities
> for debugging plpgsql functions. The actual answer
> was: it should be
> improved.
>
> What is the best way to debug a plpgsql function?
>
> Oliver
This m
Tom's suggested solution worked GREAT in 7.2.x ... I tried taking the plunge
into 7.3.1 tonight. In 7.3.1, when my FIFO queue program goes to grab a row,
TWO processes grab the same row, almost without fail. I even changed my locking
statement to the dreaded
LOCK TABLE fifo IN ACCESS EXCLUSIVE MO
> On Thu, 23 Jan 2003, David Durst wrote:
>
>> Is there anyway to schedule DB Events based on time?
>
> Yes! cron
>
>> So lets say I had a table w/ depreciation schedules in it,
>> I would like the DB to apply the formula and make the entries on the
>> END of every month.
> On Thu, 23 Jan 2003, Dav
> -Original Message-
> From: Tom Lane [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 7:01 PM
> To: Tambet Matiisen
> Cc: [EMAIL PROTECTED]
> Subject: Re: [SQL] calling function from rule
>
>
> "Tambet Matiisen" <[EMAIL PROTECTED]> writes:
> >> Try 7.3, we changed the rul
On Fri, 24 Jan 2003, David Durst wrote:
> > On Thu, 23 Jan 2003, David Durst wrote:
> >
>
> Here is the basic problem w/ using CRON in an accounting situation.
>
> I can't be sure that cron will always be up when the DB is up,
> so lets say crond goes down for some random reason (User, System erro
Hello!
Like others said you can't cast varchar to int directly.
Make your life easier! :) You must write a function like
this:
create function "int4"(character varying) returns int4 as '
DECLARE
input alias for $1;
BEGIN
return (input::text::int4);
E
jack wrote:
Is that possible to have a two columns primary key on a table with null
value on second column?
Jack
Probably not, because (1,2,null,null) is unique for postresql.
Watch discussion on mailing list
about unique indexes (on which primary key is based) several days ago.
Regards,
Tomasz
On Fri, Jan 24, 2003 at 00:45:38 -0800,
David Durst <[EMAIL PROTECTED]> wrote:
>
> I can't be sure that cron will always be up when the DB is up,
> so lets say crond goes down for some random reason (User, System error,
> Etc..)
One option would be to run the cron job fairly often and have it c
On Fri, 24 Jan 2003, jack wrote:
> Is that possible to have a two columns primary key on a table with null
> value on second column?
No, because primary key implies not null on all columns involved
(technically I think it's that a non-deferrable primary key implies
not null on all columns involve
Achilleus Mantzios <[EMAIL PROTECTED]> writes:
> On Fri, 24 Jan 2003, David Durst wrote:
>> Here is the basic problem w/ using CRON in an accounting situation.
>>
>> I can't be sure that cron will always be up when the DB is up,
>> so lets say crond goes down for some random reason (User, System e
daq <[EMAIL PROTECTED]> writes:
> Make your life easier! :) You must write a function like
> this:
> create function "int4"(character varying) returns int4 as '
>DECLARE
> input alias for $1;
>BEGIN
> return (input::text::int4);
>END;
> ' language
Or if you are so paranoid about the stability of crond, you can probably do a
check to see whether crond is up when you update the database.
If crond is up then
update
else
mail root the error
reject the update
end
This is going to affect the performance dramatically though.
- Or
Hi
To make it easier to do this in SQL you can create a view like this :
CREATE VIEW db_list AS
SELECT d.datname as "Name",
u.usename as "Owner",
pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding"
FROM pg_catalog.pg_database d
LEFT JOIN pg_catalog.pg_user u ON d.datdba = u.u
Hi
I would agree that cron is probably the best solution.
You could have cron perform a query that has a trigger and performs all the
tasks you need done. As well you could create a trigger on other queries that
would perform the other things as well, but make sure it isn't a heavily used
quer
here is a possible NON-Cron solution that a friend of mine came up w/
1) Create a table w/ scheduled events and Account Ids attached to them.
2) Create a table w/ temporal event execution timestamps.
3) On journal entry check to see if there any schedule events for the Account
4) Check timestamp t
On Fri, Jan 24, 2003 at 11:39:07AM -0800, David Durst wrote:
> I am wondering how you would handle a select that returns multiple rows
> in a plpgsql function?
>
> In other words lets say I wanted to iterate through the results in
> the function.
There are examples in the PL/pgSQL documentation t
Are there functions for adding and subtracting this type from itself?
Or is there a simple way to do it?
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
David,
> Are there functions for adding and subtracting this type from itself?
> Or is there a simple way to do it?
The MONEY type is depreciated, and should have been removed from the Postgres
source but was missed as an oversight. Use NUMERIC instead.
--
-Josh Berkus
Aglio Database Soluti
> David,
>
>> Are there functions for adding and subtracting this type from itself?
>> Or is there a simple way to do it?
>
> The MONEY type is depreciated, and should have been removed from the
> Postgres source but was missed as an oversight. Use NUMERIC instead.
>
> --
> -Josh Berkus
> Aglio
NOTE: This is a feature in 7.3 it was either added or fixed, so you will not
be able to do this unless you are using version 7.3. Remember to backup with
pg_dumpall before you upgrade.
This is a sample sent to me earlier this week, that iterates an integer array:
Cut Here
CREATE
20 matches
Mail list logo