Re: [GENERAL] Generic timestamp function for updates where field

2007-01-03 Thread novnov
Thanks, that did it, and I'd not seen that set of docs yet, should be helpful. -- View this message in context: http://www.nabble.com/Generic-timestamp-function-for-updates-where-field-names-vary-tf2899327.html#a8155138 Sent from the PostgreSQL - general mailing list archive at Nabble.com. --

Re: [GENERAL] could not open file xxxx for writing: Permission denied

2007-01-03 Thread Magnus Hagander
> Hello, > > Using PostgreSQL 8.1.4, pgadmin III 1.6.0 in WinXP I tried to export a table > using COPY (first time in postgresql, did many times in Sybase): > > COPY ml50jtsk_datum_v TO 'c:/postgresql/ml50jtsk.out'; > > I got the following errormessage: > > ERROR: could not open file "c:/postgr

Re: [GENERAL] Tabbed data in tab-separated output

2007-01-03 Thread mike
How are you attempting to restore the table after using psql? Psql insert statements? Pgdump? COPY FROM? Mike On Wed, 2007-01-03 at 17:59 -0800, [EMAIL PROTECTED] wrote: > I have a table which has a few VARCHAR columns whose first character > is a tab. If I run pg_dump on this table, it outputs

Re: [GENERAL] could not open file xxxx for writing: Permission

2007-01-03 Thread mike
That usually means that the database user doesn't have Windows file level permissions to write to that folder. Maybe when you upgraded to pgadmin 1.6 and now are using a different user id to log into the it? Perhaps the destination directory was c: \postgresql\8.1\data before? Mike On Thu, 2007

[GENERAL] could not open file xxxx for writing: Permission denied

2007-01-03 Thread Tomas Lanczos
Hello, Using PostgreSQL 8.1.4, pgadmin III 1.6.0 in WinXP I tried to export a table using COPY (first time in postgresql, did many times in Sybase): COPY ml50jtsk_datum_v TO 'c:/postgresql/ml50jtsk.out'; I got the following errormessage: ERROR: could not open file "c:/postgresql/ml50jtsk.out" f

[GENERAL] Tabbed data in tab-separated output

2007-01-03 Thread felix
I have a table which has a few VARCHAR columns whose first character is a tab. If I run pg_dump on this table, it outputs data like this: 43158 \t555-12123 where the two embedded white spaces are actually tabs. If I use psql to execute SQL to dump parts of the table, like this: ps

Re: [GENERAL] Generic timestamp function for updates where field

2007-01-03 Thread Adrian Klaver
On Wednesday 03 January 2007 9:10 am, novnov wrote: > Adrian Klaver wrote: > > On Wednesday 03 January 2007 12:13 am, novnov wrote: > >> Adrian Klaver wrote: > >> > On Sunday 31 December 2006 8:48 am, novnov wrote: > >> >> OK. python would be the preference, if anyone is interested in > >> >> showi

Re: [GENERAL] superuser authentication?

2007-01-03 Thread woger151
- Original Message - From: "Bill Moran" <[EMAIL PROTECTED]> To: "woger151" <[EMAIL PROTECTED]> Cc: Sent: Wednesday, January 03, 2007 10:09 AM Subject: Re: [GENERAL] superuser authentication? In response to Tom Lane <[EMAIL PROTECTED]>: "woger151" <[EMAIL PROTECTED]> writes: > What

Re: [GENERAL] superuser authentication?

2007-01-03 Thread woger151
- Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> To: "woger151" <[EMAIL PROTECTED]> Cc: Sent: Wednesday, January 03, 2007 9:52 AM Subject: Re: [GENERAL] superuser authentication? "woger151" <[EMAIL PROTECTED]> writes: What I'm not sure about is how to authenticate the post

Re: [GENERAL] [pgsql-es-ayuda] Update to 8.2 in openSUSE 10.2

2007-01-03 Thread Juan Martínez
Romulo Hunter escribió: Hola a todos. Como sabemos openSUSE viene con muchos paquetes para instalar o preinstalados. El punto es que viene con la versión de PostgreSQL 8.1... y cuando descargo la 8.2 desde el sitio de PostgreSQL me lo instala en en /usr/local/pgsl; la instalación inicial del moto

Re: [GENERAL] Backup Restore

2007-01-03 Thread Bob Pawley
Found it in template 1. This seems strange as both servers and pgadmins are the same version and I haven't opened the template until today. Bob - Original Message - From: "Richard Huxton" To: "Bob Pawley" <[EMAIL PROTECTED]> Cc: "Dave Page" <[EMAIL PROTECTED]>; "Shoaib Mir" <[EMAIL P

