Thursday, June 19, 2008

Re: [SQL] "TZ"/"tz" not supported

am Fri, dem 20.06.2008, um 8:35:10 +0200 mailte Peter Kovacs folgendes:
> Thank you, Andreas! Your advice is very useful to me.
>
> I would still be interested why "TZ" is not accepted in the format string.

I think because TZ is only useful for displaying a timestamptz and not
for internal representation and/or calculation.

For displaying you can use to_char(timestamptz, format-string).


Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA

http://wwwkeys.de.pgp.net

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Re: [ODBC] Relation of psqlODBC and postgreSQL version

Hi,

On Fri, 2008-06-20 at 11:12 +0530, Abhishek Mishra wrote:
>
> I am using postgresql version: 8.1.2, Can I use psqlODBC version
> 8.3.200 with it?

Yes, you can.

Regards,
--
Devrim GÜNDÜZ , RHCE
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/

[pgadmin-support] Error set CLRF in SqlEditor on Windows

Version pgadmin-III 1.8.4.
Operating System Windows 2000
RussianWin1251

Errors:
1. I am seting mode [CLRF Dos] in "Sql editor", text is coverting Ok.
But when am starting to type new text, new text is inputing with [LF]
symbol.
2. When I open new work session on "Sql editor", setting [CLRF Dos]
reset on [LF]. :( Need save this setting in options menu. My Cvs
system not made compare when .sql include [LF] in text file :(

I want New Enhancements:
1. Set Lock mode on 'Sql Editor' when file is ReadOnly mode.

Thanks.
Andrey

--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

Re: [GENERAL] Losing data

On Friday 20 June 2008 05:26, Robert Treat wrote:
> On Thursday 19 June 2008 14:06:38 Garry Saddington wrote:
> > > In any case, however, if PostgreSQL reported the transaction complete
> > > and the machine didn't experience any hardware problems (like sudden
> > > power or disk failure), I would certainly not suspect PostgreSQL as the
> > > source of the problem.
> >
> > What has happened to the reports then? I have used this combination of
> > Zope and Postgres for 5 years with no problems like this before and we
> > have written one complete set of reports on this server in the past 6
> > weeks. The problem seems to have started last friday, when reports
> > started to go missing.
>
> Out of curiosity, what is your vacuum strategy?
We back up and vacuum at the same time each day.
garry

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [SQL] "TZ"/"tz" not supported

Thank you, Andreas! Your advice is very useful to me.

I would still be interested why "TZ" is not accepted in the format string.

Thanks
Peter


On Fri, Jun 20, 2008 at 8:15 AM, A. Kretschmer
<andreas.kretschmer@schollglas.com> wrote:
> am Fri, dem 20.06.2008, um 7:51:50 +0200 mailte Peter Kovacs folgendes:
>> Hi,
>>
>> Execution of the following statement aborts with the error message in
>> the Subject:
>>
>> select to_timestamp('2008-06-20 02:30:00 GMT', 'YYYY-MM-DD HH24:MI:SS TZ');
>
> You can use:
>
> test=*# select '2008-06-20 02:30:00 GMT'::timestamptz;
> timestamptz
> ------------------------
> 2008-06-20 04:30:00+02
> (1 row)
>
>
>
> helps that?
>
>
>
> Andreas
> --
> Andreas Kretschmer
> Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
> GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA

http://wwwkeys.de.pgp.net
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] "TZ"/"tz" not supported

am Fri, dem 20.06.2008, um 7:51:50 +0200 mailte Peter Kovacs folgendes:
> Hi,
>
> Execution of the following statement aborts with the error message in
> the Subject:
>
> select to_timestamp('2008-06-20 02:30:00 GMT', 'YYYY-MM-DD HH24:MI:SS TZ');

You can use:

test=*# select '2008-06-20 02:30:00 GMT'::timestamptz;
timestamptz
------------------------
2008-06-20 04:30:00+02
(1 row)

helps that?

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA

http://wwwkeys.de.pgp.net

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

[HACKERS] Doubt in index subplan query

Hello,

I have a query plan for a certain query

 Nested Loop  (cost=100000000.00..38761761090.50 rows=3000608 width=8)
   ->  Seq Scan on lineitem  (cost=100000000.00..100213649.15 rows=6001215 width=8)
   ->  Index Scan using oindex2 on myorders  (cost=0.00..6442.27 rows=1 width=4)
         Index Cond: ("outer".l_orderkey = myorders.o_orderkey)
         Filter: (subplan)
         SubPlan
           ->  Index Scan using cnation on customer  (cost=0.00..12859.39 rows=5251 width=0)
                 Index Cond: (c_nationkey = 10)

How is the subplan handled by postgres at index level ? Is any sort of hashing done ?

Thanks and regards,
Suresh


Re: [GENERAL] Logging Parameter Values

On Thu, 19 Jun 2008, Tom Lane <tgl@sss.pgh.pa.us> writes:
> Volkan YAZICI <yazicivo@ttmail.com> writes:
>> # tail -n 2 /srv/pg/pg_log/2008-06-19_141725.log
>> migration_test postgres 2008-06-19 17:58:05.185 EEST LOG: duration: 2315.420 ms statement: EXECUTE foo(1000);
>> migration_test postgres 2008-06-19 17:58:05.185 EEST DETAIL: prepare: PREPARE foo (int) AS SELECT S.i * T.i FROM generate_series(1, $1) AS S(i), generate_series(1, $1) AS T(i);
>
> Hmm, we're not on the same page here. I thought you were talking about
> protocol-level parameters. In the above example, the parameter values
> are shown in the EXECUTE statement, so what else do you need?

