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

2008-02-18 Thread Hermann Muster
Dave Page schrieb: 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

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

2008-02-18 Thread Hermann Muster
Michael Fuhr schrieb: On Thu, Feb 14, 2008 at 04:48:33PM +0100, Hermann Muster wrote: Michael Fuhr schrieb: COALESCE(UPPER(SUBSTR(X.Firma,1,7)) = I haven't examined the entire query but the above line appears to be the problem. Did you mean to write the following?

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

2008-02-18 Thread Dave Page
On Feb 18, 2008 10:05 AM, Hermann Muster [EMAIL PROTECTED] wrote: Hi Dave, after testing several combinations I can tell you following, because maybe I couldn't make clear what my problem is. The msvcr80.dll is correctly installed in the

[GENERAL] Initdb failed in PostgreSQL 7.3.21

2008-02-18 Thread Kakoli Sen
Hi, I install PostgreSQL 7.3.21 successfully with sudo and could start the postmaster as sudo. Then I want to initialise my own db as unprivileged user. I run the following commands: root# mkdir /usr/local/pgsql/data root# chown kakolis /usr/local/pgsql/data root# su kakolis kakolis$

[GENERAL] composite type vs table

2008-02-18 Thread Marek Lewczuk
Hi, I'm using composite types within my database and I sometimes need to modify type either by adding new column or e.g. renaming a column. Of course I can't do that on existing composite type (actually I can, but that is quite complicated) so maybe I should use table instead ? With tables

Re: [GENERAL] Use index for upper(customername) like 'ABC%'

2008-02-18 Thread T.J. Adami
On 4 fev, 18:13, Andrus [EMAIL PROTECTED] wrote: I need to perform case insensitive search by first some characters (ABC) of name like SELECT ... FROM customer WHERE upper(customername) like 'ABC%' My database cluster locale is non-C Database encoding is UTF-8 Which index I must create

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

2008-02-18 Thread T.J. Adami
On 13 fev, 12:19, Hermann Muster [EMAIL PROTECTED] wrote: 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

[GENERAL] Vertical and Horizontal Table Partition

2008-02-18 Thread T.J. Adami
I know that using tablespaces I can create a vertical partition by creating two tables with the same primary key wich stores different columns in each table. However, I need to do some horizontal partition that receives about 2,000,000 records per month. What the best way to perform this

Re: [GENERAL] Vertical and Horizontal Table Partition

2008-02-18 Thread Enrico Sirola
inheritance + triggers probably. there's an example on the pgsql documentation Il giorno 18/feb/08, alle ore 13:18, T.J. Adami ha scritto: I know that using tablespaces I can create a vertical partition by creating two tables with the same primary key wich stores different columns in each

[GENERAL] partitioning and postgres,

2008-02-18 Thread dave.
Hi every body, I'm working on a database which have big tables and one of the tables is expected to grow very fast so we need to use partitioning. the problem is that I can't find a solution to do the partitioning automatically, I mean what postgres docs describe at (5.9. Partitioning) is not

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

2008-02-18 Thread Dave Page
On Feb 18, 2008 3:11 PM, Hermann Muster [EMAIL PROTECTED] wrote: I finally found the problem. I unfortunately used an very old version of Dependency Walker which couldn't handle the libpq.dll and always showed that the msvcr80.dll is missing. After installing PostgreSQL 8.3 and updating the

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

2008-02-18 Thread Hermann Muster
Dave Page schrieb: On Feb 18, 2008 10:05 AM, Hermann Muster [EMAIL PROTECTED] wrote: Hi Dave, after testing several combinations I can tell you following, because maybe I couldn't make clear what my problem is. The msvcr80.dll is correctly installed in the

Re: [GENERAL] Auto incrementing primary keys

2008-02-18 Thread Paul Boddie
On 18 Feb, 13:36, django_user [EMAIL PROTECTED] wrote: How can stop postgresql from incrementing the primary key value, so that even after many failed insert statements it get the next id val. Auto-incrementing columns, typically implemented using the serial data type [1], employ sequences.

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

2008-02-18 Thread Tony Caduto
Dave Page wrote: You can avoid this by building your own libpq.dll using mingw/msys if you like - that will work just fine with a VC++ built server. Hi Dave, Just some thoughts on the whole libpq.dll thing. It would be really nice from a client distribution view of things to have a

Re: [GENERAL] How to return a large String with C

2008-02-18 Thread Stefan Niantschur
Am Sun, 17 Feb 2008 14:28:18 -0500 schrieb Tom Lane [EMAIL PROTECTED]: Stefan Niantschur [EMAIL PROTECTED] writes: Am Sun, 17 Feb 2008 09:17:08 -0500 schrieb Tom Lane [EMAIL PROTECTED]: Hardly surprising when you're printing the string into a fixed-size 8K buffer. The buffer overflow is

Re: [GENERAL] Auto incrementing primary keys

2008-02-18 Thread pgsql_user
On Feb 18, 6:08 pm, Paul Boddie [EMAIL PROTECTED] wrote: On 18 Feb, 13:36, django_user [EMAIL PROTECTED] wrote: How can stop postgresql from incrementing the primary key value, so that even after many failed insert statements it get the next id val. Auto-incrementing columns, typically

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

2008-02-18 Thread Magnus Hagander
On Mon, Feb 18, 2008 at 04:11:14PM +0100, Hermann Muster wrote: Dave Page schrieb: On Feb 18, 2008 10:05 AM, Hermann Muster [EMAIL PROTECTED] wrote: Hi Dave, after testing several combinations I can tell you following, because maybe I couldn't make clear what my problem is. The

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

2008-02-18 Thread Dave Page
On Feb 18, 2008 3:38 PM, Tony Caduto [EMAIL PROTECTED] wrote: Dave Page wrote: You can avoid this by building your own libpq.dll using mingw/msys if you like - that will work just fine with a VC++ built server. Hi Dave, Just some thoughts on the whole libpq.dll thing. It would be

Re: [GENERAL] the feasibility of sending email from stored procedure in Postgres

2008-02-18 Thread Christopher Browne
On Feb 17, 2008 7:47 AM, Jorge Godoy [EMAIL PROTECTED] wrote: Em Friday 15 February 2008 12:36:37 Adam Rich escreveu: I would instead queue messages (or suitable information about them) in a table, and have a process outside PostgreSQL periodically poll for them Why poll when you can

Re: [GENERAL] Are indexes blown?

2008-02-18 Thread Andrew Sullivan
On Sat, Feb 16, 2008 at 12:38:04PM +0800, Phoenix Kiula wrote: My hosting provider tells me that the Postgresql server is taking up a lot of memory but I've been running the same db with the same config for over 2 years. Yes we have been growing but what happened in the last 3 days to warrant

Re: [GENERAL] Use index for upper(customername) like 'ABC%'

2008-02-18 Thread Pavel Stehule
Hello if you have non-c locale, you have to use varchar_pattern_ops - like: create index like_index on lidi (prijmeni varchar_pattern_ops); Regards Pavel Stehule On 18/02/2008, T.J. Adami [EMAIL PROTECTED] wrote: On 4 fev, 18:13, Andrus [EMAIL PROTECTED] wrote: I need to perform case

[GENERAL] Automatic partitioning,

2008-02-18 Thread dave.
Hi, I'm working on a database which have big tables and one of the tables is expected to grow very fast so we need to use partitioning. the problem is that I can't find a solution to do the partitioning automatically, I mean what postgres docs describe at (5.9. Partitioning) is not suitable

[GENERAL] deadlock with truncate and foreing keys

2008-02-18 Thread Alexey Nalbat
Hello. I've encountered deadlock with first transaction updating information field in the primary table, and second trasaction reloading secondary table using TRUNCATE and INSERT. Here is simple example: create table t1 ( id integer primary key, name text ); create table t2 ( id integer

[GENERAL] questions about very large table and partitioning

2008-02-18 Thread [EMAIL PROTECTED]
Hi all, I'm trying to create a very large table with more than 0.6 billion rows, which is really a big number, so I think I have to create partitioned tables after some googling. However, I have a few questions about partitioning in PostgreSQL. 1) PostgreSQL only support partition by

Re: [GENERAL] nntp interface not working?

2008-02-18 Thread Andrew Sullivan
On Sat, Feb 16, 2008 at 10:38:56AM -0500, Arturo Pérez wrote: HI all, The news/NNTP feed to these mailing lists does not seem to be working. No, the news server's been broken for a while. A ---(end of broadcast)--- TIP 3: Have you checked our

Re: [GENERAL] Are indexes blown?

2008-02-18 Thread Andrew Sullivan
On Fri, Feb 15, 2008 at 09:09:32PM +0800, Phoenix Kiula wrote: Actually my host has just told me that I have a number of hung semaphores in my server. And he is relating them to postgresql. I am not surprised, because this is the only utility that has issues. All the rest is working (apache,

Re: [GENERAL] Analogue to SQL Server UniqueIdentifier?

2008-02-18 Thread Dave Page
On Feb 18, 2008 4:52 PM, Bill Moran [EMAIL PROTECTED] wrote: In response to [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi My porting experiment has encountered the SQL Server UniqueIdentifier problem. I can see one or two suggestions about this have been made over the years but I'd like

Re: [GENERAL] Analogue to SQL Server UniqueIdentifier?

2008-02-18 Thread [EMAIL PROTECTED]
Thanks Bill. I discovered that 8.3 supports a UUID datatype. Thus a CREATE DOMAIN uniqueidentifier AS uuid works fine for the aliasing. There are no SQL Server style functions for UUID creation but I can handle this in the client code. Works a treat. Jerry

Re: [GENERAL] Analogue to SQL Server UniqueIdentifier?

2008-02-18 Thread Bill Moran
In response to [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi My porting experiment has encountered the SQL Server UniqueIdentifier problem. I can see one or two suggestions about this have been made over the years but I'd like to try and stay close to the original. So: I'm wondering if I can

Re: [GENERAL] questions about very large table and partitioning

2008-02-18 Thread Erik Jones
On Feb 18, 2008, at 11:23 AM, Enrico Sirola wrote: Il giorno 18/feb/08, alle ore 17:37, [EMAIL PROTECTED] ha scritto: 1) PostgreSQL only support partition by inheritance, and rules have to be created for each child table, this will result *a lot of* rules if the number of child tables is

Re: [GENERAL] Auto incrementing primary keys

2008-02-18 Thread Raymond O'Donnell
On 18/02/2008 13:14, pgsql_user wrote: so wouldnt I run out of ids one day, if there are lot of failed insert statements, lets say for every successful insert there are 50 unsuccessful inserts, so ids would be 1, 50, 100, and once I have thousands of rows, I will run out of IDs ? should I use

Re: [GENERAL] questions about very large table and partitioning

2008-02-18 Thread Enrico Sirola
Il giorno 18/feb/08, alle ore 17:37, [EMAIL PROTECTED] ha scritto: 1) PostgreSQL only support partition by inheritance, and rules have to be created for each child table, this will result *a lot of* rules if the number of child tables is large. Are there some smart ways to avoid this kind of

Re: [GENERAL] Auto incrementing primary keys

2008-02-18 Thread Raymond O'Donnell
On 18/02/2008 17:46, Raymond O'Donnell wrote: Well, that depends on your usage, so only you can answer that. According to the docs, serial creates an integer column, which will give you 2147483647 values - how quickly will you use that lot up? If you think you will run out, by all means use

Re: [GENERAL] Initdb failed in PostgreSQL 7.3.21

2008-02-18 Thread David Fetter
On Mon, Feb 18, 2008 at 05:45:05PM +0530, Kakoli Sen wrote: Hi, I install PostgreSQL 7.3.21 successfully with sudo and could start the postmaster as sudo. The 7.3 series is no longer supported. Use 8.3 instead. Cheers, David. -- David Fetter [EMAIL PROTECTED] http://fetter.org/ Phone: +1

Re: [GENERAL] Auto incrementing primary keys

2008-02-18 Thread Steve Atkins
On Feb 18, 2008, at 9:56 AM, Raymond O'Donnell wrote: On 18/02/2008 17:46, Raymond O'Donnell wrote: Well, that depends on your usage, so only you can answer that. According to the docs, serial creates an integer column, which will give you 2147483647 values - how quickly will you use

Re: [GENERAL] questions about very large table and partitioning

2008-02-18 Thread Enrico Sirola
Il giorno 18/feb/08, alle ore 18:42, Erik Jones ha scritto: On Feb 18, 2008, at 11:23 AM, Enrico Sirola wrote: Il giorno 18/feb/08, alle ore 17:37, [EMAIL PROTECTED] ha scritto: 1) PostgreSQL only support partition by inheritance, and rules have to be created for each child table, this

Re: [GENERAL] How to return a large String with C (solved)

2008-02-18 Thread Stefan Niantschur
Am Sun, 17 Feb 2008 14:28:18 -0500 schrieb Tom Lane [EMAIL PROTECTED]: Stefan Niantschur [EMAIL PROTECTED] writes: Am Sun, 17 Feb 2008 09:17:08 -0500 schrieb Tom Lane [EMAIL PROTECTED]: Hardly surprising when you're printing the string into a fixed-size 8K buffer. The buffer overflow is

Re: [GENERAL] How to return a large String with C

2008-02-18 Thread Tom Lane
Stefan Niantschur [EMAIL PROTECTED] writes: Please find below the most recent code snippet. It is mainly based on examples from the pg documentation: ---8 --- #define GET_TEXT(cstrp) DatumGetTextP(DirectFunctionCall1(textin, CStringGetDatum(cstrp))) (...) char *cres; int ret;

Re: [GENERAL] Auto incrementing primary keys

2008-02-18 Thread Scott Marlowe
On Feb 18, 2008 12:16 PM, Steve Atkins [EMAIL PROTECTED] wrote: On Feb 18, 2008, at 9:56 AM, Raymond O'Donnell wrote: On 18/02/2008 17:46, Raymond O'Donnell wrote: Well, that depends on your usage, so only you can answer that. According to the docs, serial creates an integer column,

Re: [GENERAL] Initdb failed in PostgreSQL 7.3.21

2008-02-18 Thread Scott Marlowe
On Feb 18, 2008 6:15 AM, Kakoli Sen [EMAIL PROTECTED] wrote: Hi, I install PostgreSQL 7.3.21 successfully with sudo and could start the postmaster as sudo. The postmaster won't starte without a valid data directory. Then I want to initialise my own db as unprivileged user. I run

Re: [GENERAL] How to return a large String with C

2008-02-18 Thread Stefan Niantschur
Am Mon, 18 Feb 2008 14:15:14 -0500 schrieb Tom Lane [EMAIL PROTECTED]: Stefan Niantschur [EMAIL PROTECTED] writes: Please find below the most recent code snippet. It is mainly based on examples from the pg documentation: ---8 --- #define GET_TEXT(cstrp)

Re: [GENERAL] Initdb failed in PostgreSQL 7.3.21

2008-02-18 Thread Tom Lane
Kakoli Sen [EMAIL PROTECTED] writes: I install PostgreSQL 7.3.21 successfully with sudo and could start the postmaster as sudo. What platform is that? How exactly did you install Postgres --- build from source, install someone's package (whose?), ...? Why are you intent on making a

Re: [GENERAL] deadlock with truncate and foreing keys

2008-02-18 Thread Tom Lane
Alexey Nalbat [EMAIL PROTECTED] writes: create table t1 ( id integer primary key, name text ); create table t2 ( id integer references t1 ); insert into t1 values ( 1 ); insert into t2 values ( 1 ); Then two concurrent transactions start. /* 1 */ begin; /* 1 */ truncate t2; /* 2

Re: [GENERAL] deadlock with truncate and foreing keys

2008-02-18 Thread Gregory Stark
Alexey Nalbat [EMAIL PROTECTED] writes: Hello. I've encountered deadlock with first transaction updating information field in the primary table, and second trasaction reloading secondary table using TRUNCATE and INSERT. Here is simple example: create table t1 ( id integer primary key, name

Re: [GENERAL] Initdb failed in PostgreSQL 7.3.21

2008-02-18 Thread Tom Lane
Scott Marlowe [EMAIL PROTECTED] writes: On Feb 18, 2008 1:44 PM, Tom Lane [EMAIL PROTECTED] wrote: Why are you intent on making a fresh installation of 7.3.x anyway? Seems like it'd be better to take the opportunity to move to a non-obsolete release. Who knows? He might have a 6.5.3 server

Re: [GENERAL] Initdb failed in PostgreSQL 7.3.21

2008-02-18 Thread Scott Marlowe
On Feb 18, 2008 1:44 PM, Tom Lane [EMAIL PROTECTED] wrote: Kakoli Sen [EMAIL PROTECTED] writes: I install PostgreSQL 7.3.21 successfully with sudo and could start the postmaster as sudo. What platform is that? How exactly did you install Postgres --- build from source, install

Re: [GENERAL] deadlock with truncate and foreing keys

2008-02-18 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: Alexey Nalbat [EMAIL PROTECTED] writes: create table t1 ( id integer primary key, name text ); create table t2 ( id integer references t1 ); /* 1 */ truncate t2; /* 2 */ update t1 set name='foo' where id=1; I think what's going on here is that in

Re: [GENERAL] Pains in upgrading to 8.3

2008-02-18 Thread Alvaro Herrera
Bruce Momjian escribió: Magnus Hagander wrote: For the case of upgrading, it wouldn't work. But there are certainly other cases where it would help. Say from your central pgadmin console administering 10 servers from 3 different major release trees :-( What's wrong with providing

Re: [HACKERS] [GENERAL] deadlock with truncate and foreing keys

2008-02-18 Thread Stephan Szabo
On Mon, 18 Feb 2008, Tom Lane wrote: Alexey Nalbat [EMAIL PROTECTED] writes: create table t1 ( id integer primary key, name text ); create table t2 ( id integer references t1 ); insert into t1 values ( 1 ); insert into t2 values ( 1 ); Then two concurrent transactions start. /* 1

Re: [GENERAL] SPI-functions and transaction control

2008-02-18 Thread Alvaro Herrera
Mikko Partio escribió: Now, I was wondering if a c function would be faster, and with the help of the manual I have written a function that can insert tuples from one table to another. As the manual states ( http://www.postgresql.org/docs/8.3/interactive/spi.html), there is no way to catch

Re: [HACKERS] [GENERAL] deadlock with truncate and foreing keys

2008-02-18 Thread Tom Lane
Stephan Szabo [EMAIL PROTECTED] writes: On Mon, 18 Feb 2008, Tom Lane wrote: but right offhand I see no reason for it to do so --- it doesn't *do* anything with fk_rel except close it again. Likewise RI_FKey_keyequal_upd_fk doesn't seem to really need to touch the pk_rel. Is there something

Re: [GENERAL] Pains in upgrading to 8.3

2008-02-18 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Bruce Momjian escribió: What cases on the past have needed the new pg_dump? Dependency handling IIRC in 7.3 (or was it 7.2?) was a big change for pg_dump, and I don't think we would have liked to backpatch the pg_dump changes. Also, AFAIK the

Re: [GENERAL] Auto incrementing primary keys

2008-02-18 Thread Reid Thompson
On Mon, 2008-02-18 at 17:46 +, Raymond O'Donnell wrote: On 18/02/2008 13:14, pgsql_user wrote: so wouldnt I run out of ids one day, if there are lot of failed insert statements, lets say for every successful insert there are 50 unsuccessful inserts, so ids would be 1, 50, 100, and once

[GENERAL] out-of-line (TOAST) storage ineffective when loading from dump?

2008-02-18 Thread Markus Bertheau
Afaics, TOAST was invented so that big attributes wouldn't be in the way (of readahead, the buffer cache and so on) when working with the other attributes. This is based on the assumption that the other attributes are accessed more often than the whole contents of the big attributes. Now I wonder