Re: [GENERAL] Best way to store and retrieve photo from PostGreSQL

2007-02-25 Thread Jean-Christophe Roux
Hello Tomas, Tomas Vondra wrote: Store the pictures in the filesystem and only the path, description and other metadata in the database. My suggestion ;-) Andreas Anyway, I do recommend storing images in the database, using a 'bytea' column for the binary data (and load them only if

[GENERAL] skip duplicate key error during inserts

2006-10-20 Thread Jean-Christophe Roux
Hello,I have a table like this:create table dummy (value integer primary key);and I insert a row like thisinsert into dummy values(0);then I want to insert three rows:insert into dummy values(0);insert into dummy values(1);insert into dummy values(2);none of them will be inserted because the first

Re: [GENERAL] looping through query to update column

2006-10-13 Thread Jean-Christophe Roux
Thanks for the "ctid" trick. The code below worked fine for rec in select * from fromemail_trades loop update fromemail_trades set recordid = row where ctid = rec.ctid; row := row -1; end loop;The first line is a little different from your's: FOR row IN SELECT ctid, * FROM table FOR UPDATE

[GENERAL] looping through query to update column

2006-10-12 Thread Jean-Christophe Roux
Hello,I am trying to loop through a table to update one columncreate or replace function foo() returns integer as $$declare rec RECORD; row integer := 0;begin for rec in select * from table loop update rec set recordid = row; row++; end loop; return 0;end;$$ language plpgsqlIn pgadmin, I am

Re: [GENERAL] Storing images in PostgreSQL databases (again)

2006-10-06 Thread Jean-Christophe Roux
Roux [EMAIL PROTECTED]Cc: pgsql-general@postgresql.orgSent: Thursday, October 5, 2006 7:35:04 PMSubject: Re: [GENERAL] Storing images in PostgreSQL databases (again)On Oct 6, 2006, at 01:29 , Jean-Christophe Roux wrote: By the way, is it practical to set a bytea column (containing pictures) as primary

Re: [GENERAL] Storing images in PostgreSQL databases (again)

2006-10-05 Thread Jean-Christophe Roux
Hi,If the database had built-in functions to manipulate images (make a thumbnail, add text ont it.., make a montage of two pictures) and I could write something like select thumbnail(image_field, 100, 100) from images_tablethat would be a good reason to go the db route versus the filesystem route.

[GENERAL] now() and time zone

2006-10-04 Thread Jean-Christophe Roux
Hello,I am a bit sorry to come back on that topic but I just cannot get it right. How comes that select now() at time zone 'EST'returns "2006-10-04 15:59:26.713623"when it is actually 16:59 on the east coast? Can it be that the server where the PostgreSQL database is located is not properly

Re: [GENERAL] now() and time zone

2006-10-04 Thread Jean-Christophe Roux
Yes you are right, that's what I have just realized; I should be using EDT instead of EST. Sorry for the botherJCR- Original Message From: Martijn van Oosterhout kleptog@svana.orgTo: Jean-Christophe Roux [EMAIL PROTECTED]Cc: pgsql-general@postgresql.orgSent: Wednesday, October 4, 2006 5:06

Re: [GENERAL] pg web hosting with tsearch2?

2006-09-29 Thread Jean-Christophe Roux
I don't know if A2webhosting.com specifically supports tsearch2, but they say they offer 8.1 with procedural language installed.JCR- Original Message From: Joshua D. Drake [EMAIL PROTECTED]To: Rick Schumeyer [EMAIL PROTECTED]Cc: pgsql-general@postgresql.orgSent: Friday, September 29, 2006

[GENERAL] ...unknown user name or bad password error during install

2006-02-24 Thread Jean-Christophe Roux
Hi,I am trying to install PostgreSQL 8.1.3 on windows xp. This computer had previous versions of postgresql installed but they have been uninstalled.When the installer reach the window Service Configuration, I keep the default values and add a password. I am getting the error:"Invalid username

Re: [GENERAL] Sequence skipping values

2006-02-12 Thread Jean-Christophe Roux
Micheal,Thanks a lot for you very clear explanation. To solve the problem, I have created another table so that the table does not use a rule to update itself. It works fine now.RegardsJCRMichael Fuhr [EMAIL PROTECTED] wrote: On Sat, Feb 11, 2006 at 06:06:21AM -0800, Jean-Christophe Roux wrote

Re: [GENERAL] Sequence skipping values

2006-02-11 Thread Jean-Christophe Roux
helpJCRMichael Fuhr [EMAIL PROTECTED] wrote: On Fri, Feb 10, 2006 at 08:10:36PM -0800, Jean-Christophe Roux wrote: here are the structures of the table involved:I co uldn't duplicate the problem in 8.1.2 or 8.0.6 with the codeyou posted. I created the given tables and rules (plus guesses forthe

[GENERAL]

2006-02-10 Thread Jean-Christophe Roux
Hello,I have a table with and id field (primary key) which default value is the result of a sequence (increment explicitly set to 1). To my surprise, the real increment on insert is the total number of rows of the table. For instance, with 41 rows and a sequence last_value of 1141, the next insert

[GENERAL] Sequence skipping values

2006-02-10 Thread Jean-Christophe Roux
Hello,I have a table with and id field (primary key) which default value is the result of a sequence (increment explicitly set to 1). To my surprise, the real increment on insert is the total number of rows of the table. For instance, with 41 rows and a sequence last_value of 1141, the next

Re: [GENERAL] Sequence skipping values

2006-02-10 Thread Jean-Christophe Roux
contain a column that refer to topics.id as a foreign key.Those three columns contain id automatically generated by sequences and I have not observed any problemThanksJCSteve Crawford [EMAIL PROTECTED] wrote: Jean-Christophe Roux wrote: Hello, I have a table with and id field (primary key) which

Re: [GENERAL] Sequence skipping values

2006-02-10 Thread Jean-Christophe Roux
0800, Jean-Christophe Roux wrote: The table with the id not incrementing by 1 as I expected is named topics. I have three other tables that contain rules that on insert into those tables, some fields of the table Topic should be updated. Each of those three tables contain a column that refer to