Umm... Bogus test case.

CL-USER> (postmodern:connect-toplevel
"migration_test" "postgres" nil "192.168.1.160")
; No value
CL-USER> (and (postmoder:query
(concatenate 'string
"SELECT S.i * T.*"
" FROM generate_series(1, $1) AS S (i),"
" generate_series(1, $2) AS T (i)")
1000 1000)
nil)
NIL

# tail /srv/pg/pg_log/2008-06-19_141725.log -n 2
migration_test postgres 2008-06-20 09:02:33.695 EEST LOG: duration: 4419.475 ms execute <unnamed>: SELECT S.i * T.* FROM generate_series(1, $1) AS S (i), generate_series(1, $2) AS T (i)
migration_test postgres 2008-06-20 09:02:33.695 EEST DETAIL: parameters: $1 = '1000', $2 = '1000'

Hrm... Now what might have caused the logged statements with missing
parameter values I pasted. I was probably looking at past log files
belongs to some other logging configuration.

Excuse me for the noise. And thanks for the prompt reply.


Regards.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[pgadmin-support] Error set CLRF in Windows

Version pgadmin-III 1.8.4.
Operating System Windows 2000 RussianWin1251

Errors:
1. I am seting mode [CLRF Dos] in "Sql editor", text is coverting Ok.
But when am starting to type new text, new text is inputing with [LF]
symbol.
2. When I open new work session on "Sql editor", setting [CLRF Dos]
reset on [LF]. :( Need save this setting in options menu. My Cvs
system not made compare when .sql include [LF] in text file :(

I want New Enhancements:
1. Set Lock mode on 'Sql Editor' when file is ReadOnly mode.

Thanks.
Andrey

--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

[SQL] "TZ"/"tz" not supported

Hi,

Execution of the following statement aborts with the error message in
the Subject:

select to_timestamp('2008-06-20 02:30:00 GMT', 'YYYY-MM-DD HH24:MI:SS TZ');

Does this message mean that this particular PostgreSQL installation
doesn't support timezones?

--------------
select * from pg_catalog.pg_timezone_abbrevs where abbrev = 'GMT';

abbrev | utc_offset | is_dst
--------+------------+--------
GMT | 00:00:00 | f
(1 row)
--------------

The database version is 8.3.0.

Any help appreciated,
Peter

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Re: [PATCHES] posix advises ...

good morning,

this is wonderful news.
this is pretty much what we observed as well. the kernel has acted as showstopper for many setups recently. this patch fixed most cases related to kernel read ahead and so on for us.
in fact, posix_fadvise was the only way to prevent a big germany company from replacing postgres with oracle.
the problem was that synchronized scans led to a significant decrease of I/O throughput as the kernel was simply confused by processes concurrently reading the same file.

I hope zoltan's autoconf magic fixes the portability issues.

hans


On Jun 20, 2008, at 1:19 AM, Greg Smith wrote:

On Thu, 19 Jun 2008, Zoltan Boszormenyi wrote:

This patch (revisited and ported to current CVS HEAD) is indeed using
Greg's original patch and also added another patch written by Mark Wong
that helps evicting closed XLOGs from memory faster.

Great, that will save me some trouble.  I've got a stack of Linux performance testing queued up (got stuck behind a kernel bug impacting pgbench) for the next couple of weeks and I'll include this in that testing.  I think I've got a similar class of hardware as you tested on for initial evaluation--I'm getting around 200MB/s sequential I/O right now out of my small RAID setup,.

I added your patch to the queue for next month's CommitFest and listed myself as the initial reviewer, but a commit that soon is unlikely. Performance tests like this usually take a while to converge, and since this is using a less popular API I expect a round of portability concerns, too.

Where did Marc's patch come from?  I'd like to be able to separate out that change from the rest if necessary.

Also, if you have any specific test cases you ran that I could start by trying to replicate a speedup on, those would be handy as well.

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD

-- 
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:



--
Cybertec Schönig & Schönig GmbH
PostgreSQL Solutions and Support
Gröhrmühlgasse 26, 2700 Wiener Neustadt
Tel: +43/1/205 10 35 / 340
www.postgresql-support.de, www.postgresql-support.com

[ODBC] Relation of psqlODBC and postgreSQL version

Hi,

 

Is there any relationship between the psqlODBC version and the postgreSQL version?

 

I am using postgresql version: 8.1.2, Can I use psqlODBC version 8.3.200 with it?

 

 

Early response will be highly appreciated.

 

 

Kind Regards,

-Abhishek

Re: [ADMIN] where would I find the files I need?

Thank you, Joshua!

Tena Sakai


-----Original Message-----
From: Joshua D. Drake [mailto:jd@commandprompt.com]
Sent: Thu 6/19/2008 10:00 PM
To: Tena Sakai
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] where would I find the files I need?

Tena Sakai wrote:
> Hi everybody,
>
> I am running postgres 8.3.0 on linux (hardware is dell).
> When I issue: cat /etc/redhat-release
> It comes back with: Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
> and when I issue: uname -r
> It says: 2.6.9-42.ELsmp
>
> Given that, would somebody please tell me where I can go
> to grab the correct set of files to upgrade to the latest
> postgres, v8.3.3?
>
> I have been to the postgres website and via File Browser, I got to:
> Top ? binary ? v8.3.3 ? linux ? rpms ? redhat ? rhel-4-x86_64
>
> Am I at the right place?

Yep.

Joshua D. Drake

> Please advise.
>
> Many thanks.
>
> Regards,
>
> Tena Sakai
> tsakai@gallo.ucsf.edu
>


Re: [ADMIN] where would I find the files I need?

Tena Sakai wrote:
> Hi everybody,
>
> I am running postgres 8.3.0 on linux (hardware is dell).
> When I issue: cat /etc/redhat-release
> It comes back with: Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
> and when I issue: uname -r
> It says: 2.6.9-42.ELsmp
>
> Given that, would somebody please tell me where I can go
> to grab the correct set of files to upgrade to the latest
> postgres, v8.3.3?
>
> I have been to the postgres website and via File Browser, I got to:
> Top ? binary ? v8.3.3 ? linux ? rpms ? redhat ? rhel-4-x86_64
>
> Am I at the right place?

Yep.

Joshua D. Drake

> Please advise.
>
> Many thanks.
>
> Regards,
>
> Tena Sakai
> tsakai@gallo.ucsf.edu
>


--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: [GENERAL] Losing data

Robert Treat <xzilla@users.sourceforge.net> writes:
> On Thursday 19 June 2008 14:06:38 Garry Saddington wrote:
>> The problem seems to have started last friday, when reports started to go
>> missing.

> Out of curiosity, what is your vacuum strategy?

If you're thinking "transaction ID wraparound", I believe we can rule
that out, because Garry says he's running PG 8.1. 8.1 is not terribly
proactive about preventing wraparound (no forced autovacuums), but it
will squawk loudly about impending wraparound and shut down before it
hits the wall.

My bet is that something was changed in the client-side software last
week that has broken its commit-issuing behavior.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Losing data

On Thursday 19 June 2008 14:06:38 Garry Saddington wrote:
> > In any case, however, if PostgreSQL reported the transaction complete and
> > the machine didn't experience any hardware problems (like sudden power or
> > disk failure), I would certainly not suspect PostgreSQL as the source of
> > the problem.
>
> What has happened to the reports then? I have used this combination of Zope
> and Postgres for 5 years with no problems like this before and we have
> written one complete set of reports on this server in the past 6 weeks. The
> problem seems to have started last friday, when reports started to go
> missing.