Re: [GENERAL] queueing via database table?

2007-01-03 Thread Vivek Khera
On Jan 3, 2007, at 2:00 AM, Steve Atkins wrote: Holding a lock while generating the thumbnail doesn't sound like a great idea, and I think that the select for update will end up serialising the requests. I'd add a "rendering" field, text, defaulting to an empty string. Then do a "select for u

Re: [GENERAL] pg_dump problems

2007-01-03 Thread Richard Huxton
JTyrrell wrote: pg_dump -a -d testrig > testrig.data on a machine running postgresql 7.4.13 with database testirg i have no problem. Then, I want to do the same but on a different machine running postgresql 7.4.6 with database root. So... pg_dump -a -d root > root.data For some reason this d

Re: [GENERAL] About auto_increment

2007-01-03 Thread Yesh
Hi, Thankx guys I am now able to increment that field by using serial. Richard Huxton wrote: > > Yesh wrote: >> Hi, >> >> I need to know how to increment a primary key field automatically in >> run >> time. > > Not sure precisely what you want to know, but read up on the SERIAL > type, se

[GENERAL] pg_dump problems

2007-01-03 Thread JTyrrell
Hi everyone, I'm having problems using pg_dump. When I run the command pg_dump -a -d testrig > testrig.data on a machine running postgresql 7.4.13 with database testirg i have no problem. Then, I want to do the same but on a different machine running postgresql 7.4.6 with database root. So.

Re: [GENERAL] Geographical redundancy

