Re: [GENERAL] create temp in function

2008-04-21 Thread A. Kretschmer
am Mon, dem 21.04.2008, um 15:22:52 -0600 mailte Kerri Reno folgendes: > But if I create and run the following function, it bombs on the second run. > It > gives me: > compassdevel_lb=# select testtemp(); > NOTICE: relid: 186270497 > NOTICE: count: 0 > testtemp > -- > t > (1 row) >

[GENERAL] Postgres Encoding conversion problem

2008-04-21 Thread Clemens Schwaighofer
Hi, I sometimes have a problem with conversion of encodings eg from UTF-8 tio ShiftJIS: ERROR: character 0xf0a0aeb7 of encoding "UTF8" has no equivalent in "SJIS" I have no idea what character this is, I cannot view it in my browser, etc. If I run the conversion through PHP with mb_convert_enc

Re: [GENERAL] PostgreSQL on Vista

2008-04-21 Thread Justin
Gurjeet Singh wrote: I would recommend creating rules in your firewall that let Postgres run and listen on sockets rather than turn off the firewall altogether. (The firewall rules _may_ not be the problem in your case, but you can still try) On an orthogonal note, I just disliked the UAC i

Re: [GENERAL] PostgreSQL on Vista

2008-04-21 Thread Gurjeet Singh
I would recommend creating rules in your firewall that let Postgres run and listen on sockets rather than turn off the firewall altogether. (The firewall rules _may_ not be the problem in your case, but you can still try) On an orthogonal note, I just disliked the UAC in Vista... For the first mon

Re: [GENERAL] Schema migration tools?

2008-04-21 Thread Steve Atkins
On Apr 21, 2008, at 7:44 PM, Christophe wrote: Greetings, We have the traditional three servers: dev --> staging --> production each with a PostgreSQL instance and the same schema, at least over time. Right now, we handle schema migration (updating the schema for new releases) by

Re: [GENERAL] Schema migration tools?

2008-04-21 Thread Joshua D. Drake
Christophe wrote: Greetings, Does anything like this exist? If not, I might have a new project... Typically new projects are found over at www.pgfoundry.org. :P Joshua D. Drake -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://

[GENERAL] Schema migration tools?

2008-04-21 Thread Christophe
Greetings, We have the traditional three servers: dev --> staging --> production each with a PostgreSQL instance and the same schema, at least over time. Right now, we handle schema migration (updating the schema for new releases) by manually-created scripts that apply the changes

Re: [GENERAL] table as log (multiple writers and readers)

2008-04-21 Thread David Wilson
On Mon, Apr 21, 2008 at 7:55 PM, Joris Dobbelsteen <[EMAIL PROTECTED]> wrote: > > If you want to clean up the the staging table I have some concerns about > the advisory lock. I think you mean exclusive table lock. Either works, really. An advisory lock is really just a lock over which you have c

Re: [GENERAL] table as log (multiple writers and readers)