Out of curiosity, what is your vacuum strategy?

--
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[ADMIN] where would I find the files I need?

Hi everybody,

I am running postgres 8.3.0 on linux (hardware is dell).
When I issue: cat /etc/redhat-release
It comes back with: Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
and when I issue: uname -r
It says: 2.6.9-42.ELsmp

Given that, would somebody please tell me where I can go
to grab the correct set of files to upgrade to the latest
postgres, v8.3.3?

I have been to the postgres website and via File Browser, I got to:
Top → binary → v8.3.3 → linux → rpms → redhat → rhel-4-x86_64

Am I at the right place?
Please advise.

Many thanks.

Regards,

Tena Sakai
tsakai@gallo.ucsf.edu

Re: [HACKERS] Backend Stats Enhancement Request

> That's not where the problem is. The people who will be left holding
> the short end of the stick are the ones who can't raise their SHMMAX
> setting past a couple of megabytes.
>
> It might be feasible to make pg_stat_activity's max string length
> a postmaster-start-time configuration option.

I am fine with a postmaster-start-time configuration option. It is not as flexible as I would like, but would serve the immediate need and keep me from having to
patch every release of Postgres we install on boxes.

The load on our production servers really prohibits any kind of processing of the log files locally. We have tried using several log shipping methods to process the
logs on a machine with fewer running processes. These large queries are generated by a third party tool that we have very limited control over. Some of the queries
captured are as large 16K. The queries are poorly written/generated.


David Miller
River Systems, Inc.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Backend Stats Enhancement Request

Tom Lane wrote:
> Decibel! <decibel@decibel.org> writes:
>
> That's not where the problem is. The people who will be left holding
> the short end of the stick are the ones who can't raise their SHMMAX
> setting past a couple of megabytes.
>
> It might be feasible to make pg_stat_activity's max string length
> a postmaster-start-time configuration option.

That would seem to me to be the most prudent course. As much as it is
important to pay attention to those "who can't raise their SHMMAX
setting past a couple of megabutes", that is certainly not the majority
of participants in this community.

Sincerely,

Joshua D. Drake

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Backend Stats Enhancement Request

Decibel! <decibel@decibel.org> writes:
> Also, I don't necessarily buy that 32k * max_connections is too much
> shared memory; even with max_connections of 1000 that's only 32M,
> which is trivial for any box that's actually configured for 1000
> connections.

That's not where the problem is. The people who will be left holding
the short end of the stick are the ones who can't raise their SHMMAX
setting past a couple of megabytes.

It might be feasible to make pg_stat_activity's max string length
a postmaster-start-time configuration option.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

