[SQL] pl/python out params

2010-08-07 Thread Imre Horvath
Hi!

Is there a way to use output parameters with a pl/python fucntion?
I've tried with no luck: if I define out parameters, it says return type
must be record, if I define a record return type, I get an error on
executing that pl/python doesn't support record return type...

My simple test func is:

create or replace function outtest(out i integer, out j text)
 returns boolean as
$BODY$
i = 1
j = 'something'
return True
$BODY$
language plpythonu;

Thanks in advance:
Imre Horvath


-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


[SQL] Using SKYLINE command on PostgreSQL

2010-08-07 Thread LaboRecherche



Hello,

I have just installed version 8.4 of PostGresql (on a Windows machine) 
in order to use SKYLINE command, but it seems that I get an error each 
time I try to use this command.


Is there a specific plugin to install to add SKYLINE command ? Can you 
help me on this point to get this command working ?


Thank you.

--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] pl/python out params

2010-08-07 Thread Richard Albright

first define a custom type, then drop the out parameters.

create type mytype as (
i integer,
j text );

create or replace function outtest()
 returns mytype as
$BODY$
i = 1
j = 'something'
return ( i, j )
$BODY$
language plpythonu;


select * from outtest();
 i | j
---+---
 1 | something
(1 row)


On 08/07/2010 10:49 AM, Imre Horvath wrote:

Hi!

Is there a way to use output parameters with a pl/python fucntion?
I've tried with no luck: if I define out parameters, it says return type
must be record, if I define a record return type, I get an error on
executing that pl/python doesn't support record return type...

My simple test func is:

create or replace function outtest(out i integer, out j text)
  returns boolean as
$BODY$
i = 1
j = 'something'
return True
$BODY$
language plpythonu;

Thanks in advance:
Imre Horvath


   



--
*Rick Albright*
Senior Quantitave Analyst
Web: www.insiderscore.com 
Email: [email protected] 


Re: [SQL] pl/python out params

2010-08-07 Thread Tom Lane
Imre Horvath  writes:
> Is there a way to use output parameters with a pl/python fucntion?

At the moment I think plpython only supports a single OUT param.

regards, tom lane

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


[SQL] 2010 International Conference on Progress in Informatics and Computing(PIC-2010 )

2010-08-07 Thread PIC2010
Remind: PIC-2010 last Call for Papers - few days left-deadline August 10th! 
Please subimit your papers before August 10th.
-
2010 International Conference on Progress in Informatics and Computing(PIC-2010 
)

Important Dates
Full paper submission: August 10, 2010 Acceptance notification: Sept. 20, 
2010
Final registration: Sept. 30, 2010 Final papers submissions: Sept. 30, 
2010