2007-01-03 Thread Dennis
Well, I am mainly concerned with catastrophic failure. If 1st (main) datacenter fails majorly (say fire, earthquake, db server dies etc), I need to be able to restore websites/data quickly in another location. If I get a data loss of say 6-12 hours during a major failure (which should never occ

Re: [GENERAL] Backup Restore

2007-01-03 Thread Richard Huxton
Bob Pawley wrote: Looking through PGAdmin where would I find the spatial references that the errror message references? Bob Pawley wrote: Following is the error message on pg_restore:- "pg_restore: ERROR: duplicate key violates unique constraint "spatial_ref_sys_pkey" CONTEXT: COPY spatia

Re: [GENERAL] Backup Restore

2007-01-03 Thread Bob Pawley
Looking through PGAdmin where would I find the spatial references that the errror message references? Bob - Original Message - From: "Richard Huxton" To: "Bob Pawley" <[EMAIL PROTECTED]> Cc: "Dave Page" <[EMAIL PROTECTED]>; "Shoaib Mir" <[EMAIL PROTECTED]>; "Postgresql" Sent: Tue

Re: [GENERAL] "no unpinned buffers available" ? why? (hstore and

2007-01-03 Thread Richard Huxton
hubert depesz lubaczewski wrote: On 1/3/07, Richard Huxton wrote: If you do that separately at the start of the process, (one query per custom column in the old table) then it becomes straightforward. no, because meaning of "col1" in advert_custom_fields is different for each record. for on

Re: [GENERAL] Generic timestamp function for updates where field

2007-01-03 Thread novnov
Adrian Klaver wrote: > > On Wednesday 03 January 2007 12:13 am, novnov wrote: >> Adrian Klaver wrote: >> > On Sunday 31 December 2006 8:48 am, novnov wrote: >> >> OK. python would be the preference, if anyone is interested in showing >> >> me how it would be done, I've never used one of the dyn

Re: [GENERAL] Index Scanning

2007-01-03 Thread Enrico
On Wed, 03 Jan 2007 12:21:31 + Richard Huxton wrote: > Don't forget to cc the list Ok thanks :) > > If you issue "set enable_seqscan = off" before the query that should > force it to use the indexes first. What does that plan show you? I try and then I post the results. Regards Enrico

Re: [GENERAL] "no unpinned buffers available" ? why? (hstore and plperl involved)

2007-01-03 Thread hubert depesz lubaczewski
On 1/3/07, Tom Lane <[EMAIL PROTECTED]> wrote: Could you reduce this to a self-contained example please? Your functions depend on a bunch of tables that you have not provided definitions or data for ... i'll try. it will take some time though. hubert -- http://www.depesz.com/ - nowy, lepsz

Re: [GENERAL] "no unpinned buffers available" ? why? (hstore and plperl involved)

2007-01-03 Thread hubert depesz lubaczewski
On 1/3/07, Richard Huxton wrote: If you do that separately at the start of the process, (one query per custom column in the old table) then it becomes straightforward. no, because meaning of "col1" in advert_custom_fields is different for each record. for one record it's codename might be "e

Re: [GENERAL] Database versus filesystem for storing images

2007-01-03 Thread Scott Ribe
Personally, I'd put them on the file system, because then backup software can perform incremental backups. In the database, that becomes more of a difficulty. One suggestion, don't use a file name from a hash to store the image, just use the serial id, and break them up by hundreds or thousands, io

Re: [GENERAL] queueing via database table?

2007-01-03 Thread Scott Marlowe
On Tue, 2007-01-02 at 22:34 -0800, Mark Harrison wrote: > I have a cluster of CPUs generating thumbnails for > a render farm. I would like to place thumbnail > requests on a queue, and have the cluster of client > dequeue the requests and process them. > > Of course, each request should be only d

Re: [GENERAL] superuser authentication?

2007-01-03 Thread Richard Huxton
Bill Moran wrote: Personally, I'd set auth to password, then keep the password in a file in root's home directory and set it readable by root only. If an attacker can read that file, he already doesn't need to. This does mean that you'll have to carefully secure the script you use to make back

Re: [GENERAL] "no unpinned buffers available" ? why? (hstore and

2007-01-03 Thread Richard Huxton
hubert depesz lubaczewski wrote: But, it looks to me like you might be able to replace the plperl function by just a straight query. That should be faster too. really? i was thinking really hard on how to do it in sql, but didn't found any way to achieve it. actually - i dont really think it w

[GENERAL] granting SELECT on _all_ database objects (even non existing objects)

2007-01-03 Thread Joao Miguel Ferreira
Hello All, my database contains a big table. on this table I create VIEWs. The problem is this: the VIEWs are created dinamically by an external program (depending on some configurations). Nevertheless I would like to GRANT SELECT priviliges to my readOnlyUser, in a simple way...!!! Summary: is

Re: [GENERAL] "no unpinned buffers available" ? why? (hstore and plperl involved)

2007-01-03 Thread Tom Lane
"hubert depesz lubaczewski" <[EMAIL PROTECTED]> writes: > and - after some time of this "create table", postmaster process eats all > the memory (over 1.8g), and dies with: > psql:133.sql:125: ERROR: error from Perl function: no unpinned buffers > available at line 5. Could you reduce this to a s

Re: [GENERAL] superuser authentication?

2007-01-03 Thread Bill Moran
In response to Tom Lane <[EMAIL PROTECTED]>: > "woger151" <[EMAIL PROTECTED]> writes: > > What I'm not sure about is how to authenticate the postgresql superuser > > (user 'postgres' on my system). I'm considering: > > > 1. Using ident (supposedly secure because of the SO_PEERCRED mechanism;

Re: [GENERAL] "no unpinned buffers available" ? why? (hstore and plperl involved)

2007-01-03 Thread hubert depesz lubaczewski
On 1/3/07, Richard Huxton wrote: > my questions are: > 1. is it a bug and will it be fixed? > 2. if it is a bug - is it in hstore? plperl? my code? My guess would be that plperl isn't freeing it's result set storage until the end of the transaction. Might not be classed as a bug, but certainly

Re: [GENERAL] superuser authentication?

2007-01-03 Thread Tom Lane
"woger151" <[EMAIL PROTECTED]> writes: > What I'm not sure about is how to authenticate the postgresql superuser > (user 'postgres' on my system). I'm considering: > 1. Using ident (supposedly secure because of the SO_PEERCRED mechanism; and > I've made a lot of effort to secure the server at

[GENERAL] superuser authentication?

2007-01-03 Thread woger151
I'm setting up postgresql (8.1) on what I hope to be a very secure server (SUSE Linux 10.1). Only authentication allowed by anyone is 'local' (unix-domain sockets). Most users I plan on authenticating by PASSWORD (web connections are made to an apache webserver over SSL; the actual postgresql

Re: [GENERAL] "no unpinned buffers available" ? why? (hstore and

2007-01-03 Thread Richard Huxton
hubert depesz lubaczewski wrote: hi, i got this situation: i'm using 8.3devel checked out from cvs about a week ago. if this is neccesary i can rerun the tests in 8.2 or something else. CREATE OR REPLACE FUNCTION get_old_cf_for_advert(INT8) RETURNS setof srf_get_old_cf_for_advert AS $BODY$

Re: [GENERAL] Generic timestamp function for updates where field

2007-01-03 Thread Adrian Klaver
On Wednesday 03 January 2007 12:13 am, novnov wrote: > Adrian Klaver wrote: > > On Sunday 31 December 2006 8:48 am, novnov wrote: > >> OK. python would be the preference, if anyone is interested in showing > >> me how it would be done, I've never used one of the dynamic languages > >> with postgres

[GENERAL] "no unpinned buffers available" ? why? (hstore and plperl involved)

2007-01-03 Thread hubert depesz lubaczewski
hi, i got this situation: i'm using 8.3devel checked out from cvs about a week ago. if this is neccesary i can rerun the tests in 8.2 or something else. i wrote this code: CREATE TYPE srf_get_old_cf_for_advert AS ( codename TEXT, value TEXT ); CREATE OR REPLACE FUNCTION get_old_cf_for_adver

Re: [GENERAL] Index Scanning

2007-01-03 Thread Richard Huxton
Don't forget to cc the list Enrico wrote: On Wed, 03 Jan 2007 10:55:03 + Richard Huxton wrote: You're fetching all the rows from both tables - what would an index scan gain you there is a join Yes, there is a join. Between all the rows in tmp_righe_bolle_carico (tr) and all the match

Re: [GENERAL] queueing via database table?

2007-01-03 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/03/07 00:34, Mark Harrison wrote: > I have a cluster of CPUs generating thumbnails for > a render farm. I would like to place thumbnail > requests on a queue, and have the cluster of client > dequeue the requests and process them. > > Of course

[GENERAL] database design and refactoring

2007-01-03 Thread Luca Ferrari
Hi all, in my database I've got a table with a key that is char string, since it was supposed to support values like strings. Running the database, the users decided to place numbers as strings, so values like 00110002 and so on. Now I was wondering to refactor my database and change the char fie

Re: [GENERAL] Index Scanning

2007-01-03 Thread Richard Huxton
Enrico wrote: Hi, I have this query select TB.id_int,TR.codice_art,importo,cod_iva,prezzo,qta as qta from bolle_carico_testata TB inner join tmp_righe_bolle_carico TR on (TB.id_bolla_rem=TR.id_bolla_rem); [snip plan] Can anybody tell me why I have two Seq scans instead of two Ind. scan? And

[GENERAL] Index Scanning

2007-01-03 Thread Enrico
Hi, I have this query select TB.id_int,TR.codice_art,importo,cod_iva,prezzo,qta as qta from bolle_carico_testata TB inner join tmp_righe_bolle_carico TR on (TB.id_bolla_rem=TR.id_bolla_rem); and these are indexes on tables. # \d tmp_righe_bolle_carico Indexes: "tmpidx1" btree (id_bolla_re

Re: [GENERAL] queueing via database table?

2007-01-03 Thread Gregory S. Williamson
Mark -- As others have indicated, there may be some blocking issues with the approach you outlined. A variant I have seen used in the past uses a table with a unique id for the job, the work queue it is in, a status flag, priority and at least one time stamp (and perhaps space for a process id

Re: [GENERAL] queueing via database table?

2007-01-03 Thread Dawid Kuroczko
On 1/3/07, Mark Harrison <[EMAIL PROTECTED]> wrote: Does the following sound like a reasonable approach? If not, what's a good way to go? The processes generating the requests will insert into a queue table. They may add a priority and timestamp. The several processes servicing the requests wi

Re: [GENERAL] queueing via database table?

2007-01-03 Thread Richard Huxton
Steve Atkins wrote: Holding a lock while generating the thumbnail doesn't sound like a great idea, and I think that the select for update will end up serialising the requests. I'd add a "rendering" field, text, defaulting to an empty string. Then do a "select for update where ... and rendering

Re: [GENERAL] Geographical redundancy

2007-01-03 Thread Markus Schiltknecht
Hello Dennis, Dennis wrote: Is there any feasible way to achieve geographical redundancy of postgresql database? As nobody mentioned it up until now: please check the very nice documentation about High Availability and Failover here: http://www.postgresql.org/docs/8.2/static/high-availabil

Re: [GENERAL] Generic timestamp function for updates where field

2007-01-03 Thread novnov
Adrian Klaver wrote: > > On Sunday 31 December 2006 8:48 am, novnov wrote: >> OK. python would be the preference, if anyone is interested in showing me >> how it would be done, I've never used one of the dynamic languages with >> postgres. >> >> Why would not be possible in plpgsql? It has loop