[GENERAL] Logging Parameter Values

Hi,

While log_statements logs parameter values with the logged queries, I
cannot see parameter values logged for erronous queries and queries
catched by log_min_duration_statements.

Here are our logging settings:

# grep ^log postgresql.conf
logging_collector = on # Enable capturing of stderr and csvlog
log_directory = '/srv/pg/pg_log' # directory where log files are written,
log_filename = '%Y-%m-%d_%H%M%S.log' # log file name pattern,
log_rotation_age = 7d # Automatic rotation of logfiles will
log_rotation_size = 0MB # Automatic rotation of logfiles will
log_min_duration_statement = 1000 # -1 is disabled, 0 logs all statements
log_line_prefix = '%d %u %m ' # special values:

For instance, consider below log snippets.

eray_1_5_1_0 emove 2008-06-19 10:19:50.124 EEST ERROR: function isnull(integer, integer) does not exist at character 195
eray_1_5_1_0 emove 2008-06-19 10:19:50.124 EEST HINT: No function matches the given name and argument types. You might need to add explicit type casts.
eray_1_5_1_0 emove 2008-06-19 10:19:50.124 EEST STATEMENT: SELECT * FROM mugroup g WHERE g.groupid IN ((... user id=$1) UNION (SELECT ...))

test_1_5_0_0 emove 2008-05-15 15:07:08.631 EEST LOG: duration: 68544.986 ms parse <unnamed>: insert into interprettimelog (...) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16)

Is this something expected? What might I be missing? How can I make
PostgreSQL log parameter values also?


Regards.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [pgsql-es-ayuda] preevaluar consulta


Me respondo en parte, a ver que les parece....
suponiendo que a la consulta le agrego al final
OFFSET 1 LIMIT 1;
proceso el registro
luego repito la consulta con
OFFSET 2 LIMIT 1;
y asi sucesivamente, me ira mostrando registro por registro.
pero tengo dos dudas

1- si tengo
Set tuplasP = cnn.Execute(cadaux)
If Not tuplasP.EOF Then

el EOF funcionara, es decir no tendre problemas de meter un offset mayor que el de la cantidad de registros, me devolvera EOF cuando lelegue al final?

2- si repito la consulta con otro offset, no esto haciendo todo de nuevo y solo salvo el problema de enviar una gran cantidad de datos de golpe pero no minimizo el tiempo de procesamiento, es mas, no estoy aumentando la demora total, ya que esta haciendo muchas veces la misma consulta?





¡Buscá desde tu celular! Yahoo! oneSEARCH ahora está en Claro
http://ar.mobile.yahoo.com/onesearch

Re: [pgadmin-support] pgAdmin 1.8.2 SSL connection woes

On Wed, Jun 18, 2008 at 5:48 PM, Richard Tector
<richardtector@thekeelecentre.com> wrote:
> I might be missing the point here, but I can't seem to get pgAdmin to
> initiate an SSL encrypted connection to any of our PostgreSQL servers
> (mainly 8.2, some 8.3) but using password (md5) authentication.
> Setting SSL to require in the connection properties for the server leads to
> "could not read certificate" or "could not read private key file" messages.
> This makes sense if I were trying to connect using client ceritificates for
> authentication but not for md5 type auth.
>
> Any thoughts on the matter would be much appreiciated.

I suspect you have a root certificate (root.crt) in your data
directory on the server. If this is found at server start, client
certificates will be requested to authenticate the client (not the
user) whenever an SSL connection is initiated. See
http://www.postgresql.org/docs/8.3/static/ssl-tcp.html for more
details.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

[pgsql-es-ayuda] compatibiliad 8.2.4 con 8.3.1

Hola he instalado la versión 8.3 y me he dado cuenta hay una caso que si
funciona en 8.2.4 y no en 8.3.1


select c312frec.proveedor from c312frec
where c312frec.tipo_cif <> 4

el campo tipo_cif es character(1), en 8.2.4 esto funciona perfectamente, en
8.3.1 no funciona ,hay que poner el 4 entre comillas,
te da este mensaje :

ERROR: el operador no existe: character <> integer
Estado SQL:42883
Sugerencias:Ningún operador coincide con el nombre y el tipo de los
argumentos. Puede desear agregar conversiones explícitas de tipos.
Caracter: 76

Esto es un Bug de la nueva o de la vieja, y si es de la nueva, ¿Dónde puedo
ver si esta reportado o si esta corregido en la 8.3.3?

Gracias.

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3199 (20080619) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

--
TIP 5: ¿Has leído nuestro extenso FAQ?

http://www.postgresql.org/docs/faqs.FAQ.html

Re: [GENERAL] Inter-app communication via DB

On Thu, Jun 19, 2008 at 11:46:42AM +0200, David wrote:

