Hi,
I'm writing some function to fetch data from an Oracle database and store it in
a PostgreSQL database.
CREATE OR REPLACE FUNCTION public.replicate_billing(text, date, date) RETURNS
void AS
$body$
use DBI;
my $dbh_ora =
DBI->connect('dbi:Oracle:database=bmssa;host=firev120-1.indicator.b
On Wed, May 30, 2007 at 09:33:40AM +0200, Bart Degryse wrote:
> In general how should I catch the error message generated if one
> of the spi functions (spi_exec_query, spi_query, spi_fetchrow,
> spi_prepare,...) fails?
In PL/Perl functions you can use eval to catch errors just as you
would in an
Hi all. Im wondering if there is a way to include in the postgresql logs
the total rows retrieved after a query (im logging the query itself
right now). Something like apache does when it logs the amount of bytes
retrieved after a GET.
Thanks!
Gerardo
---(end of broadc
Hi all,
This query executes very slow:
select (select count(*) from customer where id <= a.id) as row, id, from
customer as a order by id;
Where customer has id column and others and has also index on id column. The
table has about 10.000+ records. When used with "explain", it gives me this
o
On Wed, May 30, 2007 at 08:56:45AM -0700, Trigve Siver wrote:
> Hi all,
>
> This query executes very slow:
>
> select (select count(*) from customer where id <= a.id) as row, id,
> from customer as a order by id;
So you are trying to get the ordinal position of every ID in the
table? I'm not su
Hi,
Thanks for reply, As you have mentioned I need to get row numbers for my query,
so when I make some other query with same data I will know which row number has
a particular ID. As you mentioned "You can
do this with a temporary sequence, among other approaches...". Can you point me
to some
On 5/30/07, Trigve Siver <[EMAIL PROTECTED]> wrote:
Can you point me to some sources
or give me some examples, please?
CREATE OR REPLACE FUNCTION ROWNUM() RETURNS BIGINT AS
$$
BEGIN
RETURN NEXTVAL('ROWNUM_SEQ');
EXCEPTION WHEN OTHERS THEN
CREATE T
Thanks a lot
Trigve
- Original Message
From: Rodrigo De León <[EMAIL PROTECTED]>
To: pgsql-sql@postgresql.org; Trigve Siver <[EMAIL PROTECTED]>
Sent: Wednesday, May 30, 2007 7:28:47 PM
Subject: Re: [SQL] slow query execution
On 5/30/07, Trigve Siver <[EMAIL PROTECTED]> wrote:
> Can you
On Wed, May 30, 2007 at 10:03:16AM -0700, Trigve Siver wrote:
> Hi, Thanks for reply, As you have mentioned I need to get row
> numbers for my query, so when I make some other query with same
> data I will know which row number has a particular ID.
Oh, wait. If _that's_ your plan, then this will
>- Original Message
>From: Andrew Sullivan <[EMAIL PROTECTED]>
>To: pgsql-sql@postgresql.org
>Sent: Wednesday, May 30, 2007 7:39:18 PM
>Subject: Re: [SQL] slow query execution
>
>On Wed, May 30, 2007 at 10:03:16AM -0700, Trigve Siver wrote:
>> Hi, Thanks for reply, As you have mentioned I
On Wed, May 30, 2007 at 11:08:02AM -0700, Trigve Siver wrote:
> I want to do it only for some queries. So when I need query like
> that "SELECT * from t1" I need to add row_numbers there. So I will
> have "query with row_numbers" (where row_numbers are row numbers of
> my virtual list view). Then
>- Original Message
>From: Andrew Sullivan <[EMAIL PROTECTED]>
>To: pgsql-sql@postgresql.org
>Sent: Wednesday, May 30, 2007 8:30:32 PM
>Subject: Re: [SQL] slow query execution
>
>On Wed, May 30, 2007 at 11:08:02AM -0700, Trigve Siver wrote:
>
>> I want to do it only for some queries. So wh
Trigve Siver wrote:
I seee...when new data will be added to table, then row numbers wouldn''t be
valid anymore.
Hmmm...looked like I need to find other solution.
Try explaining what it is you're trying to achieve, and maybe someone
will be able to suggest a solution.
--
Richard Huxton
>- Original Message
>From: Richard Huxton <[EMAIL PROTECTED]>
>To: Trigve Siver <[EMAIL PROTECTED]>
>Cc: pgsql-sql@postgresql.org
>Sent: Wednesday, May 30, 2007 9:05:09 PM
>Subject: Re: [SQL] slow query execution
>
>Trigve Siver wrote:
>>
>> I seee...when new data will be added to table,
14 matches
Mail list logo