2008-04-21 Thread Joris Dobbelsteen
David Wilson wrote: (I originally missed replying to all here; sorry about the duplicate, Vance, but figured others might be interested. On Wed, Apr 16, 2008 at 1:55 PM, Vance Maverick <[EMAIL PROTECTED]> wrote: Another approach would be to queue the log entries in a "staging" table, so that

Re: FW: Re: [GENERAL] create temp in function

2008-04-21 Thread Adrian Klaver
-- Original message -- From: "Kerri Reno" <[EMAIL PROTECTED]> > Adrian, > > I don't understand. Why do I need to use execute? It runs fine the first > time. The second time it bombs, because it's not seeing schedrec > correctly. Which part should be in an execu

Re: FW: Re: [GENERAL] create temp in function

2008-04-21 Thread Alvaro Herrera
Kerri Reno wrote: > Adrian, > > I don't understand. Why do I need to use execute? It's a Postgres shortcoming. It's fixed in 8.3 so if it annoys you too much you can just upgrade. > It runs fine the first > time. The second time it bombs, because it's not seeing schedrec > correctly. Which p

Re: FW: Re: [GENERAL] create temp in function

2008-04-21 Thread Kerri Reno
Adrian, I don't understand. Why do I need to use execute? It runs fine the first time. The second time it bombs, because it's not seeing schedrec correctly. Which part should be in an execute query statement? Thanks! Kerri On 4/21/08, Adrian Klaver <[EMAIL PROTECTED]> wrote: > > Forgot to hi

Re: [GENERAL] table as log (multiple writers and readers)

2008-04-21 Thread Vance Maverick
Thanks to all for your help. I've adopted the scheme involving a "staging" table -- the writer processes insert into that, then a single "publisher" process pulls from that and writes to the log, giving a clean serial order for any reader of the log. Vance On Mon, 2008-04-21 at 23:59 +0200,

FW: Re: [GENERAL] create temp in function

2008-04-21 Thread Adrian Klaver
Forgot to hit reply all. - Forwarded Message: -- From: [EMAIL PROTECTED] (Adrian Klaver) To: "Kerri Reno" <[EMAIL PROTECTED]> Subject: Re: [GENERAL] create temp in function Date: Mon, 21 Apr 2008 23:01:53 + > -- Original message -- > From

Re: [GENERAL] PostgreSQL on Vista

2008-04-21 Thread Justin
this new keyboard has problems, or i can't type ;-) . it should be off not of Justin wrote: Dirk Verleysen wrote: Hi, I have been running a Postgres (8.2.4) on a Windows XP for over 3 months. Last week this machine died and I bought a new Vista machine today. Installed everything on it a

Re: [GENERAL] PostgreSQL on Vista

2008-04-21 Thread Justin
Dirk Verleysen wrote: Hi, I have been running a Postgres (8.2.4) on a Windows XP for over 3 months. Last week this machine died and I bought a new Vista machine today. Installed everything on it and a Postgres (8.2.7). The problem is that I cannot start the Postgres service. I keep getting

Re: [GENERAL] table as log (multiple writers and readers)

2008-04-21 Thread Joris Dobbelsteen
Craig Ringer wrote: [snip] If you really want to make somebody cry, I guess you could do it with dblink - connect back to your own database from dblink and use a short transaction to commit a log record, using table-based (rather than sequence) ID generation to ensure that records were inserted

[GENERAL] create temp in function

2008-04-21 Thread Kerri Reno
Hi All! I'm new to this list, but I've been using PG for a couple of years now. I'm trying to do something in a function that I just can't seem to do. If I do the following in psql or pgadmin: create temp table schedrec (sch text, cl text, st text); select distinct(attrelid) from pg_attribute w

Re: [GENERAL] table as log (multiple writers and readers)

2008-04-21 Thread Joris Dobbelsteen
Andrew Sullivan wrote: On Thu, Apr 17, 2008 at 12:44:51PM +0800, Craig Ringer wrote: It won't work with multiple concurrent writers. There is no guarantee that an INSERT with a timestamp older than the one you just saw isn't waiting to commit. This is pretty unlikely -- I won't say impossible,

[GENERAL] PostgreSQL on Vista

2008-04-21 Thread Dirk Verleysen
Hi, I have been running a Postgres (8.2.4) on a Windows XP for over 3 months. Last week this machine died and I bought a new Vista machine today. Installed everything on it and a Postgres (8.2.7). The problem is that I cannot start the Postgres service. I keep getting the following error: FAT

[GENERAL] Fwd: create temp in function

2008-04-21 Thread Kerri Reno
BTW, this happens the same in PostgreSQL 8.0 and 8.2. Thanks! Kerri -- Forwarded message -- From: Kerri Reno <[EMAIL PROTECTED]> Date: Apr 21, 2008 3:22 PM Subject: create temp in function To: pgsql-general@postgresql.org Hi All! I'm new to this list, but I've been using PG for

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Richard Broersma wrote: On Mon, Apr 21, 2008 at 12:24 PM, Colin Wetherbee <[EMAIL PROTECTED]> wrote: Right, but the problem I see is that my locations are not actually stored in foo. Since many rows of foo can reference the same location, the locations are stored in a separate table and, in fa

Re: [GENERAL] Storing computed values

2008-04-21 Thread Richard Broersma
On Mon, Apr 21, 2008 at 12:24 PM, Colin Wetherbee <[EMAIL PROTECTED]> wrote: > Right, but the problem I see is that my locations are not actually stored in > foo. Since many rows of foo can reference the same location, the locations > are stored in a separate table and, in fact, are referenced by

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Richard Broersma wrote: On Mon, Apr 21, 2008 at 11:19 AM, Colin Wetherbee <[EMAIL PROTECTED]> wrote: My impression of functional indexes is that they're useful mostly in WHERE queries, like the following. SELECT foo, bar, baz FROM some_table WHERE lower(foo) = 'qux'; In this case, the index w

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Colin Wetherbee wrote: Richard Broersma wrote: On Mon, Apr 21, 2008 at 11:02 AM, Colin Wetherbee <[EMAIL PROTECTED]> wrote: Let's say my points table looks like this: point_id | location -+-- 1 | 0101... <-- some PostGIS geometry string 2 | 0101...

Re: [GENERAL] Storing computed values

2008-04-21 Thread Richard Broersma
On Mon, Apr 21, 2008 at 11:19 AM, Colin Wetherbee <[EMAIL PROTECTED]> wrote: > My impression of functional indexes is that they're useful mostly in WHERE > queries, like the following. > > SELECT foo, bar, baz FROM some_table WHERE lower(foo) = 'qux'; > > In this case, the index would be created o

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Richard Broersma wrote: On Mon, Apr 21, 2008 at 11:02 AM, Colin Wetherbee <[EMAIL PROTECTED]> wrote: Let's say my points table looks like this: point_id | location -+-- 1 | 0101... <-- some PostGIS geometry string 2 | 0101... And, my foo table, whic

Re: [GENERAL] Storing computed values

2008-04-21 Thread Richard Broersma
On Mon, Apr 21, 2008 at 11:02 AM, Colin Wetherbee <[EMAIL PROTECTED]> wrote: > Let's say my points table looks like this: > > point_id | location > -+-- > 1 | 0101... <-- some PostGIS geometry string > 2 | 0101... > > And, my foo table, which contains da

Re: [GENERAL] In the belly of the beast (MySQLCon)

2008-04-21 Thread Andrew Sullivan
On Fri, Apr 18, 2008 at 11:15:09AM -0700, Joshua D. Drake wrote: > sync transaction have to run? You know vacuum isn't working while > that transaction is open right? Are you going to have to setup up a > dozen different replicated sets in order to get it done? A dozen sets isn't really a big de

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Colin Wetherbee wrote: SELECT connect(p_start.location, p_end.location) FROM foo JOIN points AS p_start ON foo.point_id_start = points.point_id JOIN points AS p_end ON foo.point_id_end = points.point_id WHERE foo.id = 8192; As I didn't test this code, my syntax was slightly incorrect. JOIN

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Richard Broersma wrote: On Mon, Apr 21, 2008 at 10:34 AM, Colin Wetherbee <[EMAIL PROTECTED]> wrote: I would like to have a table that contains a connection for each distinct pair of points (point1 to point2 is the same as point2 to point1). This table would then be automatically updated every

Re: [GENERAL] Storing computed values

2008-04-21 Thread Richard Broersma
On Mon, Apr 21, 2008 at 10:34 AM, Colin Wetherbee <[EMAIL PROTECTED]> wrote: > I would like to have a table that contains a connection for each distinct > pair of points (point1 to point2 is the same as point2 to point1). This > table would then be automatically updated every time a modification

[GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Greetings. I have a question regarding storing computed values. Essentially, it's a question about caching, and I'm willing to implement a cache on the client side or using pg_memcache, but I wonder if I can do this in a PostgreSQL table, instead? The background is that I'm using PostGIS to

Re: [GENERAL] Tsearch2 Spanish Dictionary

2008-04-21 Thread Alvaro Herrera
Mario Ignacio Rodríguez Cortés wrote: > But in postgresql-8.3.1: > > SELECT to_tsvector('spanish','estadística'); > to_tsvector > - > 'stic':2 > (1 row) It works for me: alvherre=# SELECT to_tsvector('spanish','estadística'); to_tsvector -- 'estadist':1 (1 fila)

[GENERAL] Tsearch2 Spanish Dictionary

2008-04-21 Thread Mario Ignacio Rodríguez Cortés
Hi All: I have installed postgresql 8.3.1 on a Gentoo server, but i think that the spanish dictionary isn't the correct because i have another two machines with other postgresql versions and tserch2 installed, and a simple test that i do is make a query with the spanish dictionary, i get the follo

Re: [GENERAL] help with "plpgsql"

2008-04-21 Thread Shane Ambler
Pau Marc Munoz Torres wrote: Hi everybody I trying to upload some plpsql functions to postgresql database using a perl script and i get the following error psql:/usr/local/Make2D-DB_II /pgsql/make2db_functions.pgsql:85: ERROR: language "plpgsql" does not exist HINT: Use CREATE LANGUAGE to l

Re: [GENERAL] help with "plpgsql"

2008-04-21 Thread Christophe
On Apr 21, 2008, at 8:51 AM, Pau Marc Munoz Torres wrote: psql:/usr/local/Make2D-DB_II /pgsql/make2db_functions.pgsql:85: ERROR: language "plpgsql" does not exist HINT: Use CREATE LANGUAGE to load the language into the database. and then when I try to create the language, i get geldb=# C

Re: [GENERAL] In the belly of the beast (MySQLCon)

2008-04-21 Thread Greg Smith
On Sun, 20 Apr 2008, Scott Marlowe wrote: I wonder if there's a comprehensive list somewhere... There's a good list on the database side at http://www.postgresql.org/docs/current/interactive/populate.html but it doesn't dwelve into hardware changes. I put a reference to that as a placehold

Re: [GENERAL] help with "plpgsql"

2008-04-21 Thread Craig Ringer
Pau Marc Munoz Torres wrote: ERROR: language "plpgsql" already exists anybody knows what's wrong? Is there any chance you might be connecting to a different database with the perl script and with psql? Procedural languages must be installed into a particular database. -- Craig Ringer --

Re: [GENERAL] help with "plpgsql"

2008-04-21 Thread Pau Marc Munoz Torres
Hi everybody I trying to upload some plpsql functions to postgresql database using a perl script and i get the following error psql:/usr/local/Make2D-DB_II /pgsql/make2db_functions.pgsql:85: ERROR: language "plpgsql" does not exist HINT: Use CREATE LANGUAGE to load the language into the datab

Re: [GENERAL] JDBC addBatch more efficient?

2008-04-21 Thread David Wall
Does this means that the two features are independent one from each other ? In other words, can we say that JDBC batch will limit information exchange between client and server while Postgres prepared statements will optimize their execution ? I've not used it yet, but my impression is that yo

[GENERAL] pg_bulkloader (was Re: In the belly of the beast (MySQLCon))

2008-04-21 Thread Chris Browne
[EMAIL PROTECTED] ("Scott Marlowe") writes: > What I keep dreaming of is a process that lets slony use pg_bulkloader > or something like it to do the initial load... Does there seem to be some likelihood of some portion of pg_bulkloader getting added to core? It sounds like it's worth looking at

Re: [GENERAL] In the belly of the beast (MySQLCon)

2008-04-21 Thread Chris Browne
[EMAIL PROTECTED] (Csaba Nagy) writes: > On Sun, 2008-04-20 at 11:32 -0600, Scott Marlowe wrote: >> On Sun, Apr 20, 2008 at 11:12 AM, Scott Ribe <[EMAIL PROTECTED]> wrote: >> > > I am going to play with this and see where it breaks, but it's going to >> > > be >> > > an enormous time investment t

Re: [GENERAL] JDBC addBatch more efficient?

2008-04-21 Thread Ivano Luberti
Does this means that the two features are independent one from each other ? In other words, can we say that JDBC batch will limit information exchange between client and server while Postgres prepared statements will optimize their execution ? Kris Jurka ha scritto: On Sun, 20 Apr 2008, Dav

Re: [GENERAL] JDBC addBatch more efficient?

2008-04-21 Thread David Wall
The JDBC driver's batch processing is more efficient than regular execution because it requires fewer network roundtrips so there's less waiting. The JDBC batch is broken into an internal batch size of 256 statement and all of these are sent over to the server at once. That's great, Kris.

Re: [GENERAL] How to tell if 64 bit vs 32 bit engine?

2008-04-21 Thread zedware
On 4月21日, 上午1时35分, [EMAIL PROTECTED] (Peter Eisentraut) wrote: > Zoltan Boszormenyi wrote: > > select version(); > > > It will tell you the compiler version and arch as well. You can deduce > > from there. > > That approach is not reliable. I often build and run a 32-bit build of > PostgreSQL on a

Re: [GENERAL] Missing Log File

2008-04-21 Thread Howard Cole
I think I've solved this one - the compared the old to the new postgresql.conf; the new version did not redirect the standard output. Thanks. Howard Cole wrote: I've just installed Postgres 8.2.7 on a W2K3 machine, and created the data directory post installation using initdb. Everything appear

[GENERAL] Missing Log File

2008-04-21 Thread Howard Cole
I've just installed Postgres 8.2.7 on a W2K3 machine, and created the data directory post installation using initdb. Everything appears to be working fine, but there are no log files created. Nor is there a pg_log subdirectory. I have made no changes to the postgresql.conf file. What am I missin

Re: [GENERAL] In the belly of the beast (MySQLCon)

2008-04-21 Thread Csaba Nagy
On Sun, 2008-04-20 at 11:32 -0600, Scott Marlowe wrote: > On Sun, Apr 20, 2008 at 11:12 AM, Scott Ribe <[EMAIL PROTECTED]> wrote: > > > I am going to play with this and see where it breaks, but it's going to be > > > an enormous time investment to babysit it. One more suggestion: if you happen to

Re: [GENERAL] Insert Rewrite rules

2008-04-21 Thread David
I dropped the trigger again and now it works... but it is really slow it was maxing out the cpu doing 26r/s not that this is a big problem because the firewall code wont be reling on the rewrite rules to put the data in the correct spot as it will just insert it into the correct table and I hav

Re: [GENERAL] How to tell if 64 bit vs 32 bit engine?

2008-04-21 Thread Uwe Seher
On Fri, 18 Apr 2008 17:30:18 +0200, Keaton Adams <[EMAIL PROTECTED]> wrote: I did search the archives for this But didn't see a posting that directly answered the question. How do I tell if the 32 bit version of PostgreSQL is running on a 64 bit machine, or if the 64 bit version was ins

Re: [GENERAL] Insert Rewrite rules

2008-04-21 Thread Klint Gore
David wrote: I am having problems with the rewrite rules though it seems to be skipping over any rule that has a where statement in it ie CREATE OR REPLACE RULE firewall_test AS ON INSERT TO firewall DO INSTEAD INSERT INTO firewall_y2008m04d21 VALUES(NEW."time"); INSERT INTO firewall (time) VA

Re: [GENERAL] JDBC addBatch more efficient?

2008-04-21 Thread Kris Jurka
On Sun, 20 Apr 2008, David Wall wrote: Just checking if the JDBC library's batch processing code is more efficient with respect to the postgresql back end or not. Does it really batch the requests and submit them once over the link, or does it just send them to the database to be processed