> > That will happen anyway, no matter what the message
> > transport is like. Apps will have to read state at startup
> > anyway, no ?
>
> I have a small problem with this. If app1 wants to tell app2 to
> perform an expensive operation (which you don't want app2 to do each
> time it starts up), in the original pattern it could just set a
> boolean variable. Now it needs to both set a boolean variable (in case
> app2 isn't running at the moment) and use NOTIFY (for when it is),
> which seems a bit redundant.

You could add a trigger to the table with the boolean flag.
The trigger sends the NOTIFY all by itself. So when the app
is listening it gets the signal. When it isn't it will read
the flag at startup. All the other app does is set the flag.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[BUGS] BUG advisory_lock

DECLARE
  varUnlocked boolean;
BEGIN
varUnlocked:= pg_try_advisory_lock( 783264760123456 ); -- Try to lock function
IF not varUnlocked THEN return NULL; END IF; -- exit if locking is unsucessfull
 
WRONG QUERY HERE WHICH INTERRUPT EXECUTION
 
varUnlocked:= pg_advisory_unlock( 783264760123456 ); -- unlock function
END
 
NEXT time when I run this function I always get NULL until server reboot
 
EXPECTED: Pg must unlock if function execution failed

Re: [GENERAL] Dump and restore problem

On Wed, Jun 18, 2008 at 11:41 PM, Stuart Luppescu <slu@ccsr.uchicago.edu> wrote:

[...]

> pg_restore: [tar archiver] could not open TOC file for input: No such
> file or directory

It sounds like the tar file is no longer being created.

Try manually running the commands, and verify that the dump, restore,
and rsync still work correctly at each step.

David.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[HACKERS] ANY/SOME/ALL with noncommutable operators

I can do

'abc' LIKE ANY (ARRAY['a%','b%'])

but not

ANY (ARRAY['abc', 'def']) LIKE '%a'

This seems to be a failing in the SQL standard. You can work around this by
creating your own operators, but maybe there should be a general solution, as
there are a lot of noncommutable operators and this example doesn't seem all
that unuseful in practice.

Comments?

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [GENERAL] Inter-app communication via DB

hello

look to orafce package
http://www.pgsql.cz/index.php/Oracle_functionality_%28en%29

regards
Pavel


2008/6/19 David <wizzardx@gmail.com>:
> Hi list.
>
> One pattern I've used is for apps to communicate events to each other
> through the database.
>
> ie:
>
> - App 1 sents a boolean value to True
> - App 2 queries the field every 10s, sets the value to False, and does
> something.
>
> Is this reasonable, or should apps avoid this pattern?
>
> I have seen the NOTIFY and LISTEN SQL statements. However:
>
> 1) App 2 might not be running at the time (eg: it's launched from
> cron, or it was temporarily stopped), and the expectation is that App
> 2 will run the special logic when it is started.
>
> 2) App 2 is usually single-threaded, and needs to do other things in
> it's main thread besides wait for a DB notification.
>
> I also know of RPC, but haven't used it before, and don't see a need
> if you can use the above pattern.
>
> I would use RPC (or unix signals if on the same host) if App 2 needed
> to respond quickly, and I didn't want to hammer the DB & network with
> constant polling.
>
> Any comments?
>
> David.
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Inter-app communication via DB

On Thu, Jun 19, 2008 at 11:09:12AM +0200, David wrote:

> One pattern I've used is for apps to communicate events to each other
> through the database.

Works nicely with LISTEN/NOTIFY. We use it a lot in GNUmed.

> - App 1 sents a boolean value to True
> - App 2 queries the field every 10s, sets the value to False, and does
> something.
>
> Is this reasonable, or should apps avoid this pattern?
Add more app instances and you'll have a lot of polling.

> I have seen the NOTIFY and LISTEN SQL statements. However:
>
> 1) App 2 might not be running at the time (eg: it's launched from
> cron, or it was temporarily stopped), and the expectation is that App
> 2 will run the special logic when it is started.

That will happen anyway, no matter what the message
transport is like. Apps will have to read state at startup
anyway, no ?

> 2) App 2 is usually single-threaded, and needs to do other things in
> it's main thread besides wait for a DB notification.
Well, threads in Python aren't *that* hard to get right. But
you could also write a small listener demon which gets
started on behalf of the local app instance which writes to
a local watch file which is being polled by the local app
instance. Takes the poll pressure off the database and
avoids having to thread the app, too.

There's a bunch of Python code here

http://cvs.savannah.gnu.org/viewvc/gnumed/gnumed/client/pycommon/gmBackendListener.py?root=gnumed&view=markup

that might be of interest.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[JDBC] JDBC and Blobs

Hi,

I have a field in my database table of type OID which is suppose to be used to store binary data. I plan on using the setBlob and getBlob methods for storing and retrieving entries from the table. Is that the right way to proceed? If I delete a row in that table , will it delete the binary data as well from the database server?

cheers

/Dev

Re: [HACKERS] Postgres + Window manager

Josh,

>> I stated details of proposal on page 2-13, 67-75 of pdf-document
>> http://sql50.euro.ru/sql5.16.4.pdf , and i ask to implement it.
>> All my proposals are public domain.

JB> I'm confused. You're planning to develop this

I can't make this alone.

JB> or you're looking for someone else to?

Yes, i'm looking for programmers, which agree to support this
initiative.

Dmitry Turin
SQL5 (5.16.4)

http://sql50.euro.ru/sql5.16.4.pdf

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

[GENERAL] Inter-app communication via DB

Hi list.

One pattern I've used is for apps to communicate events to each other
through the database.

ie:

- App 1 sents a boolean value to True
- App 2 queries the field every 10s, sets the value to False, and does
something.

Is this reasonable, or should apps avoid this pattern?

I have seen the NOTIFY and LISTEN SQL statements. However:

