Re: [SQL] Trigger with parameters

2005-03-21 Thread Richard Huxton
[EMAIL PROTECTED] wrote:
 CREATE TRIGGER products_codes_checkfieldvalue BEFORE INSERT OR UPDATE ON
main.products_codes FOR EACH ROW EXECUTE PROCEDURE
trigger_system_checkfieldvalue('main','products_codes');
   ---  ERROR:  function trigger_system_checkfieldvalue() does not exist
But the function trigger_system_checkfieldvalue() EXIST! With (text,text)
parameters.
I can't built the trigger for this table (main.products_codes) using the check
field in main_system.products_codes.
 What is wrong???
From the manuals:
Note that the function must be declared with no arguments even if it 
expects to receive arguments specified in CREATE TRIGGER --- trigger 
arguments are passed via TG_ARGV, as described below.

See pl/pgsql - trigger procedures for details.
--
  Richard Huxton
  Archonet Ltd
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [SQL] date subtraction

2005-03-21 Thread Richard Huxton
Ashok Agrawal wrote:
I need to do date calculation similar to oracle in postgres.
like sysdate - creation_date of the record which returns no
of days in oracle which you can convert to hours or second
by multiplying by 60 or 3600.
How do i achieve this in postgres.
Umm,
  SELECT CURRENT_DATE - creation_date FROM my_table;
--
  Richard Huxton
  Archonet Ltd
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[SQL] index scan

2005-03-21 Thread Mihail Nasedkin
Hello, pgsql-sql.

I have customize simple query with join two tables:

=# \d sites 
  Таблица "public.sites"
 Колонка |  Тип   | Модификаторы
-++---
 name| character varying(255) | not null
 rem | text   |
 enabled | boolean| not null default true
Index:
  "pk_sites" primary key, btree (oid)

=# \d site_screens
-++--
 id_site | oid| not null
 screen_name | character varying(255) | not null
 screen_code | text   |
Foreign keys:
"$1" FOREIGN KEY (id_site) REFERENCES sites(oid)

=# explain select * from sites s join site_screens ss on s.oid = 
ss.id_site;QUERY PLAN   
   
---
 Hash Join  (cost=...)
   Hash Cond: ("outer".id_site = "inner".oid)
   ->  Seq Scan on site_screens ss  (cost=...)
   ->  Hash  (cost=...)
 ->  Seq Scan on sites s  (cost=...)

I want to Index Scan. What must I do?

-- 
Regards,
 Mihail Nasedkin
 mailto:[EMAIL PROTECTED]


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [SQL] index scan

2005-03-21 Thread Richard Huxton
Mihail Nasedkin wrote:
=# explain select * from sites s join site_screens ss on s.oid = 
ss.id_site;QUERY PLAN   
   
---
 Hash Join  (cost=...)
   Hash Cond: ("outer".id_site = "inner".oid)
   ->  Seq Scan on site_screens ss  (cost=...)
   ->  Hash  (cost=...)
 ->  Seq Scan on sites s  (cost=...)
You've commented out the interesting bits (the costs/rows)
I want to Index Scan. What must I do?
Why do you want an index scan? Do you have any evidence it will be 
faster than a sequential scan?

--
  Richard Huxton
  Archonet Ltd
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [SQL]

2005-03-21 Thread Christoph Haller
Octavio Alvarez wrote:
> 
> Sorry, I tried to make my subject as good as possible.

Ahem, what subject? 
> 
> I have a table where I store the dates in which I take out of my inventory
> (like "installation dates")
> 
> table
> ---
> row_id   SERIAL
> date DATE
> fk_item  INTEGER
> 
> and that's pretty much it.
> 
> I want to have a query returning how long have been certain items lasting.
> 
> Say I have:
> 
> SELCT date FROM table WHERE fk_item = "INKJET_INK-BW"
> 
> date
> -
> 2005-02-02
> 2005-03-05
> 2005-04-07
> 2005-05-02
> 
> I need something to calculate the intervals between those dates, like this:
> 
> intervals (in days)
> 
>   31
>   34
>   25
> 
> So I can get the stddev and stuff from the "duration" of the items.
> 
> I've been having a hard time with it. I'm trying NOT to program new
> functions.

