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 = to_char(new."tim

[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: unexpe

[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: unexp

[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 whe

[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 possi

[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 "l

[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 wrote: > On Tue, Apr 28, 2009 at 10:46 PM, David Fetter 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 >>> wrote: >>> > On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe

[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 possi

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 > wrote: > > On Mon, Apr 27, 2009 at 1:32 PM, Scott Marlowe > > wrote: > >> OK, I'm hitting a wall here.  I've written this trigger for partitioning: > >> > >> create or replace fun

Re: [GENERAL] pg_dump and pg_restore problem

2009-04-30 Thread Alan Hodgson
On Wednesday 29 April 2009, "Michele Petrazzo - Unipex" 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 behavior, a "missing fe

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

2009-04-30 Thread DaNieL..!
On 30 Apr, 07:30, Johan Nel 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 setof recor

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 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 UNIQUE INDEX foo ON cdr_am

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 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 forei

[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 "ti

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 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 > client connect

[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 fair

[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: [] out_of_memory+0x

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 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 nightmare.  I had built something lik

[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 tabl

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 Los

[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 A

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 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: > > SELECT h.id

Re: [GENERAL] could not bind IPv4 socket

2009-04-30 Thread Greg Smith
On Thu, 30 Apr 2009, Grzegorz Bu? wrote: listen_addresses = 'localhost,XXX.XXX.XXX.XXX' where XXX.XXX.XXX.XXX is IP address of remote client that I want to be able to use PostgreSQL server. Port is default. listen_addresses gets set to the IP address of the server itself, the IP address it i

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

2009-04-30 Thread Craig Ringer
Keaton Adams wrote: > Any ideas on how to debug these types of error messages? Maybe you should start by telling us: - your PostgreSQL server version - What platform your server is running on - Your PostgreSQL client driver type and version ( native libpq? pgodbc? jdbc? npgsql? etc) - How you're

[GENERAL] 08P01: unexpected EOF on client connection

2009-04-30 Thread Tomas Vondra
Hi, I've run into some strange troubles with a quite simple web application that stores data in a PostgreSQL database. It is a simple image gallery, displaying multiple thumbnails (stored in a bytea column) on a single page generated by PHP. The problem is some of the images are not displayed.

Re: [GENERAL] Understand this error

2009-04-30 Thread Scott Marlowe
On Thu, Apr 30, 2009 at 7:00 AM, paulo matadr wrote: > 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 ser

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

2009-04-30 Thread Craig Ringer
[reposting as the original seemed to get lost in a mail system issue on my end. Sorry if it did make it.] 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. At a high level, what I need is a way

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

2009-04-30 Thread Richard Broersma
On Wed, Apr 29, 2009 at 5:30 AM, Marcin Krol wrote: > 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. If you mean on row period then just add a limit 1 to the end of your existing query.

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

2009-04-30 Thread Steve Atkins
On Apr 30, 2009, at 1:54 AM, Craig Ringer wrote: 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 (n

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

2009-04-30 Thread Jaime Casanova
On Thu, Apr 30, 2009 at 1:45 AM, DaNieL..! wrote: >> >> > 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" >> if you're inside a server-side function then you cannot use COM