1) App 2 might not be running at the time (eg: it's launched from
cron, or it was temporarily stopped), and the expectation is that App
2 will run the special logic when it is started.

2) App 2 is usually single-threaded, and needs to do other things in
it's main thread besides wait for a DB notification.

I also know of RPC, but haven't used it before, and don't see a need
if you can use the above pattern.

I would use RPC (or unix signals if on the same host) if App 2 needed
to respond quickly, and I didn't want to hammer the DB & network with
constant polling.

Any comments?

David.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [PERFORM] Tsearch2 Initial Search Speed

> Good idea. Note that Postgres is already doing this to some extent
> with TOAST - read
> http://www.postgresql.org/docs/8.3/interactive/storage-toast.html -
> unfortunately, there doesn't seem to be an option to always move
> particular columns out to TOAST. Your idea will produce an even
> smaller table. However, are email_ids all that you want from the query?
>
> Matthew
>
As you point out - I will need more then the email_ids in the query, but
if I remove just the content, to, cc fields then the size of the table
should shrink dramatically. Just remains to be seen if the TOAST has
already done that optimisation for me.

Again. Thanks Matthew - I owe you a beer.

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

Re: [pgadmin-support] Question

On Thu, Jun 19, 2008 at 9:31 AM, daniel <daniel@ascent-soft.ro> wrote:
> That's my biggest problem.
> The server i have use plain format dumps , but use gz to archive them .
>
> I could change the way backups are made but that's not my goal.
>
> So my problem remains : how can i convert Plain format dumps to files
> readable by pg_restore ?

You cannot. You must feed them uncompressed into psql.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

Re: [pgadmin-support] Question

That's my biggest problem.
The server i have use plain format dumps , but use gz to archive them .

I could change the way backups are made but that's not my goal.

So my problem remains : how can i convert Plain format dumps to files readable by pg_restore ?



Dave Page wrote:
On Thu, Jun 19, 2008 at 8:34 AM, daniel <daniel@ascent-soft.ro> wrote:   
Is there a tool to convert    postgresql backups (sql.gz files) to Pgadmin Backups ?     
 With the exception of PLAIN format dumps, they are entirely compatible because pgAdmin just calls pg_dump to create them. PLAIN format backups must be fed into psql however - pg_restore doesn't understand them, and that's what pgAdmin uses for restores.    


--
Dan Turcitu

Dascar Daniel
Ascent Soft SRL
www.ascent-soft.ro

daniel@ascent-soft.ro

tel: +40256 40.74.00
fax: +40356 40.90.47
gsm: +40722 32.67.96

r


Re: [pgadmin-support] Question

On Thu, Jun 19, 2008 at 8:34 AM, daniel <daniel@ascent-soft.ro> wrote:
> Is there a tool to convert
> postgresql backups (sql.gz files) to Pgadmin Backups ?

With the exception of PLAIN format dumps, they are entirely compatible
because pgAdmin just calls pg_dump to create them. PLAIN format
backups must be fed into psql however - pg_restore doesn't understand
them, and that's what pgAdmin uses for restores.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

Re: [pgadmin-hackers] Building pgadmin3 against PostgreSQL 7.4

On Thu, Jun 19, 2008 at 5:36 AM, Devrim GÜNDÜZ <devrim@commandprompt.com> wrote:
> I got a few requests to push pgadmin3 to EPEL-4, and here is the build
> log for i386:
>
> http://buildsys.fedoraproject.org/logs/fedora-4-epel/39320-pgadmin3-1.8.4-1.el4/i386/build.log
>
> How can this be fixed, or should we ignore 7.4 support?

We support running against 7.4 servers. but we haven't supported
building against 7.4 for many years - in fact, 1.4.x required 8.0 or
above, and since 1.6 we required an 8.1 libpq, which remains the
minimum today.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Re: [GENERAL] Database design: Backwards-compatible field addition

Thanks for you reply.

On Wed, Jun 18, 2008 at 9:15 PM, Shane Ambler <pgsql@sheeky.biz> wrote:
> David wrote:
>>
>> Hi list.
>>
>> If you have an existing table, and apps which use it, then how do you
>> add new fields to the table (for new apps), but which might affect
>> existing apps negatively?
>>
>
> If you know you are going to add a column then add it now and just not have
> your app do anything with any data there.
>

I don't have a problem with this case. The problem is when older apps
need to do something different (usually ignore) records which have
certain values (usually anything non-NULL) in the new fields.

Simple (toy) example. You have a table like this:

employee
- id
- name
- ...etc..

You have a lot of software which uses this table.

Later, you need to add an 'employed' boolean field, to reflect whether
an employee is still working at the company

Your new apps know the difference between employed and unemployed
employee, but old apps all assume that all employees in the table are
currently employed, and will want to send them pay checks, emails,
etc.

Furthermore, assume that this kind of change happens fairly often.

Would you make more views & rules each time the requirements change?

Would you need to update all the apps each time too?

Or are there other methods (version columns, etc) which can reduce the
work required in cases like this?

David.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Database design: Backwards-compatible field addition

>> Problem with this is that some RDBMS (Postgresql specifically) don't
>> let you run update statements on views.
>
> Given 1) the view will be "fairly uncomplicated" and hence
> "fairly straightforward" ON INSERT/UPDATE/DELETE rule can
> likely be added to it allowing for an apparently writable
> view.
>