I cannot see how this could be achieved without the use of a function. 
But if there is a way after all, I would be interested in learning it. 
> 
> Any help will be appreciated.
> 
> --Octavio
> --

Regards, Christoph

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [SQL] index scan

2005-03-21 Thread Mihail Nasedkin
Die, Richard.

Thank you for answer March, 21 2005 14:15:40:

RH> Mihail Nasedkin wrote:
>> =# explain select * from sites s join site_screens ss on
>> s.oid = ss.id_site;QUERY PLAN  
>> ---
>>  Hash Join  (cost=...)
>>Hash Cond: ("outer".id_site = "inner".oid)
>>->  Seq Scan on site_screens ss  (cost=...)
>>->  Hash  (cost=...)
>>  ->  Seq Scan on sites s  (cost=...)

RH> You've commented out the interesting bits (the costs/rows)
In that example main point - Seq Scan on site_screens

>> I want to Index Scan. What must I do?

RH> Why do you want an index scan? Do you have any evidence it will be
RH> faster than a sequential scan?

No, but I want to be ready for make Index scan queries in future. I
make first steps on the customize SQL.

Where I can read more about optimize the SQL-queries and about
differences between types of scan?

-- 
Regards,
 Mihail Nasedkin
 [EMAIL PROTECTED]


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [SQL] Your question about date

2005-03-21 Thread Béatrice Yueksel
Dear Christoph,
perhaps you could try something like this example.
Regards,
BÃatrice

The table:
--
# select * from test;
date

 2005-02-02
 2005-03-05
 2005-04-07
 2005-05-02
(4 rows)


The query
--

SELECT
 (( select test1.date
   from test test1
   where test1.date > test.date limit 1)
   - test.date ) AS result from test;

t1.date >
RESULT:
---
 result

 31
 33
 25



Am Montag, den 21.03.2005, 10:54 +0100 schrieb Christoph Haller:
> Octavio Alvarez wrote:
> > 
> > Sorry, I tried to make my subject as good as possible.
> 
> Ahem, what subject? 
> > 
> > I have a table where I store the dates in which I take out of my inventory
> > (like "installation dates")
> > 
> > table
> > ---
> > row_id   SERIAL
> > date DATE
> > fk_item  INTEGER
> > 
> > and that's pretty much it.
> > 
> > I want to have a query returning how long have been certain items lasting.
> > 
> > Say I have:
> > 
> > SELCT date FROM table WHERE fk_item = "INKJET_INK-BW"
> > 
> > date
> > -
> > 2005-02-02
> > 2005-03-05
> > 2005-04-07
> > 2005-05-02
> > 
> > I need something to calculate the intervals between those dates, like this:
> > 
> > intervals (in days)
> > 
> >   31
> >   34
> >   25
> > 
> > So I can get the stddev and stuff from the "duration" of the items.
> > 
> > I've been having a hard time with it. I'm trying NOT to program new
> > functions.
> 
> I cannot see how this could be achieved without the use of a function. 
> But if there is a way after all, I would be interested in learning it. 
> > 
> > Any help will be appreciated.
> > 
> > --Octavio
> > --
> 
> Regards, Christoph
> 
> ---(end of broadcast)---
> TIP 3: if posting/reading through Usenet, please send an appropriate
>   subscribe-nomail command to [EMAIL PROTECTED] so that your
>   message can get through to the mailing list cleanly
-- 



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [SQL] index scan

2005-03-21 Thread Richard Huxton
Please CC the list as well as replying directly to me. I don't read this 
email address often.

Mihail Nasedkin wrote:
RH> Why do you want an index scan? Do you have any evidence it will be
RH> faster than a sequential scan?
No, but I want to be ready for make Index scan queries in future. I
make first steps on the customize SQL.
PostgreSQL uses statistics on what values are in what columns to decide 
how to plan a query. So - if you are asking for all rows from a table it 
 probably won't use an index because it knows you will have to read the 
whole table anyway.

Where I can read more about optimize the SQL-queries and about
differences between types of scan?
Well, perhaps the best place to learn more is the performance mailing 
list. You can see plenty of real-world problems being discussed there.

Two sections of the manual you should read are
  Chapter 13. Performance Tips
  Chapter 23. Monitoring Database Activity
Understanding how to read EXPLAIN ANALYSE output and manage statistics 
are vital.

Finally, details on configuration settings can be found at:
  http://www.powerpostgresql.com/PerfList
  http://www.varlena.com/varlena/GeneralBits/Tidbits/index.php
--
  Richard Huxton
  Archonet Ltd
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
 joining column's datatypes do not match


[SQL] CASE not working

2005-03-21 Thread Martín Marqués
I have this query which has a CASE in the middle to give me special results. 
The problem is that it doesn't interpret my columns as it should.

Here is the porblem:

siprebi=> SELECT getvencimientosancion(190) AS vence, (SELECT codigo FROM 
sanciones  WHERE persona = (SELECT persona FROM usuarios WHERE codigo = 190) 
ORDER BY femodif DESC LIMIT 1)  AS sancion_original, CASE WHEN vence>=now() 
THEN 1 ELSE 0 END  AS sancionado;
ERROR:  no existe la columna "vence"

(the translation of the error is: column "vence" does not exist).

I don't know what I'm getting wrong here.

-- 
 11:12:48 up 2 days, 15:43,  2 users,  load average: 0.95, 0.54, 0.56
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [SQL] query

2005-03-21 Thread Thomas F . O'Connell
You should be able to use the CURRENT_DATE function in place of sysdate.
You might need to cast the 1 explicitly to an interval.
As in:
CURRENT_DATE - '1 day'::interval
-tfo
--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC
http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005
On Mar 17, 2005, at 4:57 AM, Chandan_Kumaraiah wrote:
Hi, 
In oracle we write sysdate-1
For example,we write a query (select * from table1 where 
created_date>=sysdate-1).Whats its equivalent in postgre?

Chandan

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
 joining column's datatypes do not match


Re: [SQL] CASE not working

2005-03-21 Thread Alvaro Herrera
On Mon, Mar 21, 2005 at 11:18:38AM -0300, Martín Marqués wrote:

Hey Martin,

> I have this query which has a CASE in the middle to give me special results. 
> The problem is that it doesn't interpret my columns as it should.
> 
> Here is the porblem:
> 
> siprebi=> SELECT getvencimientosancion(190) AS vence, (SELECT codigo FROM 
> sanciones  WHERE persona = (SELECT persona FROM usuarios WHERE codigo = 190) 
> ORDER BY femodif DESC LIMIT 1)  AS sancion_original, CASE WHEN vence>=now() 
> THEN 1 ELSE 0 END  AS sancionado;
> ERROR:  no existe la columna "vence"

The problem is that the "vence" alias is not available at the time the
CASE is evaluated.  You need to use the getvencimientosancion()
function, or put it in a subselect in case it's expensive to compute (or
has side effects).

-- 
Alvaro Herrera (<[EMAIL PROTECTED]>)
"Java is clearly an example of a money oriented programming"  (A. Stepanov)

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [SQL] CASE not working

2005-03-21 Thread Martín Marqués
El Lun 21 Mar 2005 11:29, Alvaro Herrera escribió:
> On Mon, Mar 21, 2005 at 11:18:38AM -0300, Martín Marqués wrote:
> 
> Hey Martin,
> 
> > I have this query which has a CASE in the middle to give me special 
results. 
> > The problem is that it doesn't interpret my columns as it should.
> > 
> > Here is the porblem:
> > 
> > siprebi=> SELECT getvencimientosancion(190) AS vence, (SELECT codigo FROM 
> > sanciones  WHERE persona = (SELECT persona FROM usuarios WHERE codigo = 
190) 
> > ORDER BY femodif DESC LIMIT 1)  AS sancion_original, CASE WHEN 
vence>=now() 
> > THEN 1 ELSE 0 END  AS sancionado;
> > ERROR:  no existe la columna "vence"
> 
> The problem is that the "vence" alias is not available at the time the
> CASE is evaluated.  You need to use the getvencimientosancion()
> function, or put it in a subselect in case it's expensive to compute (or
> has side effects).

