Re: [SQL] Changing character set when the damage is done

2006-12-24 Thread Alexis Paul Bertolini
Michael Fuhr wrote: Are you sure that's not a tilde (a wavy line above the A) instead of a cedilla (a hook below the A)? The UTF-8 encoding for lowercase e with grave is 0xc3 0xa8, which in ISO-8859-1 (LATIN1) or Windows-1252 is uppercase A with tilde followed by a diaeresis (an umlaut on its ow

Re: [SQL] Changing character set when the damage is done

2006-12-24 Thread Alexis Paul Bertolini
Ragnar wrote: On lau, 2006-12-23 at 00:12 +0100, Alexis Paul Bertolini wrote: depends on whether all imports have been in the same encoding or not. SQL_ASCII basically accepts and stores the characters without interpretation, so if all imorts were done with one client_encoding, you should

[SQL] Changing character set when the damage is done

2006-12-22 Thread Alexis Paul Bertolini
Dear all, I set up a DB with default values and it now uses the SQL_ASCII character set (as per "show client_encoding;"). I have copied in quite a lot of data from various Access databases but only now have I realized that all accented vowels show up differently from what I expected (I dare

Re: [SQL] set return function is returning a single record, multiple

2006-04-28 Thread Alexis Paul Bertolini
CREATE or replace FUNCTION ftoc9() RETURNS setof structrankmaster2 LANGUAGE 'plpgsql' AS' DECLARE rowdata pss%rowtype; BEGIN for i in 1..3 loop select * into rowdata from pss ; return next rowdata ; end loop; return; end'; The query should be outside the loop, otherwise you are re

[SQL] Job queue, how would you implement this?

2006-03-21 Thread Alexis Paul Bertolini
Dear all, I have implemented a job queue table where various apps can add jobs to the queue and other daemons then execute them. A basic producer-consumer pattern. Each tuple in the queue has the basic info such as job to be done, when it should be done, who should do it, a flag marking it com

Re: [SQL] Obtaining client IP address

2006-02-25 Thread Alexis Paul Bertolini
Michael Fuhr wrote: On Sat, Feb 25, 2006 at 12:16:31AM +0100, Alexis Paul Bertolini wrote: The client has no idea what public IP it has. The server ought to know... however I haven't found how I could get this info into my query. What version of PostgreSQL are you running? In 8.

[SQL] Obtaining client IP address

2006-02-24 Thread Alexis Paul Bertolini
Hi, I need to have a db table containing all connected clients (of a distributed application) and among other info, their IP. If both the client and the server are on the same LAN, no problem, the client can supply it's own info. But if they are connected via some sort of bridge/router/NAT?