Thanks for the info.

I had the mistaken idea that rules and triggers were only for real
tables & not views (I've never used them before).

I would like to avoid using them if possible (extra complexity, and
don't want to rename tables & make new views each time I need to make
backwards-incompatible app updates), but they are there if I need
them.

David.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Database design: Storing app defaults

On Wed, Jun 18, 2008 at 9:30 PM, Shane Ambler <pgsql@sheeky.biz> wrote:
> David wrote:
>>
>> Hi list.
>>
>> If you have a table like this:
>>
>> table1
>> - id
>> - field1
>> - field2
>> - field3
>>
>> table2
>> - id
>> - table1_id
>> - field1
>> - field2
>> - field3
>>
>> table1 & table2 are setup as 1-to-many.
>>
>> If I want to start providing user-customizable defaults to the
>> database (ie, we don't want apps to update database schema), is it ok
>> database design to add a table2 record, with a NULL table1_id field?
>
> Yes - Foreign key constraints will ensure that a value in table1_id exists
> in table1 - it does allow null vales unless you specify that column as NOT
> NULL or UNIQUE

My problem isn't that NULLS are or are allowed. My problem is that the
schema feel a bit unnatual/hackish if you use them in the way I
described. I'm looking for a cleaner, more elegant table schema.

>
>
>>
>> This looks messy however. Is there a better way to do it?
>>
> Sounds back to front to me. table1 would be defaults with table2 user
> defined overrides (I'd also add a user_id column)

That schema was a bit unnatural. See my previous mail in this thread
for a more realistic example.

>
>> A few other ways I can think of:
>>
>> 1) Have an extra table1 record (with string fields containing
>> 'DEFAULT'), against which the extra table2 record is linked.
>
> Create a view returning default values when the column is null?
>

This is possible, but there are a few problems (from my pov).

1) How do you make the views writable? (so you can update/delete/insert)

Another poster mentioned triggers, but I don't know how to use those.
Also, adding triggers increases the overall complexity. I'm looking
for a database & app logic/schema which is:

- As simple as possible
- Elegant
- Not hackish

See the Zen of Python for a better idea of what I mean:

http://www.python.org/dev/peps/pep-0020/

Are there any docs on the internet which give guidelines for good db design?

2) You may need to push a lot of logic from app logic (fetching
defaults from various tables depending on the situation) into your
view logic.

You can end up with a monster view, with complex supporting triggers &
stored procedures :-) I'd like to avoid that if possible.

>>
>> Which is the cleanest way? Is there another method I should use instead?
>>
>
> I would think that the app defines default behaviour which it uses if no
> values are stored in the db. The db only holds non-default options.
>

Sometimes your defaults need to be user-configurable. See my previous
post for more info.

David.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[pgadmin-support] Question

Is there a tool to convert
postgresql backups (sql.gz files) to Pgadmin Backups ?

Thank you
--

--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

Re: [GENERAL] Sequences

>
> I want to create a sequence that increases in unit column 3 for each
> record individually in column 2
>
> How do i create a sequence that can manage this?
> Is there a solution for this?
>
Yeah, depesz shows how to do this here
http://www.depesz.com/index.php/2007/08/17/rownum-anyone-cumulative-sum-in-one-query/

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Database design: Storing app defaults

On Wed, Jun 18, 2008 at 3:24 PM, Jonathan Bond-Caron <jbondc@gmail.com> wrote:
> Application defaults go in the application code not in the database (my
> opinion).

That's fine, until you want the defaults to be customizable, without
making an new app version. That's what my question is about :-)

>
> If you wants user, group, whatever customizable defaults, they belong in the
> database schema i.e. table user_prefs or role_prefs
>

These settings (or more precisely, app-customizable default values)
aren't user or group-specific. Also, I don't want to give apps
permission to update table schema unnecessarily.

A more concrete (toy) example to help clarify what I mean. If this
example doesn't work so well then I'll post another one :-)

employee
- id
- name
- job_id
- salary (if NULL, then use defaults for the job)
- benefits_id (if NULL, then use defaults for the job)

job
- id
- description
- default_salary
- default_benefits_id

benefits
- id
- benefit_description

One (of the many) dubious thing with the above schema, is that NULL
employee.salary and employee.benefits_id means that apps should use a
default from somewhere else (but this is not immediately obvious from
the schema alone). So I would probably use a COALESCE and sub-query to
get the salary or benefits in one query.

This isn't exactly the same as my original post (where a 2nd table
uses NULLs to mean 'this is a default record'), but the principle is
similar.

> For your question about "backwards compatible database", in most cases apps
> and databases schemas are upgraded at the same time.
> If you have a requirement that old & new apps have to work on the same
> database schema then don't make database schemas changes that will not be
> backwards compatible / break older apps.

That's the obvious answer :-) But what if you need a feature before
there is time to update all the apps? And how would you design your
tables if you were expecting this to be the norm?

>
> Put those changes on hold until both apps & databases can be upgraded. Some
> solutions which may help you java (hibernate) adds a version column to each
> table, rails adds a schema_info table with database version.
>