Yes, I was all tied up trying to make the subselect, and didn't see the 
simplicity of it. :-)

siprebi=> SELECT *,CASE WHEN s1.vence>=now() THEN 1 ELSE 0 END  AS sancionado 
FROM (SELECT getvencimientosancion(190) AS vence, (SELECT codigo FROM 
sanciones  WHERE persona = (SELECT persona FROM usuarios WHERE codigo = 190) 
ORDER BY femodif DESC LIMIT 1)  AS sancion_original) s1;
   vence| sancion_original | sancionado
+--+
 20/03/2005 |  |  0
(1 row)

Txs.

-- 
 11:39:04 up 2 days, 16:09,  3 users,  load average: 1.05, 0.81, 0.74
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [SQL] query

2005-03-21 Thread Bruno Wolff III
On Mon, Mar 21, 2005 at 08:33:43 -0600,
  "Thomas F.O'Connell" <[EMAIL PROTECTED]> wrote:
> You should be able to use the CURRENT_DATE function in place of sysdate.
> 
> You might need to cast the 1 explicitly to an interval.
> 
> As in:
> 
> CURRENT_DATE - '1 day'::interval

I don't think you want that. That is going to force a conversion from date
to a timestamp. You are going to be better off just using:
current_date - 1

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


[SQL] "Flattening" query result into columns

2005-03-21 Thread Thomas Borg Salling








I am looking for a way to ”flatten” a
query result, so that rows are ”transposed” into columns, just as
asked here for oracle:

http://groups.google.dk/groups?hl=da&lr=&client=firefox-a&rls=org.mozilla:en-US:official&selm=aad10be0.0401292322.7b6c320b%40posting.google.com

 

Is there any way to do this with pgsql  ?

 

Thanks,

/Thomas.

 

 








Re: [SQL] "Flattening" query result into columns

2005-03-21 Thread Sean Davis



Thomas,
 
You probably want a crosstab.  There is a 
contributed module in contrib/crosstab.  If you do a search of the postgres 
mailing lists, there will be several posts relating to the same 
issue.
 
Sean
 

  - Original Message - 
  From: 
  Thomas Borg Salling 
  
  To: pgsql-sql@postgresql.org 
  Sent: Monday, March 21, 2005 4:57 
PM
  Subject: [SQL] "Flattening" query result 
  into columns
  
  
  I am looking for a way to 
  ”flatten” a query result, so that rows are ”transposed” into columns, just as 
  asked here for oracle:
  http://groups.google.dk/groups?hl=da&lr=&client=firefox-a&rls=org.mozilla:en-US:official&selm=aad10be0.0401292322.7b6c320b%40posting.google.com
   
  Is there any way to do this with 
  pgsql  ?
   
  Thanks,
  /Thomas.
   
   


[SQL] C function extending postgres

2005-03-21 Thread Theo Galanakis
Title: C function extending postgres





#include "postgres.h"
#include "fmgr.h"
#include "proc.h"


PG_FUNCTION_INFO_V1(get_process_total);


Datum
get_process_total(PG_FUNCTION_ARGS)
{
    float ret;
    ret = proc_cpu_user() + proc_cpu_nice() + proc_cpu_system() - proc_cpu_idle();
    PG_RETURN_FLOAT4(ret);
}


Hi ,


    I'm getting the following error when attempting to call the above function, I have included the -I path when compiling, and have compiled a similar function to execute and printf to linux without a problem :

Returned by postgres:
   
    ERROR:  could not load library "/usr/lib/pgsql/processinfo.so": /usr/lib/pgsql/processinfo.so: undefined symbol: proc_cpu_idle