2010 International Conference on Progress in Informatics and Computing 
(PIC-2010, http://pic.sjtu.edu.cn) will be held on Dec 10-12, 2010, in 
Shanghai, the largest city in China, which is located on China's central 
eastern coast just at the mouth of the Yangtze River. It is one of the largest 
metropolitan areas in the world, with over 20 million people. This Year, the 
forty-first World Expo is held in Shanghai, which is one of the famous events 
in the world, and it provides an extra reason why shanghai worth visiting this 
year.


PIC-2010 provides a forum for researchers and practitioners in academia and 
industry to discuss the progress, challenges, experiences and trends of the 
theoretical and application issues in computing science, software technology, 
information system, to exchange ideas, share knowledge and promote future 
cooperation. The conference also welcome papers of infomation system 
applications in biomedical, healthcare, engineering, economics, social science 
and management domains.
All papers accepted will be published in the IEEE categorized conference 
proceedings, and will be included in IEEE Xplore and indexed by Ei Compendex 
and ISTP. Top 10 % of the accepted papers will be recommended to and published 
in several international Journals.

Paper Submission
Prospective authors are encouraged to submit full papers for review by August 
10st, 2010, in PDF -format. Only original papers that have not been published 
or submitted for publication elsewhere will be considered, written in English, 
should be no more than 5 pages (If your final camera-ready paper exceed 5 
pages, each extra page will be charged accordingly, details can be found at the 
conference website), Please submit your papers using the online submission 
system in http://pic.sjtu.edu.cn. 

Organizing Committee 

General Conference Chairs
Mengqi Zhou, IEEE Beijing Section, China
Yinglin Wang, Shanghai Jiao Tong University, China

Steering committee Chair
Katsuro Inoue, Osaka University, Japan

Steering committee
Chengfei Liu, Swinburne University of Technology, Australia
Pedro Antunes, University of Lisboa, Portugal
Jiacun Wang, Monmouth University, USA 
Gongzhu Hu, Central Michigan University, USA
Du Zhang, California State University, Sacramento, USA 

Organization Co-Chairs
Jun Dong,Suzhou Institute of Nano-Tech and Nano-Bionics, Chinese Academy of 
Sciences, China
Michael Sheng, The University of Adelaide, Australia

Technical Program Committee Co-Chairs
Xuelong Li, Chinese Academy of Sciences, China
Yuan Luo, Shanghai Jiao Tong University, China
Jyrki Nummenmaa, Tampere University, Finland
Yaoru Sun, Tongji University, China

Publication Chair
Mengqi Zhou, IEEE Beijing Section, China

Publicity Chair
DachengTao, Nanyang Technological University,Singapore
Organized By: Shanghai Jiao Tong University
Co-Sponsored by:IEEE Beijing Section, Shanghai Jiao Tong University, The 
University of Texas at Dallas, Osaka University  
Note: The detail information may be subject to change, please find the latest 
information via http://pic.sjtu.edu.cn
E-mail:  [email protected]
Tel: (0086)21-37826993
-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


[SQL] tsearch2 query question

2010-08-07 Thread Anders Østergaard Jensen
Hello postgresql users,

I have a question regarding building a tsearch2 query that does wildcard
searching by default. Currently, I am using plainto_tsquery(), but it
does not allow me to build more advanced search expressions. I know
to_tsquery is the way to go with this, but I need some qualified assistance
for building the correct query.

Consider the following table:

metabase=# \d customers;
   Table "public.customers"
 Column  |   Type   |
 Modifiers
-+--+-
 id  | integer  | not null default
nextval(('"customer_id_seq"'::text)::regclass)
 name| character varying(255)   | not null
 description | text |
[...]
search_idx  | tsvector |

search_idx is a tsvector with an ON INSERT OR UPDATE trigger, which
automatically updates the search vector as a combination of name and
description. No black magic there.

Now, let's start out with a classic, non-tsearch2 ILIKE query with two
wildcards around the search token:
metabase=# select id, name from customers where name ilike '%holstebr%';

CASE #1:
  id  |   name
--+---
 3646 | Holstebro Kommune
(1 row)

I am trying to do the same exactly with tsearch2 but with no luck:

CASE #2:
metabase=# select id, name from customers where search_idx @@
to_tsquery('*Holstebr*');
 id | name
+--
(0 rows)

How do I formulate the input for to_tsquery so that it returns the same as
(1)? And subsequently: how do I handle spaces in between, fx. so that
'holstebro komm*' yields 'holstebro kommune'?

If people have any example of expression builders they put on top of their
SQL queries, I would love to see it. I know that this has been done before.

Thank you for your time and help,

Anders


Re: [SQL] Using SKYLINE command on PostgreSQL

2010-08-07 Thread Craig Ringer
On 05/08/10 00:26, LaboRecherche wrote:
> 
> 
> Hello,
> 
> I have just installed version 8.4 of PostGresql (on a Windows machine)
> in order to use SKYLINE command, but it seems that I get an error each
> time I try to use this command.
> 
> Is there a specific plugin to install to add SKYLINE command ? Can you
> help me on this point to get this command working ?

All I can find with a quick Google search for "SKYLINE postgresql" is
references to someone's masters thesis, plus a bit of mailing list
discussion.

There's no indication it was ever proposed and discussed as a serious
patch to the core of PostgreSQL, let alone applied. Have a look at this
thead, including follow-ups.

http://archives.postgresql.org/pgsql-hackers/2007-03/msg00192.php

The masters thesis page does contain a patch against PostgreSQL 8.3:
  http://skyline.dbai.tuwien.ac.at/
but this is something you have to apply to the source code, then compile
PostgreSQL into usable binaries. That's trivial on Linux, but I don't
recommend you try it on Windows, as compiling software on Windows is
much more complex.

They say they're porting the patch to 8.4devel, but I suspect that since
8.4 has been out for ages and 9.0 is almost released, they've probably
lost interest and dropped the work.

--
Craig Ringer

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql