Re: [GENERAL] triggers and execute...

2009-04-30 Thread Dimitri Fontaine
On Monday 27 April 2009 22:32:22 Scott Marlowe wrote: OK, I'm hitting a wall here. I've written this trigger for partitioning: create or replace function page_access_insert_trigger () returns trigger as $$ DECLARE part text; q text; BEGIN part =

[GENERAL] How to begin to debug FATAL: invalid frontend message type 77 error messages?

2009-04-30 Thread Keaton Adams
Any ideas on how to debug these types of error messages? Apr 30 01:36:02 mxlqa401 postgres[23600]: [3-1] FATAL: invalid frontend message type 77 Apr 30 01:36:02 mxlqa401 postgres[23601]: [3-1] LOG: unexpected EOF on client connection Apr 30 01:36:02 mxlqa401 postgres[23602]: [3-1] LOG:

[GENERAL] How to begin to debug FATAL: invalid frontend message type 77 error messages?

2009-04-30 Thread Keaton Adams
Any ideas on how to debug these types of error messages? Apr 30 01:36:02 mxlqa401 postgres[23600]: [3-1] FATAL: invalid frontend message type 77 Apr 30 01:36:02 mxlqa401 postgres[23601]: [3-1] LOG: unexpected EOF on client connection Apr 30 01:36:02 mxlqa401 postgres[23602]: [3-1] LOG:

[GENERAL] possible consistency problem

2009-04-30 Thread Sebastian Böhm
Hi, some days ago I removed all foreign keys from the database to speed up an import. Now I tried to create the keys again but it says: ALTER TABLE ONLY xxx ADD CONSTRAINT y FOREIGN KEY (zz) REFERENCES aaa(bb) ON UPDATE CASCADE; ERROR: constraint yyy for

[GENERAL] PANIC: right sibling's left-link doesn't match

2009-04-30 Thread Henry
Greets, I've recently completed a lengthy repartitioning exercise on half a dozen tables, restoring data, etc. Something strange must have happened at some point (unrelated to the partitioning exercise - a crash related to file descriptors if I recall [not Pg's fault, mine]), because

[GENERAL] Maintaining connectivity/failing gracefully when my application is connected to a PostgreSQL server over Wi-fi on a PDT/PDA handset

2009-04-30 Thread Peter Geoghegan
Hello, I'm developing a PostgreSQL application for Windows CE 5 on a PDT/ PDA in C++/Qt, using Hiroshi Saito's libpq port for that platform. Since the connection is established over wi-fi, and wi-fi connectivity is often flaky, I feel that I have to fail gracefully to as great an extent as

[GENERAL] could not bind IPv4 socket

2009-04-30 Thread Grzegorz Buś
Hi, I'm using Centos 4.7 and after upgrading PostgreSQL to version 8.3.7 (from ver. 7.4) via yum I cannot connect to my postgres server from remote hosts. I know that for PostgreSQL servers starting with version 8.0 remote connections can only be set in postgresql.conf allowing them in

[GENERAL] Pgsql errors, DBI and CGI::Carp

2009-04-30 Thread Toomas Vendelin
I'm writing CGI scripts in Perl using Postgresql via DBI interface. RAISE_ERROR is on. For some reason (unlike with MySQL), when a Perl script dies from Postgresql error, the line number of Perl script where the error occurred is not reported, just the SQL statement line number is given.

Re: [GENERAL] triggers and execute...

2009-04-30 Thread Scott Marlowe
On Tue, Apr 28, 2009 at 11:24 PM, Scott Marlowe scott.marl...@gmail.com wrote: On Tue, Apr 28, 2009 at 10:46 PM, David Fetter da...@fetter.org wrote: On Tue, Apr 28, 2009 at 08:20:34PM -0600, Scott Marlowe wrote: On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma richard.broer...@gmail.com

[GENERAL] Connecting to a postgreSQL database with windows CE over wi-fi; failing gracefully

2009-04-30 Thread Peter Geoghegan
Hello, I'm developing a PostgreSQL application for Windows CE 5 on a PDT/ PDA in C++/Qt, using Hiroshi Saito's libpq port for that platform. Since the connection is established over wi-fi, and wi-fi connectivity is often flaky, I feel that I have to fail gracefully to as great an extent as

Re: [GENERAL] triggers and execute...

2009-04-30 Thread David Fetter
On Tue, Apr 28, 2009 at 08:20:34PM -0600, Scott Marlowe wrote: On Mon, Apr 27, 2009 at 3:24 PM, Richard Broersma richard.broer...@gmail.com wrote: On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe scott.marl...@gmail.com wrote: OK, I'm hitting a wall here.  I've written this trigger for

Re: [GENERAL] pg_dump and pg_restore problem

2009-04-30 Thread Alan Hodgson
On Wednesday 29 April 2009, Michele Petrazzo - Unipex michele.petra...@unipex.it wrote: The unique solution that I found it's that to export with pg_dump all my tables except the table_three and, after, exporting only that and on the other host and import that alone... It's this a normal

Re: [GENERAL] ERROR: syntax error at or near IF... why?

2009-04-30 Thread DaNieL..!
On 30 Apr, 07:30, Johan Nel johan555.nel...@xsinet555.co.za wrote: Daniel, IF (SELECT credit FROM users WHERE name = 'mary') 0 THEN  ROLLBACK; END IF COMMIT; i always get the error ERROR:  syntax error at or near IF Where am i mistaken? SELECT returns in essence a record or

Re: [GENERAL] ERROR: syntax error at or near IF... why?

2009-04-30 Thread Raymond O'Donnell
On 30/04/2009 07:45, DaNieL..! wrote: I tryed the declare, before and after the BEGIN;, but allways returns me the error: --- ERROR: syntax error at or near int; LINE 1: DECLARE _mycredit int;

Re: [GENERAL] delete duplicates takes too long

2009-04-30 Thread Dennis Brakhane
On Sat, Apr 25, 2009 at 2:51 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: In that case you can create a partial unique index: create index foo on cdr_ama_stat (abonado_a, abonado_b, fecha_llamada, duracion) where processed = 2; Of course, the unique is missing in this one: CREATE

Re: [GENERAL] ERROR: syntax error at or near IF... why?

2009-04-30 Thread Johan Nel
DaNieL..! wrote: I tryed the declare, before and after the BEGIN;, but allways returns me the error: --- ERROR: syntax error at or near int; LINE 1: DECLARE _mycredit int; ^

Re: [GENERAL] possible consistency problem

2009-04-30 Thread Alan Hodgson
On Thursday 30 April 2009, Sebastian Böhm s...@exse.net wrote: when I do: alter table only payments drop constraint y; it says : ERROR: is an index note: the constraint in the error message in differed from the constraint in my drop statement !!! (I tried to drop the

[GENERAL] Time zone HADT timestamp syntax error in trigger

2009-04-30 Thread John Smithus
Greetings! I'm encountering an invalid input syntax for type timestamp error in a trigger. The server is running PostgreSQL 8.3.7 on an AMD64 Gentoo Linux machine. The system time zone is set to 'America/Adak' and datestyle is set to 'sql, mdy' in postgresql.conf. The target column type is

Re: [GENERAL] How to begin to debug FATAL: invalid frontend message type 77 error messages?

2009-04-30 Thread Merlin Moncure
On Thu, Apr 30, 2009 at 12:16 PM, Keaton Adams kad...@mxlogic.com wrote: Any ideas on how to debug these types of error messages? Apr 30 01:36:02 mxlqa401 postgres[23600]: [3-1] FATAL:  invalid frontend message type 77 Apr 30 01:36:02 mxlqa401 postgres[23601]: [3-1] LOG:  unexpected EOF on

[GENERAL] Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?

2009-04-30 Thread Craig Ringer
Hi This must be a fairly common requirement, but either I don't know how to ask Google about it or there's not as much out there as I would've expected. I'm looking for a way to map the output from a monotonically increasing sequence (not necessarily gapless - ie a normal Pg SEQUENCE) into a

[GENERAL] Understand this error

2009-04-30 Thread paulo matadr
Hi all, my database entry in mode recovery, analyzing my pg_log I seem this: system logger process (PID 6517) was terminated by signal 9 background writer process (PID 6519) was terminated by signal 9 terminating any other active server processes and OS in var/logs: kernel: [800ba475]

Re: [GENERAL] triggers and execute...

2009-04-30 Thread Alvaro Herrera
Scott Marlowe escribió: Oh man, it just gets worse. I really need a simple elegant solution here, because if I try to build the query by hand null inputs make life a nightmare. I had built something like this: q = 'insert into '||schem||'.page_access_'||part||' values (

Re: [GENERAL] how do you get there from here?

2009-04-30 Thread Michael P. Soulier
Tom Lane wrote: Foreign-key constraints: dashboard_tuginstance_node_id_fkey FOREIGN KEY (node_id) REFERENCES nodes(id) DEFERRABLE INITIALLY DEFERRED This is what's creating the limitation. So, I'm working around it by creating the new columns with the default value that I want

Re: [GENERAL] triggers and execute...

2009-04-30 Thread Scott Marlowe
On Wed, Apr 29, 2009 at 4:23 AM, Alban Hertroys dal...@solfertje.student.utwente.nl wrote: On Apr 29, 2009, at 4:20 AM, Scott Marlowe wrote: Oh man, it just gets worse.  I really need a simple elegant solution here, because if I try to build the query by hand null inputs make life a

[GENERAL] Issue with SSAS

2009-04-30 Thread Peeyush Jain
Hi All, This is regarding the issue facing with SSAS (Sql Server Analysis Services). Issue: While creating a SSAS application I am not able to create data source view with Npgsql. I can able to create data source successfully. While creating data source view Npgsql should show the list of

Re: [GENERAL] triggers and execute...

2009-04-30 Thread Richard Broersma
I wonder if it would be easier to perodically replace the entire trigger function with one that inserts to the correct table using CRON+SED rather than dynamically building SQL. This might be a bad idea however. I'm just thinking outside the box. -- Regards, Richard Broersma Jr. Visit the

[GENERAL] retrieving primary key for row with MIN function

2009-04-30 Thread Marcin Krol
Hello everyone, I need to retrieve PK (r.id in the query) for row with MIN(r.start_date), but with a twist: I need to select only one record, the one with minimum date. Doing it like this does not solve the problem: SELECT h.id AS host_id, MIN(r.start_date) AS reservation_start_date, r.id

Re: [GENERAL] retrieving primary key for row with MIN function

2009-04-30 Thread Scott Marlowe
On Wed, Apr 29, 2009 at 6:30 AM, Marcin Krol mrk...@gmail.com wrote: Hello everyone, I need to retrieve PK (r.id in the query) for row with MIN(r.start_date), but with a twist: I need to select only one record, the one with minimum date. Doing it like this does not solve the problem: