Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
On Tue, 2008-02-12 at 21:14 -0600, Andy Colson wrote: Having used the large objects, I can tell you they do backup (pg_dump, etc) and they are not hard to use. There is even a contrib that helps you hook them up to a table so they get deleted/etc at appropriate times (I have not used it

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Gevik Babakhani
In hour case we where switching between databases so what I have done in the past was: For inserting: 1. create a TEXT column in my table. (In PG this can be 1GB in size) 2. read file contents in a buffer/string and Base64 encode that string. 3. write the string into db. For reading: 1. read

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
On Tue, 2008-02-12 at 17:16 -0700, Leonel Nunez wrote: My two questions are: Is this summary correct? And: Which method should I choose? With Java , Python , Perl you've got functions that escapes the data for you What about C++ and PHP? Koen ---(end of

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
On Wed, 2008-02-13 at 07:37 +0100, Gevik Babakhani wrote: Which programming language are you using? That would be C++ for storing and both C++ and PHP for retrieving the data. Maybe also PL/SQL for retrieval (in addition to or instead of PHP). Koen ---(end of

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Peter Wilson
Koen Vermeer wrote: Hi, I would like to store binary data in a PostgreSQL database. The size of the data is about 2 to 20 MB and is always stored or retrieved as a block (i.e., I do not need to get only part of the data). As I understand, I have two options for storing this data: As BYTEA or as

[GENERAL] show time consumed by query in psql

2008-02-13 Thread Willy-Bas Loos
Hi, I´m on a slow internet connection, but i want to optimize a view on a server. I have console access, so psql seems the right way - pgAdmin from the client is just way biassed. How can i make psql report the amount of time that was consumed in the query?? I´ve seen a couple of posts that refer

Re: [GENERAL] dynamic crosstab

2008-02-13 Thread Masse Jacques
I found this to create dynamic crosstabs (where the resulting columns are not known beforehand): http://www.ledscripts.com/tech/article/view/5.html (Thanks for Denis Bitouzé on http://www.postgresonline.com/journal/index.php?/archives/14-C

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
On Wed, 2008-02-13 at 09:57 +0100, Gevik Babakhani wrote: In hour case we where switching between databases so what I have done in the past was: For inserting: 1. create a TEXT column in my table. (In PG this can be 1GB in size) 2. read file contents in a buffer/string and Base64 encode that

[GENERAL] Perceived weaknesses of postgres

2008-02-13 Thread Csaba Nagy
http://www.theserverside.com/news/thread.tss?thread_id=48339 The interesting part is where somebody asks why NOT use postgres, and it's answers could give some additional hints to those interested on what people find missing from postgres to adopt it. Just to summarize some of the answers: *

Re: [GENERAL] show time consumed by query in psql

2008-02-13 Thread A. Kretschmer
am Wed, dem 13.02.2008, um 10:22:29 +0100 mailte Willy-Bas Loos folgendes: How can i make psql report the amount of time that was consumed in the query?? IŽve seen a couple of posts that refer to this, but everyone seems to solve it in some other way. Is this not a feature of psql? (it should

Re: [GENERAL] show time consumed by query in psql

2008-02-13 Thread Richard Huxton
Willy-Bas Loos wrote: Hi, I´m on a slow internet connection, but i want to optimize a view on a server. I have console access, so psql seems the right way - pgAdmin from the client is just way biassed. How can i make psql report the amount of time that was consumed in the query?? I´ve seen a

[GENERAL] 8.3 and uuid: unable to run uuid-ossp.sql

2008-02-13 Thread Giorgio Valoti
Hi all, I’m trying to enable the uuid module with a SUSE Linux. I’ve installed the uuid library with the default settings and configured/ compiled/installed pgsql with these flags: ./configure --prefix=/opt/local/pgsql --with-perl --with-tcl --with- tclconfig=/opt/local/lib --with-openssl

Re: [GENERAL] 8.3 and uuid: unable to run uuid-ossp.sql

2008-02-13 Thread Alvaro Herrera
Giorgio Valoti wrote: When I try to install the uuid functions I get this error: psql:share/contrib/uuid-ossp.sql:9: ERROR: could not load library / opt/local/pgsql/lib/uuid-ossp.so: libuuid.so.16: cannot open shared object file: No such file or directory Make sure the libuuid.so.16

Re: [GENERAL] character conversion problem about UTF-8--SHIFT_JIS_2004

2008-02-13 Thread Alvaro Herrera
bh yuan escribió: I think [some character codes may not have a conversion table] is the reasion. Now I occour 「〜」(0xefbd9e)、「―」(0xe28095)、「?b!W(0xe9ab99) can not be converted to SJIS without error message. I convert the character to another SJIS character by UPDATE tablexx SET

Re: [GENERAL] Perceived weaknesses of postgres

2008-02-13 Thread Dawid Kuroczko
On Feb 13, 2008 10:49 AM, Csaba Nagy [EMAIL PROTECTED] wrote: http://www.theserverside.com/news/thread.tss?thread_id=48339 The interesting part is where somebody asks why NOT use postgres, and it's answers could give some additional hints to those interested on what people find missing from

Re: [GENERAL] Perceived weaknesses of postgres

2008-02-13 Thread Csaba Nagy
On Wed, 2008-02-13 at 13:29 +0100, Dawid Kuroczko wrote: * no direct table cache control; Could you elaborate more on this one? Well, I was just summarizing what other people wrote :-) But I guess they refer to table level control of how much cache memory to use. I think there are DBMSs

Re: [GENERAL] Perceived weaknesses of postgres

2008-02-13 Thread Tino Wildenhain
Csaba Nagy wrote: http://www.theserverside.com/news/thread.tss?thread_id=48339 The interesting part is where somebody asks why NOT use postgres, and it's answers could give some additional hints to those interested on what people find missing from postgres to adopt it. Just to summarize some

Re: [GENERAL] Perceived weaknesses of postgres

2008-02-13 Thread Csaba Nagy
On Wed, 2008-02-13 at 13:39 +0100, Csaba Nagy wrote: On Wed, 2008-02-13 at 13:29 +0100, Dawid Kuroczko wrote: * no direct table cache control; Could you elaborate more on this one? OK, re-reading what I just wrote makes me think it was not clear enough: I think they mean you can

Re: [GENERAL] Perceived weaknesses of postgres

2008-02-13 Thread Magnus Hagander
Dawid Kuroczko wrote: On Feb 13, 2008 10:49 AM, Csaba Nagy [EMAIL PROTECTED] wrote: http://www.theserverside.com/news/thread.tss?thread_id=48339 The interesting part is where somebody asks why NOT use postgres, and it's answers could give some additional hints to those interested on what

Re: [GENERAL] dynamic crosstab

2008-02-13 Thread Tino Wildenhain
Hi, SunWuKung wrote: Hi, I found this to create dynamic crosstabs (where the resulting columns ... This could work although for hundreds of columns it looks a bit scary for me. Well I'd say hundreds of columns are always scary, no matter how you do it :-) ... I know that most db people

Re: [GENERAL] Perceived weaknesses of postgres

2008-02-13 Thread Csaba Nagy
On Wed, 2008-02-13 at 13:56 +0100, Magnus Hagander wrote: I don't think these people are comparing to other opensource ones... They're comparing to the commercial ones (at least in this case) Yes, that's definitely the case. And that can actually be taken as a compliment to the already

Re: [GENERAL] Perceived weaknesses of postgres

2008-02-13 Thread Brad Nicholson
Dawid Kuroczko wrote: Slony is good as long as there are no DDLs issued. And its easy to shoot oneself in the foot if one is not careful (some time ago I have lost all the triggers while upgrading from 8.1 to 8.2; it was my fault since I did pg_dump -s on a slave database, not on the

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Alvaro Herrera
Koen Vermeer wrote: Instead of base64 encoding, I guess it would be easier to just escape the required bytes and store them in a bytea. Actually, if you have access to the pqExecParams() call, you can pass the bytes to a bytea column unescaped, which AFAIK saves some processing on both the

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
On Wed, 2008-02-13 at 09:35 +, Peter Wilson wrote: I've used both methods. The only real problem is that none of the trigger based replication schemes such as Slony can't deal with large objects. I can live with that for now. If the project ever gets that big, I probably need to rethink

Re: [GENERAL] WINDOWS INSTALLATION TIPS

2008-02-13 Thread Maarten Boekhold
Hi, Richard Huxton wrote: INDIANNIC-HOSTING wrote: a) if your server is hosted in a dataceneter for installation on windows 2000 you cannot use terminal service. Hmm - this *should* be documented somewhere. I don't really use Windows and I know about it somehow. Can't you use change

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Alvaro Herrera
Koen Vermeer wrote: The large-objects-are-actually-files thing applies to my situation, so unless there is some 'large objects are / will be deprecated' argument, I guess I stick with large objects. Certainly there is no such argument. -- Alvaro Herrera

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-13 Thread Andrew Sullivan
On Tue, Feb 12, 2008 at 08:39:05PM -0700, Ken Johanson wrote: between 3rd party products (customer API and database x^n). I'm trying to convey here that changing the behavior to a (numb AS varchar) one, practically speaking, is more benign/useful (vs now), even if that is only a non-spec

Re: [GENERAL] character conversion problem about UTF-8--SHIFT_JIS_2004

2008-02-13 Thread Tatsuo Ishii
hi I used Postgresql7.4.3 with php for more than 3years. Now I want to change my database to Postgresql8.3. But I occur such problem -- ERROR: character 0xe9ab99 of encoding UTF8 has no equivalent in SJIS ERROR: character 0xe9ab99 of

Re: [GENERAL] WINDOWS INSTALLATION TIPS

2008-02-13 Thread Magnus Hagander
Maarten Boekhold wrote: Hi, Richard Huxton wrote: INDIANNIC-HOSTING wrote: a) if your server is hosted in a dataceneter for installation on windows 2000 you cannot use terminal service. Hmm - this *should* be documented somewhere. I don't really use Windows and I know about it somehow.

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Peter Wilson
Koen Vermeer wrote: On Wed, 2008-02-13 at 09:35 +, Peter Wilson wrote: My preference : if I don't need the file-like interface to large objects I'd use BYTEA every time. Right, so that basically means that when 'large objects' are files, which should be saved and restored as a

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-13 Thread Ken Johanson
Alvaro Herrera wrote: If you are arguing that the spec's definition of the CHARACTER type is not really very useful, I think you are going to find a lot of supporters. You can send your complaints to the SQL committee; but then, it is unlikely that this is going to change anytime soon because

[GENERAL] Order of SUBSTR and UPPER in statement

2008-02-13 Thread Hermann Muster
Hi, I encountered something I can't really explain. I use the following statement in my application: COALESCE(UPPER(SUBSTR(Y.Firma,1,7)),'') This returns ERROR: syntax error at end of input However, using the following statement is fine: COALESCE(SUBSTR(UPPER(X.Firma), 1, 7), '') The

Re: [GENERAL] character conversion problem about UTF-8--SHIFT_JIS_2004

2008-02-13 Thread Tatsuo Ishii
hi I used Postgresql7.4.3 with php for more than 3years. Now I want to change my database to Postgresql8.3. But I occur such problem -- ERROR: character 0xe9ab99 of encoding UTF8 has no equivalent in SJIS ERROR: character 0xe9ab99 of

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-13 Thread Ken Johanson
Andrew Sullivan wrote: No, you're trying to convey that it is more benign/useful _to you_. Others are arguing that they want to write conformant code, and don't much care what MyOccasionallyReadTheSpec does. It's a pity that SQL conformance is not better across systems, but surely the way to

Re: [GENERAL] msvcr80.dll and PostgreSQL 8.3 under Windows XP

2008-02-13 Thread Dave Page
On Feb 13, 2008 3:05 PM, Hermann Muster [EMAIL PROTECTED] wrote: Dave Page schrieb: On Feb 5, 2008 7:52 AM, Hermann Muster [EMAIL PROTECTED] wrote: I also checked the folder C:\Program Files\Common Files\Merge Modules Microsoft_VC80_CRT_x86.msm which is not available on my system. It

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-13 Thread Alvaro Herrera
Ken Johanson wrote: Henceforth SELECT CAST(123 AS char) will and should undisputedly return '1'. If you are arguing that the spec's definition of the CHARACTER type is not really very useful, I think you are going to find a lot of supporters. You can send your complaints to the SQL committee;

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-13 Thread Alvaro Herrera
Ken Johanson wrote: Alvaro Herrera wrote: If you are arguing that the spec's definition of the CHARACTER type is not really very useful, I think you are going to find a lot of supporters. You can send your complaints to the SQL committee; but then, it is unlikely that this is going to change

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-13 Thread Richard Huxton
Alvaro Herrera wrote: Ken Johanson wrote: Alvaro Herrera wrote: If you are arguing that the spec's definition of the CHARACTER type is not really very useful, I think you are going to find a lot of supporters. You can send your complaints to the SQL committee; but then, it is unlikely that

Re: [GENERAL] Order of SUBSTR and UPPER in statement

2008-02-13 Thread Michael Fuhr
On Wed, Feb 13, 2008 at 04:19:09PM +0100, Hermann Muster wrote: I encountered something I can't really explain. I use the following statement in my application: COALESCE(UPPER(SUBSTR(Y.Firma,1,7)),'') This returns ERROR: syntax error at end of input Please show a complete statement and

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-13 Thread Tom Lane
Richard Huxton [EMAIL PROTECTED] writes: [ proof that cast(123 as char) actually produces varchar in mysql ] Egad. I wonder if they think this is a feature? regards, tom lane ---(end of broadcast)--- TIP 3: Have you

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-13 Thread Richard Huxton
Tom Lane wrote: Richard Huxton [EMAIL PROTECTED] writes: [ proof that cast(123 as char) actually produces varchar in mysql ] Egad. I wonder if they think this is a feature? Well, presumably its what all the other convenient (for Ken's particular problem) databases do. The only alternative

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
Op woensdag 13-02-2008 om 15:21 uur [tijdzone +], schreef Peter Wilson: Right, so that basically means that when 'large objects' are files, which should be saved and restored as a whole, it may be more natural to use the large objects. I guess that applies to some uses of media storage

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
Op woensdag 13-02-2008 om 10:45 uur [tijdzone -0300], schreef Alvaro Herrera: Instead of base64 encoding, I guess it would be easier to just escape the required bytes and store them in a bytea. Actually, if you have access to the pqExecParams() call, you can pass the bytes to a bytea column

Re: [GENERAL] Deferred constraints and locks...

2008-02-13 Thread Jan Wieck
On 2/12/2008 3:04 PM, Tom Lane wrote: Nathan Wilhelmi [EMAIL PROTECTED] writes: Hello - Trying to track down a lock contention problem, I have a process that does a series of select / insert operations. At some point the process grabs a series of RowExclusiveLock(s) and has the obvious effect

[GENERAL] PostgreSQL 8.3 on Debian, Ubuntu

2008-02-13 Thread Greg Smith
I recall a couple of people asking about when 8.3 would be available for Debian and Ubuntu. Here's an update now that some useful packages have come out this week. Debian has the new source version available for their some distance in the future Sid release at

Re: [GENERAL] dynamic crosstab

2008-02-13 Thread Reece Hart
On Wed, 2008-02-13 at 14:04 +0100, Tino Wildenhain wrote: Well after all you want a CSV not a table. You could shortcut this with a generic query which creates array out of your columns and join them to a CSV line. This would just be outputted as one single column from database. Depending on

Re: [GENERAL] dynamic crosstab

2008-02-13 Thread Klein Balazs
Yes, thanks. The problem with those function is that they all have an AS (columname type, ...) part or equivalent. -Original Message- From: Masse Jacques [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 13, 2008 10:20 AM To: SunWuKung; pgsql-general@postgresql.org Subject: RE:

Re: [GENERAL] SELECT CAST(123 AS char) - 1

2008-02-13 Thread Ken Johanson
Richard Huxton wrote: What I couldn't figure out was what type MySQL was using. I mean, what type is this? mysql SELECT cast(a as char) as achar FROM tt; +---+ | achar | +---+ | 1 | | 10| +---+ 2 rows in set (0.00 sec) Is it char(2)? mysql CREATE TEMPORARY TABLE ttchar0

[GENERAL] performance issues on windows with 8.3.0?

2008-02-13 Thread Dan Armbrust
Are there any known regression issues WRT performance on the 8.3.0.1 binary build for windows? And I mean serious -multiple orders of magnitude- performance issues running simple queries on a small database... A little more background. I built 8.3.0 on Cent OS 5 today. Started using it with a

Re: [GENERAL] Some Autovacuum Questions

2008-02-13 Thread Decibel!
On Feb 12, 2008, at 9:13 AM, Thomas Chille wrote: vacuum_cost_delay = 200 vacuum_cost_page_hit = 6 vacuum_cost_limit = 100 Vacuum is going to take forever with those settings. I strongly suggest you set them back to default. If you need to throttle vacuum, try setting

Re: [GENERAL] pg_dump, pg_restore.

2008-02-13 Thread Tom Lane
Emil J. [EMAIL PROTECTED] writes: Before pg_dump, default value is: ... DEFAULT moja_schema.fn_sq_id_kotuc() ... After pg_restore, default value is: ... DEFAULT fn_sq_id_kotuc() ... The name of the scheme is missing, it is cut off. I need first variant of default value (with name of the

[GENERAL] pg_dump, pg_restore.

2008-02-13 Thread Emil J.
Hello, I have some question about pg_dump, pg_restore. At the end of this text is full dump of database db_test. This database has one table with one field named id_kotuc. Default value for this field is function named fn_sq_id_kotuc(). Function and table is in same schema named moja_schema.

Re: [GENERAL] Conditional ordering operators

2008-02-13 Thread Sergey Konoplev
On 2/12/08, Decibel! [EMAIL PROTECTED] wrote: You should start a project for this on pgFoundry. It looks very useful! On Feb 6, 2008, at 1:15 PM, Sergey Konoplev wrote: Hello everybody. I've written a script (see attachment) which creates operators @ - ascending ordering @ -