Re: [NOVICE] [GENERAL] DB insert Error

2006-08-17 Thread Michael Meskes
On Wed, Aug 16, 2006 at 11:40:40AM -0400, Jasbinder Bali wrote: [2998]: ECPGexecute line 97 Ok: INSERT 0 1 This is a backend message saying that the insert command was executed error free and inserted one record. Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De, Michael at

Re: [GENERAL] VACUUM VERBOSE output to STDERR

2006-08-17 Thread fgudin
Date: Thu, 17 Aug 2006 12:48:56 +0200 From: Francis GUDIN [EMAIL PROTECTED] To: Martijn van Oosterhout kleptog@svana.org Cc: John Purser [EMAIL PROTECTED], pgsql-general@postgresql.org Subject: Re: [GENERAL] VACUUM VERBOSE output to STDERR Message-ID: [EMAIL PROTECTED] In-Reply-To: [EMAIL

Re: [GENERAL] VACUUM VERBOSE output to STDERR

2006-08-17 Thread Martijn van Oosterhout
On Thu, Aug 17, 2006 at 12:51:24PM +0200, fgudin wrote: I found a few (different) references to that parameter on the web, but either ways (through DBD::Pg or with psql) fail: SET client_min_messages = WARNING; yields ERROR: 'client_min_messages' is not a valid option name I've got the

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread Jorge Godoy
Dawid Kuroczko [EMAIL PROTECTED] writes: I did not test the code right now, but I've written something similar to it some time ago, and it worked fine. Remember to vacuum gapless_seq table frequently and don't expect stellar performance from it. Interesting approach... And I don't expect

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread Jorge Godoy
elein [EMAIL PROTECTED] writes: If this is true the solution for a transactional, gapless sequence is possible for table.gl_id where updated from count.gl_id. It is simple. However, it *depends* on the fact that the second transaction getting the newly updated record from the first

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread Jorge Godoy
Berend Tober [EMAIL PROTECTED] writes: A business requirement is to generate table rows that have uniformly increasing, whole number sequences, i.e., the gap-less sequence. In this particular case the situation requires multiple such sequences within the same table -- for each employee, there

[GENERAL] apostrophes and psql variables

2006-08-17 Thread Ilja Golshtein
Hello! Is there any way to have psql variable in apostrophes? The idea is to do something like this \set var 'some value' insert into aaa values(:var) after substisution it should as simple as insert into aaa values('some value') I've tried all reasonable quotings I was able to make up but

Re: [GENERAL] apostrophes and psql variables

2006-08-17 Thread Michael Fuhr
On Thu, Aug 17, 2006 at 05:05:00PM +0400, Ilja Golshtein wrote: Is there any way to have psql variable in apostrophes? The idea is to do something like this \set var 'some value' insert into aaa values(:var) test= \set var '\'some value\'' test= insert into aaa values (:var); INSERT 0 1

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread Dawid Kuroczko
On 8/17/06, Merlin Moncure [EMAIL PROTECTED] wrote: On 8/16/06, Dawid Kuroczko [EMAIL PROTECTED] wrote: -- then create a function to retrieve the values: CREATE FUNCTION gseq_nextval(t text) RETURNS integer AS $$ DECLARE n integer; BEGIN SELECT INTO n gseq_value+1

Re: [NOVICE] [GENERAL] DB insert Error

2006-08-17 Thread Jasbinder Bali
but i don't see any record getting inserted in the table..Why is that happenening.On 8/17/06, Michael Meskes [EMAIL PROTECTED] wrote:On Wed, Aug 16, 2006 at 11:40:40AM -0400, Jasbinder Bali wrote: [2998]: ECPGexecute line 97 Ok: INSERT 0 1This is a backend message saying that the insert command

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread Berend Tober
Jorge Godoy wrote: Berend Tober [EMAIL PROTECTED] writes: A business requirement is to generate table rows that have uniformly increasing, whole number sequences, i.e., the gap-less sequence. This is something that I'll also have to code ;-) But the sequence for employees would also be a

Re: [GENERAL] COLLATE

2006-08-17 Thread Kevin Murphy
Tom Lane wrote: Kevin Murphy [EMAIL PROTECTED] writes: What is the answer to Filip's question? I didn't see an answer in the list archives. I've seen several copies of Joe Conway's pg_strxfrm.c code on the web, and it always refers to the Warn_restart variable, which doesn't seem to exist

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread AgentM
Just in case no one else has brought it up- 8.1+ supports 2PC and savepoints, so one alternative would be to run your standard insertion operations in a prepared transaction or savepoint block. If you get so far as being able to prepare the transaction/complete the savepoint block, you

[GENERAL] PostgreSQL getting slower over time, restart of service cures the problem

2006-08-17 Thread Harald Armin Massa
Operating System: Windows 2003 ServerPostgreSQL 8.1.4 from the official installerAfter starting the service, a series of big queries runs blazingly fast ... for around 2 days. Then they get slower by day. After 3-4 days, the postgresql.exe processes have grown to around 120Megabyte Memory Usage

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread Merlin Moncure
On 8/17/06, Dawid Kuroczko [EMAIL PROTECTED] wrote: On 8/17/06, Merlin Moncure [EMAIL PROTECTED] wrote: On 8/16/06, Dawid Kuroczko [EMAIL PROTECTED] wrote: -- then create a function to retrieve the values: CREATE FUNCTION gseq_nextval(t text) RETURNS integer AS $$ DECLARE n

[GENERAL] autovacuum = on ignored

2006-08-17 Thread Gene
For some reason when I restart postgresql the autovacuum = on is ignored and when I do a show all it is showed as being off. It did not always do this until recently. What is the best way to diagnose what maybe happening? Are there other config files which may prevent it from being run? Thanks --

Re: [GENERAL] autovacuum = on ignored

2006-08-17 Thread Matthew T. O'Connor
Gene wrote: For some reason when I restart postgresql the autovacuum = on is ignored and when I do a show all it is showed as being off. It did not always do this until recently. What is the best way to diagnose what maybe happening? Are there other config files which may prevent it from being

[GENERAL] Restarting Slony crashes Postgresql?

2006-08-17 Thread Nico
Hi group, I'm using Slony-I 1.1.5 with Postgresql 8.1.4 on 3 DB server (OS = debian sarge). I set a replication from a database on server A (master) to 2 servers B and C (slaves). Note that the slaves databases are in production and have a quite big load. I noticed last day that when I stop

Re: [GENERAL] hint unique result from union

2006-08-17 Thread Matteo Bertini
Correct! Didn't noticed the never executed in the explain analyze output :-P Steve Atkins ha scritto: select foo from bar limit 1 ? I don't know if there's any guaranteed ordering of results from a union query, though, and that's what a query on a set of inherited tables will expand to,

[GENERAL] Dynamic partial index

2006-08-17 Thread gustavo halperin
Hello I'm interesting in a partial index for a rows that aren't older than 6 mounts, something like the sentence below: /CREATE INDEX name_for_the_index ON table (the_column_of_type_date) WHERE ( the_column_of_type_date (current_date - interval '6 month')::date );/ But this is

[GENERAL] Troubles linking with libpqxx

2006-08-17 Thread Eric
Hi, I'm trying to compile the test001.cxx sample included in the libpqxx-2.6.7 package, but I get the following linking errors from Visual Studio .Net 2003: -- Build started: Project: PostGreSample, Configuration: Release Win32 -- Linking... msvcprt.lib(MSVCP71.dll) : error

[GENERAL] Dynamic Partial Index

2006-08-17 Thread gustavo halperin
Hello I'm interesting in a partial index for a rows that aren't older than 6 mounts, something like the sentence below: -- /CREATE INDEX

Re: [GENERAL] Dynamic Partial Index

2006-08-17 Thread Jeff Davis
On Thu, 2006-08-17 at 20:50 +0300, gustavo halperin wrote: I'm interesting in a partial index for a rows that aren't older than 6 mounts, something like the sentence below:

Re: [GENERAL] autovacuum = on ignored

2006-08-17 Thread Vivek Khera
On Aug 17, 2006, at 12:43 PM, Matthew T. O'Connor wrote: Do you have row level stats enabled? is block level stats not sufficient for autovacuum? i'm seeing the same: show all tells me autovacuum is off, but it is for sure turned on in the postgresql.conf file and block level stats are

[GENERAL] Newbie Copy From not working

2006-08-17 Thread Walter Vaughan
For the past few months we have been experimenting with using MySQL with Apache OFBiz. However, we are not sure that we can live with the performance. We have a large dataset that we wanted to import into PostgreSQL, but it seems to fail no matter what we do. We tried ever nuance we could to

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread Merlin Moncure
On 8/17/06, Brad Nicholson [EMAIL PROTECTED] wrote: Hmm, I think you are wrong. There is a SELECT ... FOR UPDATE; The first-to-obtain the gapless sequence transaction will establish a lock onthe tax_id row. The other transaction will block until the first transaction finishes (and the

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread Scott Marlowe
On Thu, 2006-08-17 at 15:07, Merlin Moncure wrote: On 8/17/06, Brad Nicholson [EMAIL PROTECTED] wrote: Hmm, I think you are wrong. There is a SELECT ... FOR UPDATE; The first-to-obtain the gapless sequence transaction will establish a lock onthe tax_id row. The other transaction

Re: [GENERAL] Newbie Copy From not working

2006-08-17 Thread Terry Lee Tucker
On Thursday 17 August 2006 03:27 pm, Walter Vaughan [EMAIL PROTECTED] thus communicated: The problem is I need to load a field that is allowed to be null with nothing and it work The above statement is not the problem you are having. We dumped and loaded a 4 gig Progress database with

Re: [NOVICE] [GENERAL] DB insert Error

2006-08-17 Thread Michael Fuhr
On Thu, Aug 17, 2006 at 10:19:57AM -0400, Jasbinder Bali wrote: but i don't see any record getting inserted in the table.. Why is that happenening. How exactly are you determining that the record isn't being inserted? Are you sure you're connected to the right database and querying tables in

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread Brad Nicholson
On Thu, 2006-08-17 at 16:07 -0400, Merlin Moncure wrote: On 8/17/06, Brad Nicholson [EMAIL PROTECTED] wrote: Hmm, I think you are wrong. There is a SELECT ... FOR UPDATE; The first-to-obtain the gapless sequence transaction will establish a lock onthe tax_id row. The other

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread Brad Nicholson
On Thu, 2006-08-17 at 15:13 -0500, Scott Marlowe wrote: On Thu, 2006-08-17 at 15:07, Merlin Moncure wrote: On 8/17/06, Brad Nicholson [EMAIL PROTECTED] wrote: Hmm, I think you are wrong. There is a SELECT ... FOR UPDATE; The first-to-obtain the gapless sequence transaction will

Re: [GENERAL] Newbie Copy From not working

2006-08-17 Thread Michael Fuhr
On Thu, Aug 17, 2006 at 03:27:26PM -0400, Walter Vaughan wrote: Admin_=# COPY DATA_IMPORT_CUSTOMER FROM '/tmp/sold.pg' delimiter '|' null ''; ERROR: missing data for column processed_timestamp CONTEXT: COPY data_import_customer, line 1: (xxx) xxx-||Mary|Smith|76 Crest Street||Jersey

[GENERAL] select * from users where user_id NOT in (select ban_userid from banlist)

2006-08-17 Thread Alexander Farber
Hello, I have this strange problem that the following statement works: phpbb= select user_id, username from phpbb_users phpbb- where user_id in (select ban_userid from phpbb_banlist); user_id | username -+-- 3 | La-Li (1 row) But the negative one returns nothing:

[GENERAL] count and limit

2006-08-17 Thread Fabio Victora Hecht
Hi!I've been using Postgresql for a while now and I'm very satisfied.I was wondering if there's a way to count the results of a query and return part of the result set it in one query (LIMIT). Because I usually have to count the results using one query (to tell the user how many records match the

Re: [GENERAL] Best approach for a gap-less sequence

2006-08-17 Thread Dawid Kuroczko
On 8/17/06, Merlin Moncure [EMAIL PROTECTED] wrote: On 8/17/06, Brad Nicholson [EMAIL PROTECTED] wrote: Hmm, I think you are wrong. There is a SELECT ... FOR UPDATE; The first-to-obtain the gapless sequence transaction will establish a lock onthe tax_id row. The other transaction will

Re: [GENERAL] Dynamic Partial Index

2006-08-17 Thread gustavo halperin
Jeff Davis wrote: On Thu, 2006-08-17 at 20:50 +0300, gustavo halperin wrote: I'm interesting in a partial index for a rows that aren't older than 6 mounts, something like the sentence below:

Re: [GENERAL] Newbie Copy From not working

2006-08-17 Thread Walter Vaughan
Michael Fuhr wrote: On Thu, Aug 17, 2006 at 03:27:26PM -0400, Walter Vaughan wrote: ERROR: missing data for column processed_timestamp The table you posted has 42 columns; at least one line in the file doesn't have that many fields. Yes, we didn't have the right number of columns...

Re: [GENERAL] select * from users where user_id NOT in (select

2006-08-17 Thread Stephan Szabo
On Thu, 17 Aug 2006, Alexander Farber wrote: I have this strange problem that the following statement works: NULLs are not your friends. :( phpbb= select user_id, username from phpbb_users phpbb- where user_id in (select ban_userid from phpbb_banlist); user_id | username

Re: [GENERAL] count and limit

2006-08-17 Thread Chris
Fabio Victora Hecht wrote: Hi! I've been using Postgresql for a while now and I'm very satisfied. I was wondering if there's a way to count the results of a query and return part of the result set it in one query (LIMIT). Because I usually have to count the results using one query (to tell

Re: [GENERAL] Dynamic Partial Index

2006-08-17 Thread Jeff Davis
On Fri, 2006-08-18 at 00:19 +0300, gustavo halperin wrote: Create an index on the table, and then periodically move records into a separate archive table. Regards, Jeff Dave Thanks, but I have a question. If the table is a BIIG table, use your solution is still a good idea ??

Re: [GENERAL] select * from users where user_id NOT in (select

2006-08-17 Thread Tom Lane
Stephan Szabo [EMAIL PROTECTED] writes: On Thu, 17 Aug 2006, Alexander Farber wrote: But the negative one returns nothing: phpbb= select user_id, username from phpbb_users phpbb- where user_id not in (select ban_userid from phpbb_banlist); user_id | username -+-- (0 rows)

Re: [GENERAL] count and limit

2006-08-17 Thread Tom Lane
Chris [EMAIL PROTECTED] writes: Fabio Victora Hecht wrote: I was wondering if there's a way to count the results of a query and return part of the result set it in one query (LIMIT). I was going to suggest a cursor but I don't think you can get the number of results a cursor has :( In

Re: [GENERAL] count and limit

2006-08-17 Thread Michael Fuhr
On Fri, Aug 18, 2006 at 10:34:44AM +1000, Chris wrote: Fabio Victora Hecht wrote: I was wondering if there's a way to count the results of a query and return part of the result set it in one query (LIMIT). Because I usually have to count the results using one query (to tell the user how many

Re: [GENERAL] count and limit

2006-08-17 Thread Chris
Tom Lane wrote: Chris [EMAIL PROTECTED] writes: Fabio Victora Hecht wrote: I was wondering if there's a way to count the results of a query and return part of the result set it in one query (LIMIT). I was going to suggest a cursor but I don't think you can get the number of results a cursor

Re: [NOVICE] [GENERAL] DB insert Error

2006-08-17 Thread Jasbinder Bali
My program started working. Its inserting records now. I've done no significant changes in my C code. Thanks alot for your help. Jasbinder On 8/17/06, Michael Fuhr [EMAIL PROTECTED] wrote: On Thu, Aug 17, 2006 at 10:19:57AM -0400, Jasbinder Bali wrote: but i don't see any record getting inserted

Re: [GENERAL] Troubles linking with libpqxx

2006-08-17 Thread Sandeep Kumar Jakkaraju
Hi Eric Check your Runtime Library( MultiThreaded Debug Dll etc) and Struct member alignment !!!They should be same as what you used to compile libpqRegardssandeep On 8/16/06, Eric [EMAIL PROTECTED] wrote: Hi,I'm trying to compile the test001.cxx sample included in thelibpqxx-2.6.7 package, but I