Compiling:
    cc -g -I /usr/local/pgsql/include -I /usr/local/pgsql/include/server -I /usr/local/include -fpic -c processinfo.c

    cc -g -I /usr/local/pgsql/include -I /usr/local/pgsql/include/server -I /usr/local/include -shared -o processinfo.so processinfo.o

Here is the postgres create function:
CREATE FUNCTION get_process_total() RETURNS float4
    AS '$libdir/processinfo', 'get_process_total'
LANGUAGE 'c' STABLE STRICT;


TEST:
select * from get_process_total()


Your help would be greatly appreciated.


Theo




__
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.


Re: [SQL] C function extending postgres

2005-03-21 Thread Jonathan Daugherty
#   ERROR:  could not load library "/usr/lib/pgsql/processinfo.so":
# /usr/lib/pgsql/processinfo.so: undefined symbol: proc_cpu_idle

My guess that you're not linking against the library that containts
'proc_cpu_idle' when you build your .so.  What's the build platform?

-- 
  Jonathan Daugherty
  Command Prompt, Inc. - http://www.commandprompt.com/
  PostgreSQL Replication & Support Services, (503) 667-4564

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [SQL] "Flattening" query result into columns

2005-03-21 Thread Leif B. Kristensen
On Monday 21 March 2005 22:57, Thomas Borg Salling wrote:
> I am looking for a way to "flatten" a query result, so that rows are
> "transposed" into columns, just as asked here for oracle:
>
> Is there any way to do this with pgsql  ?

Just to help out the guys, here's a working link:



What you're asking for is called a pivot table, and at least in Oracle 
they use a function called decode(). I need exactly the same thing, but 
I too am unable to find the optimal way to do it in PostgreSQL.
-- 
Leif Biberg Kristensen
http://solumslekt.org/

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [SQL] "Flattening" query result into columns

2005-03-21 Thread PFC
You could use the array_accum aggregate. See examples in the docs.
On Mon, 21 Mar 2005 22:57:13 +0100, Thomas Borg Salling <[EMAIL PROTECTED]>  
wrote:

I am looking for a way to "flatten" a query result, so that rows are
"transposed" into columns, just as asked here for oracle:
http://groups.google.dk/groups?hl=da

&lr=&client=firefox-a&rls=org.mozilla:en-US:official&selm=aad10be0.040129232
2.7b6c320b%40posting.google.com
Is there any way to do this with pgsql  ?
Thanks,
/Thomas.


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [SQL] "Flattening" query result into columns

2005-03-21 Thread Scott Marlowe
On Mon, 2005-03-21 at 15:57, Thomas Borg Salling wrote:
> I am looking for a way to âflattenâ a query result, so that rows are
> âtransposedâ into columns, just as asked here for oracle:
> 
> http://groups.google.dk/groups?hl=da&lr=&client=firefox-a&rls=org.mozilla:en-US:official&selm=aad10be0.0401292322.7b6c320b%40posting.google.com
> 
>  
> 
> Is there any way to do this with pgsql  ?

Here's one from work that allows you to do the same basic thing without
a separate cross table:

select 
a.lt ,
b.perspective as XYZ_pers,
b.averageresponsetime as XYZ_aver,
b.lowestresponsetime as XYZ_lowe,
b.highestresponsetime as XYZ_high,
b.totalcount as XYZ_tota,
c.perspective as ABC_pers,
c.averageresponsetime as ABC_aver,
c.lowestresponsetime as ABC_lowe,
c.highestresponsetime as ABC_high,
c.totalcount as ABC_tota 
from (
select distinct date_trunc('minutes', lastflushtime) as lt from 
businessrequestsummary
where lastflushtime between '2005-03-14 18:42:34' and '2005-03-21 
18:42:34' 
and perspective in ('XYZ','ABC')
) as a 
left join (
select date_trunc('minutes', lastflushtime) as lt,
max(perspective) as perspective,
floor(avg(averageresponsetime)) as averageresponsetime,
min(lowestresponsetime) as lowestresponsetime,
max(highestresponsetime) as highestresponsetime,
sum(totalcount) as totalcount
from businessrequestsummary 
where perspective ='XYZ'
group by date_trunc('minutes', lastflushtime)
) as b 
on 
(a.lt=b.lt) 
left join (
select date_trunc('minutes', lastflushtime) as lt,
max(perspective) as perspective,
floor(avg(averageresponsetime)) as averageresponsetime,
min(lowestresponsetime) as lowestresponsetime,
max(highestresponsetime) as highestresponsetime,
sum(totalcount) as totalcount
from businessrequestsummary 
where perspective ='ABC'
group by date_trunc('minutes', lastflushtime)
) as c 
on 
(a.lt=c.lt) 

IT's generated by a script that makes it as big as we need for all the 
different perspectives.

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [SQL] equivalent of oracle rank() in postgres

2005-03-21 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


> Jus wanted the equivalent for rank() as in tis example..

> SELECT *
> FROM (
>   SELECT employee_id, last_name, salary,
>   RANK() OVER (ORDER BY salary DESC) EMPRANK
>   FROM employees)
> WHERE emprank = 3;

There is no direct equivalent to rank(), but there are certainly
other ways to get the results. The above query can be written in
PostgreSQL as:

SELECT employee_id, last_name, salary
FROM employees
WHERE salary =
 (SELECT DISTINCT salary FROM employees ORDER BY salary DESC OFFSET 2 LIMIT 1);

- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200503212152
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iD8DBQFCP4hwvJuQZxSWSsgRAoKPAKDE0pB4NueE0Dh9EfJiXw79SvCDoACcC4xb
ydxVgK9DgGHQXJqFIrlHIIo=
=GRIX
-END PGP SIGNATURE-



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [SQL] C function extending postgres

2005-03-21 Thread Theo Galanakis
Title: RE: [SQL] C function extending postgres





Thanks for your feedback.


I'm actually trying to use a system metrics library from http://www-usr.inf.ufsm.br/~veiga/liblproc/index-en.html


I have tried to link the library however I'm still getting the same message.


cc -g -I /usr/local/pgsql/include -I /usr/local/pgsql/include/server -I /usr/local/include -fpic -c processinfo.c
cc -g -I /usr/local/pgsql/include -I /usr/local/pgsql/include/server -I /usr/local/include -shared -llproc -Wall -L/usr/local/include/ -o processinfo.so processinfo.o



-Original Message-
From: Jonathan Daugherty [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, 22 March 2005 11:21 AM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] C function extending postgres



#   ERROR:  could not load library "/usr/lib/pgsql/processinfo.so":
# /usr/lib/pgsql/processinfo.so: undefined symbol: proc_cpu_idle


My guess that you're not linking against the library that containts 'proc_cpu_idle' when you build your .so.  What's the build platform?

-- 
  Jonathan Daugherty
  Command Prompt, Inc. - http://www.commandprompt.com/
  PostgreSQL Replication & Support Services, (503) 667-4564


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?


   http://www.postgresql.org/docs/faq




__
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.


Re: [SQL] C function extending postgres

2005-03-21 Thread Jonathan Daugherty
# I'm actually trying to use a system metrics library from
# http://www-usr.inf.ufsm.br/~veiga/liblproc/index-en.html

Have you added the path of the lproc library to your /etc/ld.so.conf?

-- 
  Jonathan Daugherty
  http://www.parsed.org

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [SQL] C function extending postgres

2005-03-21 Thread Theo Galanakis
Title: RE: [SQL] C function extending postgres





Sorted Jonathan, thankyou for your help.


-Original Message-
From: Jonathan Daugherty [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, 22 March 2005 4:32 PM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] C function extending postgres



# I'm actually trying to use a system metrics library from
# http://www-usr.inf.ufsm.br/~veiga/liblproc/index-en.html


Have you added the path of the lproc library to your /etc/ld.so.conf?


-- 
  Jonathan Daugherty
  http://www.parsed.org


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])




__
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.