[SQL] lo_import for storing Blobs

2001-03-02 Thread Laurent

I need to store a binary file in a database. I use a cgi writed in shell
to do it. So I can use Postgres user to execute the cgi.

How can I store a binary file in a database with a cgi ?

Thanks a lot.

Laurent.




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



[SQL] varbit question

2001-05-15 Thread Laurent Duperval

Hi,

I thought I posted this but I don't see it on the server so let's try
again:

I have an Oracle script that I want to convert to pgsql. I've got a sed
script that does most of the mappings but it doesn't look like raw is
supported. In the docs, there is mention of varbit(n) but if I use the
(n) argument, the script fails. I can only use varbit alone. How do I get
around that?

Also, will ResultSet.getBytes() (I'm talking Java here) return an array
of bytes with a field defined as varbit? How large will the field be?

Thanks,

L


-- 
Laurent Duperval <mailto:[EMAIL PROTECTED]>

Voisin, vous seriez une vraie lumière... si on avait ouvert l'interrupteur.
 -Lefuneste

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



[SQL] UPDATE with concatenate

2001-06-07 Thread Laurent Patureau

Hy,

I try to update a table:col with take the valueof this col and concatenate 
it with $val.
I don't want to select all value of table:col and addition $val at each one

I try :

UPDATE table SET col .= '$val'

But it doesn't work, any suggestion ?


pat


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



[SQL] optimizing select ... not in (select ...)

2001-08-13 Thread Laurent Martelli

I have this query :

select distinct on (Pictures.PictureID) * from Pictures where Pictures.PictureID not 
in (select distinct PictureID from Keywords);

and I find it a bit slow. Does anybody have suggestions to run this
faster ? (I have indexes on PictureID on both Pictures and Keywords) 

-- 
Laurent Martelli
[EMAIL PROTECTED]  http://www.bearteam.org/~laurent/

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



[SQL] Re: Donations?

2001-08-13 Thread Laurent Martelli

>>>>> "Josh" == "Josh Berkus" <[EMAIL PROTECTED]> writes:

  Josh> Core team,

  Josh> I may be able to build a small donation towards postgresql
  Josh> development into my next project fee.  However, I am unsure of
  Josh> where I can send a check so that it will go directly towards
  Josh> PostgreSQL development, and not for any company's overhead.
  Josh> Suggestions?

Maybe you could do that through www.cosource.com ? (the site is down
today because they're moving the servers). Here's how it works :

You post a request on the site, telling how much you are willing to
spend to see it developped. Other users can join you so that's more
money for the developpers. Developpers can submit proposals. You
choose one, commit money on it, the developper does the work, you pay
him and everybody's happy : the developpers got money and the users
got features.

-- 
Laurent Martelli
[EMAIL PROTECTED]  http://www.bearteam.org/~laurent/

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



[SQL] Re: optimizing select ... not in (select ...)

2001-08-13 Thread Laurent Martelli

>>>>> "Tomas" == Tomas Berndtsson <[EMAIL PROTECTED]> writes:

  Tomas> Laurent Martelli <[EMAIL PROTECTED]> writes:
  >> I have this query :
  >> 
  >> select distinct on (Pictures.PictureID) * from Pictures where
  >> Pictures.PictureID not in (select distinct PictureID from
  >> Keywords);
  >> 
  >> and I find it a bit slow. Does anybody have suggestions to run
  >> this faster ? (I have indexes on PictureID on both Pictures and
  >> Keywords)

  Tomas> Try this instead:

  Tomas> select distinct on (Pictures.PictureID) * from Pictures where
  Tomas> not exists (select distinct PictureID from Keywords where
  Tomas> Pictures.PictureID=Keywords.PictureID);

  Tomas> I've found that it's usually faster, probably because it can
  Tomas> use indices better.

It is indeed much faster. Thanks to all of you who answered so fast. 

-- 
Laurent Martelli
[EMAIL PROTECTED]  http://www.bearteam.org/~laurent/

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



[SQL] Function and insert

2002-11-27 Thread Laurent Patureau

Hi,

I want to do a function that insert a row on a table like :

CREATE FUNCTION ajout_secu(INT4) RETURNS OID
AS 'INSERT INTO test_2 VALUES($1);'
LANGUAGE 'SQL';

PG refuse to accept the type returns oid as the function is not a SELECT.
What can I do ?

thanks for your help,

LP



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



[SQL] Select Match on PostgreSQL.

2003-08-29 Thread Laurent Patureau


Hi,

I'm looking for a SELECT request on PostgreSQL for a search engine.
I'd like the request return me the pertinence (relevance) of each
result.

I've found the MySQL syntax on the web :
mysql> SELECT id, body, MATCH (title,body) AGAINST
-> ('Security implications of running MySQL as root') AS score
-> FROM articles WHERE MATCH (title,body) AGAINST
-> ('Security implications of running MySQL as root');

But how can I do it on PostgreSQL where Match syntax is not accepted
?

Thanks to help me.

Regards.

Laurent Patureau.
Co-gérant / Ingénieur d'Affaire.
____
   
Laurent Patureau

S.A.R.L. ID.fr

   
mailto:[EMAIL PROTECTED]

 
http://www.idfr.net

    Porter un nouveau regard à votre audience :
  
http://www.wysistat.com


Tel : 03 81 48 03 13

Fax : 03 81 48 04 83

   16,
Boulevard Winston Churchill
 
25 000 Besançon
___



[SQL] Information about the command SQL " create synonym".

2004-10-12 Thread Gerald . Laurent
Hello !

I am trying to find some informations about the SQL command "create
synonym".

The command "create synonym" does not exit in the Postgres database.

I had tested with the latest version (postgres8.0 beta3) and this command
is not present.

I supposed that this command "create synnonym" is an extention of the SQL92
on the other database like Oracle, Informix etc..

Could you say if this command will be implemanted in a future version of a
postgres database ?

Best regards.


---(end of broadcast)---
TIP 8: explain analyze is your friend