I haven't used those before. I've mainly worked with apps which use
SQL directly. More recently I've started working with SQLAlchemy and
Elixir in Python. Do those libraries you mention automatically ignore
records which have an unexpectedly high version number? (And what if
that isn't the correct thing to do in all cases?)

Could you provide links so I can read how those schemes work? (so that
I can look into borrowing their logic for my hand-coded tables &
application SQL).

David.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [ADMIN] URGENT: how to GRANT privillages to user/role on relation's row??

how to GRANT privillages to user/role on relation's row??

we can grant privvilages to user/role on tables/relations by
GRANT options[SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER
|ALL]privillages ON relation/tablename TO dbuser/role;
GRANT command but how can we GRANT privillages to a user on a row ??? ?


is it possible by RULES ????

On 6/18/08, hubert depesz lubaczewski <depesz@depesz.com> wrote:
> On Wed, Jun 18, 2008 at 10:05:13AM -0700, pradeep kumar wrote:
>> GRANT command but how can we GRANT privillages to a user on a row ??? ?
>
> in standard postgresql you can't.
>
> if you want row-level privileges, check this:
> http://code.google.com/p/sepgsql/
>
> depesz
>

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: [ADMIN] Advice on running two database clusters on one server machine

On Sun, Jun 15, 2008 at 12:11 PM, Andreas Philipp
<andreas.philipp@clinicauniversitariateleton.edu.co> wrote:
> Hi all,
>
> We are implementing a hospital information system and a human
> resources/payroll processing system on two identical dedicated servers with
> two Xeon Quad Core processors and 32 GB RAM each, both servers being attached
> via FC to a SAN, and both applications running on PostgreSQL 8.3 / CentOS 51.
>
> We are wondering about the advisability to distribute the databases between
> the two server machines, both machines acting as active production systems
> for one application each, and as warm standby servers for the other, using
> WAL shipping to a second database cluster running on another port on each of
> the two server machines.
>
> What would be the performance cost of doing so, rather than running all
> databases on one database cluster on one machine, and using the second
> machine as a warm standby server for all databases of the two applications?
>
> What other considerations should we take into account? We have no prior
> experience with PostgeSQL administration, having run our previous systems on
> Windows Servers and MS SQL Server.
>
> Thanks to all for your input!

I've experimented a bit with this. Probably the biggest thing to keep
in mind is that different clusters don't play nice with resources,
especially shared memory. You're ostensibly cutting your available
memory in half by running two clusters on one machine.

Other things to keep in mind...they can't use the same user and group
data (so roles and passwords may be different and it's a bit of work
to keep them sync'd up if you would want that). You also have to
maintain two different sets of configs, have data located at two
different places, and listen to data on two different ports. It's
about double the basic administration.

I would recommend one cluster per machine for production machines, if
it works well for you, that is.

Peter

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: [PERFORM] WAL DUDAS

Antonio Perez wrote:
[wonders why his online backup / recovery test didn't work]

> 1. Se crea una instancia de postgreSQL
>
> 2. Se crea un directorio $PGDATA/walback donde se almacenararn los wal antiguos
>
> 3. Se exporta una variable $PGDATA2 que es la ubicacion del respaldo del contenido de $PGDATA
>
> 4. Se activa el wal
>
> 5. Se crea una BD y una tabla
>
> 6. En psql se ejecuta pg_start_backup('etiqueta');
>
> 7. Se realiza una copia de todo lo que esta en $PGDATA hacia otro directorio ($PGDATA2)
>
> 8. En psql se ejecuta pg_stop_backup();
>
> 9. Se actualiza el valor de un registro en la tabla que se creo
>
> 10. Se baja la instancia
>
> 11. Se copia todo el contenido de $PGDATA/pg_xlog y $PGDATA/walback en $PGDATA2/pg_xlog y $PGDATA2/walback
>
> 12. Se inicia la instancia con pg_ctl -D $PGDATA2 --log $PGDATA2/log.log start
>
> 13. Se ejecuta psql
>
> 14. Se consulta la tabla y no existen registro
>
> Si alguien sabe el porque pasa esto me avisan. Gracias

First, you are supposed to use English on this list.

What you did with your copy of the cluster files is a crash recovery, basically
the same thing that will take place if you kill -9 the postmaster and restart it.

This is not the correct way to restore, left alone to recover the database.

There are step-by-step instructions at

http://www.postgresql.org/docs/current/static/continuous-archiving.html#BACKUP-PITR-RECOVERY


The important step you missed is step number 7 in which you create a recovery.conf
file that tells the server where it should look for archived WAL files, how to restore
them and until what point in time it should recover.

Yours,
Laurenz Albe

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

Re: [GENERAL] PITR base backup -- stop server or not?

On Thu, Jun 19, 2008 at 12:14 AM, Rob Adams <robfadams@cox.net> wrote:
> The docs for Making a Base Backup (tar) say that it can be done live without
> stopping the server:
> http://www.postgresql.org/docs/8.3/interactive/continuous-archiving.html#BACKUP-BASE-BACKUP
> (step #3)
>
> However, the docs for straight File System Level Backup (tar) say the server
> must be shut down:
> http://www.postgresql.org/docs/8.3/interactive/backup-file.html
> (restriction #1)
>
> Is this because replaying the WAL files will fix any of the issues listed in
> the File System Level Backup restriction #1?

Yes

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general