Friday, August 22, 2008

Re: [ADMIN] Regarding access to a user

Shashwat_Nigam wrote:
> Dear Tomasz

There are others here, too.

> I had done the same but still the problem is like that the user is able to access all the databases in the current server. Even the order is like same and if I comment the second line(all access) then the error is there.
> Please provide solution for the same.

It sounds like you didn't bump the server. You have to signal it to re-read
the pg_hba.conf file. The link provided by Kevin Grittner

<http://www.postgresql.org/docs/8.3/interactive/auth-pg-hba-conf.html>

explains

> The pg_hba.conf file is read on start-up and when the main server process
> receives a SIGHUP signal. If you edit the file on an active system, you will
> need to signal the server (using pg_ctl reload or kill -HUP) to make it
> re-read the file.

Did you perform that step?

--
Lew

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

Re: [SQL] Concat field result in select query

Also, the array_accum aggregate isn't present by default, you need to
create it with :

CREATE AGGREGATE array_accum (anyelement)
(
sfunc = array_append,
stype = anyarray,
initcond = '{}'
);

On Fri, 2008-08-22 at 18:24 +0200, Julien Cigar wrote:
> of course: http://rafb.net/p/EOaYfO59.html
>
> Julien
>
> On Fri, 2008-08-22 at 15:58 +0200, Nacef LABIDI wrote:
> > any explanations ?
> >
> > On Fri, Aug 22, 2008 at 6:07 PM, Julien Cigar <jcigar@ulb.ac.be>
> > wrote:
> > array_accum ?
> >
> >
> > On Fri, 2008-08-22 at 15:40 +0200, Nacef LABIDI wrote:
> > > Hi all,
> > >
> > > I was wondering if there is a way to concatenate the results
> > of a
> > > field in a select to return it as a single string.
> > >
> > > Example :
> > >
> > > my_field
> > > --------------
> > > 1
> > > 2
> > > 3
> > >
> > > select concat_something(my_field) from my_table group by
> > something;
> > > the result expected would be someting like that : 1/2/3
> > (with a
> > > separator it would be really nice)
> > >
> > > I hope that I am not asking for too much ;)
> > >
> > > Thanks to all
> > >
> >
> > --
> > Julien Cigar
> > Belgian Biodiversity Platform
> > http://www.biodiversity.be
> > Université Libre de Bruxelles (ULB)
> > Campus de la Plaine CP 257
> > Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
> > Boulevard du Triomphe, entrée ULB 2
> > B-1050 Bruxelles
> > Mail: jcigar@ulb.ac.be
> > @biobel: http://biobel.biodiversity.be/person/show/471
> > Tel : 02 650 57 52
> >
> >
> >
--
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
Mail: jcigar@ulb.ac.be
@biobel: http://biobel.biodiversity.be/person/show/471
Tel : 02 650 57 52


--
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] Concat field result in select query

of course: http://rafb.net/p/EOaYfO59.html

Julien

On Fri, 2008-08-22 at 15:58 +0200, Nacef LABIDI wrote:
> any explanations ?
>
> On Fri, Aug 22, 2008 at 6:07 PM, Julien Cigar <jcigar@ulb.ac.be>
> wrote:
> array_accum ?
>
>
> On Fri, 2008-08-22 at 15:40 +0200, Nacef LABIDI wrote:
> > Hi all,
> >
> > I was wondering if there is a way to concatenate the results
> of a
> > field in a select to return it as a single string.
> >
> > Example :
> >
> > my_field
> > --------------
> > 1
> > 2
> > 3
> >
> > select concat_something(my_field) from my_table group by
> something;
> > the result expected would be someting like that : 1/2/3
> (with a
> > separator it would be really nice)
> >
> > I hope that I am not asking for too much ;)
> >
> > Thanks to all
> >
>
> --
> Julien Cigar
> Belgian Biodiversity Platform
> http://www.biodiversity.be
> Université Libre de Bruxelles (ULB)
> Campus de la Plaine CP 257
> Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
> Boulevard du Triomphe, entrée ULB 2
> B-1050 Bruxelles
> Mail: jcigar@ulb.ac.be
> @biobel: http://biobel.biodiversity.be/person/show/471
> Tel : 02 650 57 52
>
>
>
--
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
Mail: jcigar@ulb.ac.be
@biobel: http://biobel.biodiversity.be/person/show/471
Tel : 02 650 57 52


--
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] Concat field result in select query

array_accum ?

On Fri, 2008-08-22 at 15:40 +0200, Nacef LABIDI wrote:
> Hi all,
>
> I was wondering if there is a way to concatenate the results of a
> field in a select to return it as a single string.
>
> Example :
>
> my_field
> --------------
> 1
> 2
> 3
>
> select concat_something(my_field) from my_table group by something;
> the result expected would be someting like that : 1/2/3 (with a
> separator it would be really nice)
>
> I hope that I am not asking for too much ;)
>
> Thanks to all
>
--
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
Mail: jcigar@ulb.ac.be
@biobel: http://biobel.biodiversity.be/person/show/471
Tel : 02 650 57 52


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

Re: [GENERAL] Postgresql 8.3 statistic stadistinct value dead wrong even with default_statistics_target=1000

Maxim Boguk <mboguk@masterhost.ru> writes:
> [ ndistinct estimates way off ]

Estimating the number of distinct values in a distribution with a long
tail is just a really hard problem :-(

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

[ADMIN] 8.3.3 Silent Install error on Windows XP Pro SP2

Hello,
 
I am trying to run a silent install (no upgrade) of v 8.3.3 using the following switches:
 
msiexec.exe /log errorfile.log /i postgresql-8.3.msi /qn ADDLOCAL=server,psql,docs SERVICEDOMAIN="%COMPUTERNAME%" SERVICEPASSWORD="admin" SUPERPASSWORD="admin"
 
The install fails with the following error in the logfile:
MSI (s) (F4:F0) [09:13:01:403]: Product: PostgreSQL MUI Wrapper 8.3 -- Installation failed.
This same message appears in the Application Event Log.
 
Based on a post on the installer mailing list, I tried using postgresql-8.3-int.msi for the silent install, and received the following error:
MSI (s) (F4:08) [09:01:53:051]: Product: PostgreSQL 8.3 -- Installation failed.
The Event Log also said to use the "main MSI" file for an install.
 
Running the install from the main MSI directly works just fine.  If at all possible, I'd like to run an install with no user interactive whatsoever.  Is there something wrong with the properties I set?
 

Brandon Dybala
bjd1@martincomp.com

Martin Company
ISO 9001:2000 Certified
Phone: 281-342-7431
Fax: 281-342-5925
www.martincomp.com

 

Re: [ADMIN] Pg/CyberCluster test results

On Fri, Aug 22, 2008 at 06:33:50AM -0700, CG wrote:

> cluster, and I'm finidng that it is REALLY easy for the two
> back-ends to get out of sync with each other.

When I investigated that product, I came to the conclusion that it's
in the family of replication by query-dispatch. Everything in that
family has this problem, and it's a fundamental limitation of the
approach.

A

--
Andrew Sullivan
ajs@commandprompt.com
+1 503 667 4564 x104
http://www.commandprompt.com/

--
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] Pg/CyberCluster test results

On Fri, Aug 22, 2008 at 03:52:39PM +0200, RW wrote:

> It seems that we have to wait for PGCluster-II which isn't a
> "shared nothing" solution. Instead all files are on a shared
> medium like SAN or iSCSI and all instances uses this medium
> (similar to Oracle).

That's not shared-nothing, it's shared-storage.

A

--
Andrew Sullivan
ajs@commandprompt.com
+1 503 667 4564 x104
http://www.commandprompt.com/

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

Re: [pgsql-es-ayuda] NOTIFY del log ??

On Fri, Aug 22, 2008 at 9:35 AM, Raul Andres Duque
<ra_duque@yahoo.com.mx> wrote:
>
> Existe el concepto de "syslog" en windows?
>

claro... se llama eventlog y tambien es una opcion valida para el
parametro log_destination

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. (593) 87171157
--
TIP 10: no uses HTML en tu pregunta, seguro que quien responda no podrá leerlo

Re: [GENERAL] SERIAL datatype

On Thu, Aug 21, 2008 at 09:08:24PM +0200, Peter Billen wrote:
> Is it possible to insert a new entry? Will the serial sequence somehow
> be able to find the gap (3)?

As others have said, no it's not going to. Sequences will only return
values out of order when explicitly told to. The main reason is to
help prevent ambiguities in the data; if it could automatically reset
it would be much more difficult to determine if 7 was "older" than 3
or, worse, which 7 is the correct one. In a well designed system this
shouldn't ever occur, but if something does go horribly wrong it's much
easier to put the pieces back together this way.


Sam

--
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] The state of PG replication in 2008/Q2?

Hi Mathias,

On Aug 22, 2008, at 8:35 AM, Mathias Stjernström wrote:

> I Agree with Robert but i never heard of Cybercluster before.
> Does anyone have any experience with Cybercluster? It sounds really
> interesting!

Some months ago i took a look into cybercluster. At that point
cybercluster was
basically postgres-source 8.3 patched already with pgcluster sources.

Best regards,

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

Re: [pgsql-es-ayuda] NOTIFY del log ??

>
>> Realmente lo que quisiera inicialmente es un log detallado "en línea" con
>> el fin de dar soporte en producción.
>>
>
> Puedes configurar postgres para que utilice syslog e instalarte un
> logserver para recibir los mensajes. No lo he probado, pero en teoria
> deberia de funcionar.
>
> Saludos,
>

Existe el concepto de "syslog" en windows?

Atentamente,

RAUL DUQUE
Bogotá, Colombia

--
TIP 3: Si encontraste la respuesta a tu problema, publícala, otros te lo agradecerán

Re: Does anything dump per-database config settings? (was Re: [HACKERS] ALTER DATABASE vs pg_dump)

Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > ALTER DATABASE ... SET seems to be something that doesn't fit in
> > anywhere; I am thinking pg_dump -g should dump it.
>
> The upthread conclusion was that pg_dump -C should do it.
> I am not sure how you come to the conclusion that -g is an
> appropriate place, seeing that -g will not create the database(s)
> that it'd be trying to apply ALTER to.

Agreed, now that I see pg_dump -C. I have added a TODO item:

Add: Have pg_dump -C emit ALTER DATABASE ... SET commands after
database creation

Does the documentation need to be updated beyond my changes from
yesterday?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

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

[COMMITTERS] pgbouncer - pgbouncer: tag head as 1.3

Log Message:
-----------
tag head as 1.3

Modified Files:
--------------
pgbouncer:
configure.ac (r1.44 -> r1.45)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgbouncer/pgbouncer/configure.ac.diff?r1=1.44&r2=1.45)

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

[COMMITTERS] pgbouncer - pgbouncer: Allow '.' and '-' in database names.

Log Message:
-----------
Allow '.' and '-' in database names.

Patch by Alberto De Boni

Tags:
----
pgbouncer_1_2_stable

Modified Files:
--------------
pgbouncer:
AUTHORS (r1.4 -> r1.4.2.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgbouncer/pgbouncer/AUTHORS.diff?r1=1.4&r2=1.4.2.1)
NEWS (r1.31 -> r1.31.2.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgbouncer/pgbouncer/NEWS.diff?r1=1.31&r2=1.31.2.1)
pgbouncer/src:
loader.c (r1.15 -> r1.15.2.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgbouncer/pgbouncer/src/loader.c.diff?r1=1.15&r2=1.15.2.1)

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

Re: [BUGS] range value problem with double precision [PG 8.3.3]


hmmm,What I see is, I was getting error  of underflow valuein PG8.2  when i tried to insert '1E-307' in table with double precision.And my application was expecting the same error condition with the same values  against PG 8.3.3 as well.but now thats not the case?

Thanks,
Zahid K.

--- On Fri, 8/22/08, Peter Eisentraut <peter_e@gmx.net> wrote:
From: Peter Eisentraut <peter_e@gmx.net>
Subject: Re: [BUGS] range value problem with double precision [PG 8.3.3]
To: pgsql-bugs@postgresql.org, khanzahid235@yahoo.com
Date: Friday, August 22, 2008, 5:43 AM

Zahid Khan wrote:
> Hi ,
>
>  I see one issue pg 8.3.3 .
>
> 1.
> According to the documentation of pg "The double precision type
> typically has a range of around 1E-307 to 1E+308 with a precision of at
> least 15 digits".
>
> ref:-
>  http://www.postgresql.org/docs/8.3/static/datatype-numeric.html
>
> but in PG8.3 the values less then minimum range are being inserted.
>
> e.g
> . on insertion of 1E-308 we should get an error of "out of range or
> underflow value" but this value is being accepted by server.

The operating words are "typically" and "around". You can
put in smaller and
larger values, but then the precision is going to degrade, as you can observe
here:

peter=# select '1E-305'::float8;
float8
--------
1e-305
(1 row)

peter=# select '1E-310'::float8;
float8
-----------------------
9.99999999999997e-311
(1 row)

peter=# select '1E-315'::float8;
float8
-----------------------
9.99999998481684e-316
(1 row)

peter=# select '1E-320'::float8;
float8
-----------------------
9.99988867182683e-321
(1 row)

peter=# select '1E-325'::float8;
ERROR: 22003: "1E-325" is out of range for type double precision
LOCATION: float8in, float.c:426

The following, however, appears to be a bug:

peter=# select '1E-324'::float8;
ERROR: 22P02: invalid input syntax for type double precision:
"1E-324"
LOCATION: float8in, float.c:431

Re: [SQL] Concat field result in select query

Thank you, this is all what I need

On Fri, Aug 22, 2008 at 4:10 PM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
Nacef LABIDI a écrit :
> Hi all,
>
> I was wondering if there is a way to concatenate the results of a field
> in a select to return it as a single string.
>
> Example :
>
> my_field
> --------------
> 1
> 2
> 3
>
> select concat_something(my_field) from my_table group by something;
> the result expected would be someting like that : 1/2/3 (with a
> separator it would be really nice)
>
> I hope that I am not asking for too much ;)
>

Something like:

 SELECT array_to_string(array(select myfield from mytable), ','));

For example:

sherkin=# select * from t1;
 c1 | c2
----+----
 1 |
 2 |  3
 2 |  4
 2 |  5
(4 lignes)

sherkin=# SELECT array_to_string(array(select c1 from t1), ',');
 array_to_string
-----------------
 1,2,2,2
(1 ligne)


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: [pgadmin-hackers] Dialogs Review new patch

On Fri, Aug 22, 2008 at 3:06 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Dave Page a écrit :
>> - dlgManageMacros - if the size is reduced to minimum, a horizontal
>> scrollbar is show in the list control, due to the width of the name
>> column.
>>
>
> I don't have this issue. Perhaps do you mean dlgManageFavorites? or is
> it on Mac OS X?

Possibly - and no, Windows.

>> - dlgTrigger, dlgSequence and dlgView are quite tall. The latter two
>> are currently constrained by the height of the privs pane, but perhaps
>> also by the comments textbox which certainly could be smaller. Not
>> sure if it would be enough to get them to the standard size though
>> (perhaps we need two or three standard sizes)?
>>
>
> dlgTrigger is smaller. The four checkboxes are now in a 2x2
> wxFlexGridSizer. If we want to make it smaller once again, we need to
> replace the wxRadioBox with a wxComboBox.
>
> dlgSequence will need another tab, so we can reduce its size.
>
> dlgView is smaller too because of the resizeable Properties tab.
>
> The biggest one is now dlgSequence.

OK, cool. I guess we could just move the rarely-used sequence options
to a second tab.

>> - The privileges panes doesn't size yet.
>>
>
> It does now. It took me five hours to get something working. Glad it's
> finished :)

Yikes. I think I owe you more than a few beers at PGDay this year :-)

>> - Most dialogues seem to have an unused status bar at the bottom. I
>> think we should either remove it universally, or make it work
>> properly. What do you think?
>>
>
> Make them work properly would be better. The status bar offers important
> informations when a user deals with an unusual object (conversion for
> example).
>
> It doesn't work well on Mac?

Never seems to display anything on Windows.

> Not sure if we really want this now. It's difficult to know what I
> should commit. Obviously, the "remaining-to-be-fixed" should not :)

Well, I'll leave it to you to decide what you think is most appropriate.

> But can I commit the ctlSecurityPanel.cpp which takes care of the
> Privileges tab without commiting dlgTable? dlgTable still needs a fix
> but I don't know how the old dltTable will behave with the new
> resizeable Privileges tab.

Probably fine - it just takes a minute to find out :-)

Don't worry if you temporarily break the odd dialog. SVN code isn't
supposed to be stable, and I think that's probably a small price to
pay to avoid bitrot.

/D

--
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: [SQL] Concat field result in select query

Nacef LABIDI a écrit :
> Hi all,
>
> I was wondering if there is a way to concatenate the results of a field
> in a select to return it as a single string.
>
> Example :
>
> my_field
> --------------
> 1
> 2
> 3
>
> select concat_something(my_field) from my_table group by something;
> the result expected would be someting like that : 1/2/3 (with a
> separator it would be really nice)
>
> I hope that I am not asking for too much ;)
>

Something like:

SELECT array_to_string(array(select myfield from mytable), ','));

For example:

sherkin=# select * from t1;
c1 | c2
----+----
1 |
2 | 3
2 | 4
2 | 5
(4 lignes)

sherkin=# SELECT array_to_string(array(select c1 from t1), ',');
array_to_string
-----------------
1,2,2,2
(1 ligne)


--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com

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

Re: [ADMIN] Pg/CyberCluster test results

Maybe some people haven't read this site here:

http://www.postgresqldocs.org/wiki/Replication,_Clustering,_and_Connection_Pooling

It gives a nice overview. Another interesting project which isn't
production ready yet is Postgres-R (http://www.postgres-r.org/)

Robert


RW wrote:
> I hoped that it would be easier to get the nodes back in sync
> but it seems that all Postgres Multi-Master solutions are not
> reliable at the moment. I've planed to test CyberCluster
> this weekend but I already suspected that this rsync solutions
> have some shortcomings. Sniff...
>
> It seems that we have to wait for PGCluster-II which isn't a
> "shared nothing" solution. Instead all files are on a shared
> medium like SAN or iSCSI and all instances uses this medium
> (similar to Oracle).
>
> Robert
>
> CG wrote:
>> I've been testing Cybercluster (which is a modified PgCluster) ... I
>> have two back-end databases, one load balancer, and one replicator.
>> I've been testing failover and rebuilding a degraded cluster, and I'm
>> finidng that it is REALLY easy for the two back-ends to get out of
>> sync with each other. This is very disturbing. I was wondering if
>> anyone has experience with solving this problem.
>>
>>
>>
>>
>
>


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

Re: [pgadmin-hackers] Dialogs Review new patch

Dave Page a écrit :
> [...]
> On Mon, Aug 18, 2008 at 11:09 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>>
>> My new patch fixes some issues. Some dialogs seem ready to commit:
>
> Wow - they look excellent. Just some minor thoughts:
>
> - dlgManageMacros - if the size is reduced to minimum, a horizontal
> scrollbar is show in the list control, due to the width of the name
> column.
>

I don't have this issue. Perhaps do you mean dlgManageFavorites? or is
it on Mac OS X?

> - dlgTrigger, dlgSequence and dlgView are quite tall. The latter two
> are currently constrained by the height of the privs pane, but perhaps
> also by the comments textbox which certainly could be smaller. Not
> sure if it would be enough to get them to the standard size though
> (perhaps we need two or three standard sizes)?
>

dlgTrigger is smaller. The four checkboxes are now in a 2x2
wxFlexGridSizer. If we want to make it smaller once again, we need to
replace the wxRadioBox with a wxComboBox.

dlgSequence will need another tab, so we can reduce its size.

dlgView is smaller too because of the resizeable Properties tab.

The biggest one is now dlgSequence.

> - The privileges panes doesn't size yet.
>

It does now. It took me five hours to get something working. Glad it's
finished :)

> - Most dialogues seem to have an unused status bar at the bottom. I
> think we should either remove it universally, or make it work
> properly. What do you think?
>

Make them work properly would be better. The status bar offers important
informations when a user deals with an unusual object (conversion for
example).

It doesn't work well on Mac?

>> I don't think I should play with:
>> * dlgConnect.xrc
>> * dlgSelectConnection.xrc
>
> It may be useful to do them, if only so they size properly with
> non-standard fonts, or in other languages.
>

Done.

>> The txtValue/chkValue problem is fixed. The wxListCtrl problem is fixed
>> too, but with a dirty hack. I don't really like what I did but it works.
>> If someone has a better idea, I welcome it.
>
> I've seen a lot worse. I think a comment explaining the purpose of the
> function is in order though.

OK, will do.

> I think you should probably commit once
> you're at a convenient point, to minimise the risk of bitrot or future
> conflicts.
>

Not sure if we really want this now. It's difficult to know what I
should commit. Obviously, the "remaining-to-be-fixed" should not :)

But can I commit the ctlSecurityPanel.cpp which takes care of the
Privileges tab without commiting dlgTable? dlgTable still needs a fix
but I don't know how the old dltTable will behave with the new
resizeable Privileges tab.

> Nice work :-)
>

Thanks.

To do:
* dlgFindReplace

Remains to be fixed:
* dlgDatabase
* dlgFunction
* dlgLanguage
* dlgTable
* dlgType


New patch is available here:
http://developer.pgadmin.org/~guillaume/dialogreview_20080822.patch.bz2


--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.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: [SQL] Concat field result in select query

any explanations ?

On Fri, Aug 22, 2008 at 6:07 PM, Julien Cigar <jcigar@ulb.ac.be> wrote:
array_accum ?

On Fri, 2008-08-22 at 15:40 +0200, Nacef LABIDI wrote:
> Hi all,
>
> I was wondering if there is a way to concatenate the results of a
> field in a select to return it as a single string.
>
> Example :
>
> my_field
> --------------
> 1
> 2
> 3
>
> select concat_something(my_field) from my_table group by something;
> the result expected would be someting like that : 1/2/3 (with a
> separator it would be really nice)
>
> I hope that I am not asking for too much ;)
>
> Thanks to all
>
--
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles (ULB)
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
Mail: jcigar@ulb.ac.be
@biobel: http://biobel.biodiversity.be/person/show/471
Tel : 02 650 57 52


Re: [ADMIN] Pg/CyberCluster test results

I hoped that it would be easier to get the nodes back in sync
but it seems that all Postgres Multi-Master solutions are not
reliable at the moment. I've planed to test CyberCluster
this weekend but I already suspected that this rsync solutions
have some shortcomings. Sniff...

It seems that we have to wait for PGCluster-II which isn't a
"shared nothing" solution. Instead all files are on a shared
medium like SAN or iSCSI and all instances uses this medium
(similar to Oracle).

Robert

CG wrote:
> I've been testing Cybercluster (which is a modified PgCluster) ... I have two back-end databases, one load balancer, and one replicator. I've been testing failover and rebuilding a degraded cluster, and I'm finidng that it is REALLY easy for the two back-ends to get out of sync with each other. This is very disturbing. I was wondering if anyone has experience with solving this problem.
>
>
>
>
>


--
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] problem with foreign keys + data-only backup

Hi,

I do not think this will work. As far as I know foreign key checks are
not triggers. Postgres is very strict with things concerning referential
integrity so you cannot turn them off.

Maybe it will help to use "--orig-order" for creating the dump.

Markus


Richard Huxton schrieb:
> Peter Billen wrote:
>> Hi all,
>>
>> I have a problem with foreign keys and data-only (no schema) backup. I
>> have a simple table node (pseudo-SQL):
>
>> When I do a data-only backup, the backup file contains following two lines:
>>
>> INSERT INTO NODE (node_id, parent_node_id) VALUES (2, 1);
>> INSERT INTO NODE (node_id, parent_node_id) VALUES (1, NULL);
>>
>> Restoring the backup file into another database ofcourse fails, because
>> the parent_node_id (1) in the first INSERT statement refers to an
>> unknown (to be added) node (in the second statement).
>>
>> How do I make sure my backup orders the insert statements in a logical
>> order?
>
> You don't. You might find --disable-triggers useful though. See the
> pg_restore documentation for details.
>

--
Dipl.-Inform. Med. Markus Mehrwald
Institut für Prozessrechentechnik, Automation und Robotik
Medizin-Gruppe
Universität Karlsruhe (TH)
Gebäude 40.28, Zimmer 110
Engler-Bunte-Ring 8
76131 Karlsruhe

Fon: +49 (721) 608-7113
Fax: +49 (721) 608-7141

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

[SQL] Concat field result in select query

Hi all,

I was wondering if there is a way to concatenate the results of a field in a select to return it as a single string.

Example :

my_field
--------------
1
2
3

select concat_something(my_field) from my_table group by something;
the result expected would be someting like that : 1/2/3 (with a separator it would be really nice)

I hope that I am not asking for too much ;)

Thanks to all

[ADMIN] Pg/CyberCluster test results

I've been testing Cybercluster (which is a modified PgCluster) ... I have two back-end databases, one load balancer, and one replicator. I've been testing failover and rebuilding a degraded cluster, and I'm finidng that it is REALLY easy for the two back-ends to get out of sync with each other. This is very disturbing. I was wondering if anyone has experience with solving this problem.


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

[BUGS] BUG #4372: TO_DATE with ISO week and day

The following bug has been logged online:

Bug reference: 4372
Logged by: Kees Westerlaken
Email address: kees.westerlaken@valuecare.nl
PostgreSQL version: 8.3.3
Operating system: Windows
Description: TO_DATE with ISO week and day
Details:

The TO_DATE conversion with ISO week (IW) and ISO day (ID) format accepts
invalid values and sometimes returns wrong result.

select to_date('2008-31-4','IYYY-IW-ID')
results in "2008-07-31", which is correct

The valid values for IW are 1-7, however:
select to_date('2008-31-8','IYYY-IW-ID')
results in "2008-08-04" of which you could argue if it is correct.

However:
select to_date('2008-31-10','IYYY-IW-ID')
results in "2008-07-28", which is not correct

And even worse: if you use the IW and ID format in an older version it
works, but the result is wrong.
select to_date('2008-31-4','IYYY-IW-ID')
in version 8.2.6 results in "2004-07-26", which is wrong.

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

Re: [GENERAL] problem with foreign keys + data-only backup

Peter Billen wrote:
> Hi all,
>
> I have a problem with foreign keys and data-only (no schema) backup. I
> have a simple table node (pseudo-SQL):

> When I do a data-only backup, the backup file contains following two lines:
>
> INSERT INTO NODE (node_id, parent_node_id) VALUES (2, 1);
> INSERT INTO NODE (node_id, parent_node_id) VALUES (1, NULL);
>
> Restoring the backup file into another database ofcourse fails, because
> the parent_node_id (1) in the first INSERT statement refers to an
> unknown (to be added) node (in the second statement).
>
> How do I make sure my backup orders the insert statements in a logical
> order?

You don't. You might find --disable-triggers useful though. See the
pg_restore documentation for details.

--
Richard Huxton
Archonet Ltd

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

[BUGS] Installation Problems

Hi

We are trying to install postgres 8.3.0 on solaris 9.

The installation process comes up with the following error.

Please mail kurt@4cit.co.za as I will be out of the office for a month

 

bash-2.05$ ldd initdb

        libxslt.so.1 =>  /lib/libxslt.so.1

        libxml2.so.2 =>  /lib/libxml2.so.2

        libpam.so.1 =>   /lib/libpam.so.1

        libssl.so.0.9.8 =>       /usr/local/ssl/lib/libssl.so.0.9.8

        libcrypto.so.0.9.8 =>    /usr/local/ssl/lib/libcrypto.so.0.9.8

        libkrb5.so.1 =>  (file not found)

        libz.so.1 =>     /lib/libz.so.1

        libcurses.so.1 =>        /lib/libcurses.so.1

        libsocket.so.1 =>        /lib/libsocket.so.1

        libm.so.2 =>     /lib/libm.so.2

        libc.so.1 =>     /lib/libc.so.1

        libc.so.1 (SUNW_1.22) =>         (version not found)

        libpthread.so.1 =>       /lib/libpthread.so.1

        libm.so.1 =>     /lib/libm.so.1

        libnsl.so.1 =>   /lib/libnsl.so.1

        libdl.so.1 =>    /lib/libdl.so.1

        libcmd.so.1 =>   /lib/libcmd.so.1

        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1

        libmp.so.2 =>    /lib/libmp.so.2

        /usr/platform/SUNW,Sun-Fire-V240/lib/libc_psr.so.1

        libthread.so.1 =>        /lib/libthread.so.1

 

 

Regards

 

Bernard Stewe
System Administrator: UNIX

4CIT Software Solutions

Tel:   +27(0)21 979 0900 ext. 200

Fax:  +27(0)21 979 0902

Cell:  +27(0)79 885 6809

 

Re: [pgsql-www] request for sponsors page

Josh Berkus wrote:
> > No, I'm not because if you think we should start tracking and listing
> > everyone that gives us five bucks then you clearly need to come in out
> > of the sun for a while :-).
>
> Why not?  It's the best way to increase the number of people who give us
> $5.

Well, someone giving three qualified answers to a mailing list inquiry on a
user list is worth a lot more than five bucks of their time, and you surely
don't want to include that in your listing.

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

Re: [BUGS] range value problem with double precision [PG 8.3.3]

Zahid Khan wrote:
> Hi ,
>
>  I see one issue pg 8.3.3 .
>
> 1.
> According to the documentation of pg "The double precision type
> typically has a range of around 1E-307 to 1E+308 with a precision of at
> least 15 digits".
>
> ref:-
>  http://www.postgresql.org/docs/8.3/static/datatype-numeric.html
>
> but in PG8.3 the values less then minimum range are being inserted.
>
> e.g
> . on insertion of 1E-308 we should get an error of "out of range or
> underflow value" but this value is being accepted by server.

The operating words are "typically" and "around". You can put in smaller and
larger values, but then the precision is going to degrade, as you can observe
here:

peter=# select '1E-305'::float8;
float8
--------
1e-305
(1 row)

peter=# select '1E-310'::float8;
float8
-----------------------
9.99999999999997e-311
(1 row)

peter=# select '1E-315'::float8;
float8
-----------------------
9.99999998481684e-316
(1 row)

peter=# select '1E-320'::float8;
float8
-----------------------
9.99988867182683e-321
(1 row)

peter=# select '1E-325'::float8;
ERROR: 22003: "1E-325" is out of range for type double precision
LOCATION: float8in, float.c:426

The following, however, appears to be a bug:

peter=# select '1E-324'::float8;
ERROR: 22P02: invalid input syntax for type double precision: "1E-324"
LOCATION: float8in, float.c:431

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

Re: [HACKERS] [FINALLY] the TODO list has migrated to Wiki

A Divendres 22 Agost 2008, Alvaro Herrera va escriure:
> Alvaro Herrera escribió:
> > They did not merge with the text, but they were not searchable. May I
> > suggest using the text "[easy]" and "[done]" instead? That way, it is
> > searchable, and they don't merge with the text.
>
> I just made this change. What I now notice is that both markers are
> visually not very different. I don't know if this is something worth
> fussing about. (Maybe the addition of icons as Brendan was suggesting
> would be sufficient visual clue.)

Thanks. Maybe setting [easy] in orange and [done] in green would solve that
too.

>
> --
> Alvaro Herrera http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.

--
Albert Cervera i Areny
http://www.NaN-tic.com

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

Re: [JDBC] Pooled connections idle timeout

Oliver Jowett wrote:
> Daniele Depetrini wrote:
>> Hi Again,
>>
>> Any ideas?
>
> There is no auto-idle-close mechanism in the pool implementation
> provided by the driver.
>
> The connection pool shipped with the driver is very basic. If it
> doesn't do what you need it to, you probably want to use a 3rd party
> connection pool (e.g. dbcp). I don't think there's much point in
> building any sort of fully-featured connection pool to ship with the
> driver - there are plenty of other implementations already out there.
>
> -O
>
>
Thanks for the answer. Actually according to my testing up to now is
working "well enough". It's not clear to me if prepared statements
pooling is implemented: in positive case will be much better to use
internal pooling instead of an external one, what do you think?

Daniele.

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

Re: [GENERAL] LIKE and SIMILAR TO

On Fri, 22 Aug 2008 16:43:47 +0530
"c k" <shreeseva.learning@gmail.com> wrote:

> Hello all,
> As we are migrating our ERP application from MySQL to PostgreSQL
> we have some difficulties. One of them is use of Like and Similar
> to operators. We often use LIKE to search a string from front-end
> without case sensetivity. As postgreSQL's LIKE is case sensitive,
> we tried ILIKE and SIMILAR TO, but both are slower than LIKE and
> we must need case insensitivity. How can we get this by increases
> speed. All search columns are VARCHAR(100)to VARCHAR(250).
> Currently without index.

I was going to suggest to create a functional index
create index on sometable using btree (upper(somecolumn));

select * from sometable where upper(somecolumn)
like '%' || upper(somestring) || '%';

but indexes aren't going to work if you're searching with a prefixed
%.

I was wondering what are the performances of postgresql vs. MySQL in
such case.
Anyway I'd tweak postgresql.conf before complaining it is slower
than MySQL. I've been surprised as well at how postgresql can be
fast.

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


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

[PERFORM] Identifying the nature of blocking I/O

[for the purpose of this post, 'blocking' refers to an I/O operation
taking a long time for reasons other than the amount of work the I/O
operation itself actually implies; not to use of blocking I/O calls or
anything like that]

Hello,

I have a situation in which deterministic latency is a lot more
important than throughput.

I realize this is a hugely complex topic and that there is inteaction
between many different things (pg buffer cache, os buffer cache, raid
controller caching, wal buffers, storage layout, etc). I already know
several things I definitely want to do to improve things.

But in general, it would be very interesting to see, at any given
moment, what PostgreSQL backends are actually blocking on from the
perspective of PostgreSQL.

So for example, if I have 30 COMMIT:s that are active, to know whether
it is simply waiting on the WAL fsync or actually waiting on a data
fsync because a checkpoint is being created. or similarly, for
non-commits whether they are blocking because WAL buffers is full and
writing them out is blocking, etc.

This would make it easier to observe and draw conclusions when
tweaking different things in pg/the os/the raid controller.

Is there currently a way of dumping such information? I.e., asking PG
"what are backends waiting on right now?".

--
/ Peter Schuller

PGP userID: 0xE9758B7D or 'Peter Schuller <peter.schuller@infidyne.com>'
Key retrieval: Send an E-Mail to getpgpkey@scode.org
E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org

Re: [ADMIN] [GENERAL] LIKE and SIMILAR TO

Thanks to all,
I will try to use tsearch2 with some other index and then reply.
Regards,
CPK

On Fri, Aug 22, 2008 at 5:01 PM, Tino Wildenhain <tino@wildenhain.de> wrote:
Hi,


c k wrote:
Hello all,
As we are migrating our ERP application from MySQL to PostgreSQL we have some difficulties. One of them is use of Like and Similar to operators. We often use LIKE to search a string from front-end without case sensetivity. As postgreSQL's LIKE is case sensitive, we tried ILIKE and SIMILAR TO, but both are slower than LIKE and we must need case insensitivity. How can we get this by increases speed. All search columns are VARCHAR(100)to VARCHAR(250). Currently without index.

You could build an index on lower(column) and use lower(column) like ...
this would speed up queries with exact match as well as 'foo%'
e.g. "start with..." match.

Make sure when you create the database cluster (initdb) you
used the currect locale, otherwise lower() (and ilike) probably
do not work as you might expect.

For any more complex searches I'd recommend full text index,
for example tsearch2.

Regards
Tino

[BUGS] range value problem with double precision [PG 8.3.3]

Hi ,

 I see one issue pg 8.3.3 .

1. According to the documentation of pg "The double precision type typically has a range of around 1E-307 to 1E+308 with a precision of at least 15 digits".

ref:-
 http://www.postgresql.org/docs/8.3/static/datatype-numeric.html

but in PG8.3 the values less then minimum range are being inserted.

e.g . on insertion of 1E-308 we should get an error of "out of range or underflow value" but this value is being accepted by server.



Thanks,
Zahid K.

Re: [ADMIN] [GENERAL] LIKE and SIMILAR TO

Hi,

c k wrote:
> Hello all,
> As we are migrating our ERP application from MySQL to PostgreSQL we have
> some difficulties. One of them is use of Like and Similar to operators.
> We often use LIKE to search a string from front-end without case
> sensetivity. As postgreSQL's LIKE is case sensitive, we tried ILIKE and
> SIMILAR TO, but both are slower than LIKE and we must need case
> insensitivity. How can we get this by increases speed. All search
> columns are VARCHAR(100)to VARCHAR(250). Currently without index.

You could build an index on lower(column) and use lower(column) like ...
this would speed up queries with exact match as well as 'foo%'
e.g. "start with..." match.

Make sure when you create the database cluster (initdb) you
used the currect locale, otherwise lower() (and ilike) probably
do not work as you might expect.

For any more complex searches I'd recommend full text index,
for example tsearch2.

Regards
Tino

[BUGS] BUG #4371: Foreign Key constraints not working with ODBC

The following bug has been logged online:

Bug reference: 4371
Logged by: Zahid Khan
Email address: khanzahid235@yahoo.com
PostgreSQL version: 8.3.3
Operating system: Linux
Description: Foreign Key constraints not working with ODBC
Details:

I am unable to get the foreign key information using SQLForeignKeys() API
function of psqlODBC driver. Same driver works with PG8.2 and returns
success on SQLFetch() with SQLForeignKeys() call. But in PG8.3 i am getting
NO_DATA_FOUND on SQLFetch() call.

Please find below sample code how i am using this.

cliRC = SQLForeignKeys(hstmt, NULL, 0, tbSchema, SQL_NTS, tbName, SQL_NTS,
NULL, 0, NULL, SQL_NTS, NULL, SQL_NTS);

/* bind column 6 to variable */
cliRC = SQLBindCol(hstmt, 6, SQL_C_CHAR, (SQLPOINTER)fkTableSch.val, 129,
&fkTableSch.ind);

/* bind column 7 to variable */
cliRC = SQLBindCol(hstmt, 7, SQL_C_CHAR, (SQLPOINTER)fkTableName.val, 129,
&fkTableName.ind);

/* bind column 8 to variable */
cliRC = SQLBindCol(hstmt, 8, SQL_C_CHAR, (SQLPOINTER)fkColumnName.val,
129, &fkColumnName.ind);

/* fetch each row and display */
WriteResultFile( "\n Fetch each row and display.\n");

/* fetch next row */
cliRC = SQLFetch(hstmt);

if (cliRC == SQL_NO_DATA_FOUND)
{
WriteResultFile( "\n Data not found.\n");
}


As a reference following are the quires which odbc driver is sending to
server for getting this information.

Query is [SELECT pt.tgargs, pt.tgnargs, pt.tgdeferrable,
pt.tginitdeferred, pp1.proname, pp2.proname, pc.oid,
pc1.oid, pc1.relname, pt.tgconstrname, pn1.nspname FROM
pg_catalog.pg_class pc, pg_catalog.pg_class pc1,
pg_catalog.pg_proc pp, pg_catalog.pg_proc pp1, pg_catalog.pg_proc
pp2, pg_catalog.pg_trigger pt, pg_catalog.pg_trigger pt1,
pg_catalog.pg_trigger pt2, pg_catalog.pg_namespace pn,
pg_catalog.pg_namespace pn1 WHERE pc.relname='DEPT321'AND pn.nspname =
'public' AND pc.relnamespace = pn.oid AND pt.tgconstrrelid =
pc.oid AND pp.oid = pt.tgfoid AND pp.proname Like '%ins' AND
pt1.tgconstrname = pt.tgconstrname AND pt1.tgconstrrelid = pt.tgrelid
AND pt1.tgrelid = pc.oid AND pc1.oid = pt.tgrelid AND pp1.oid
= pt1.tgfoid AND pp1.proname like '%upd' AND (pp1.proname not
like '%check%') AND pt2.tgconstrname = pt.tgconstrname AND
pt2.tgconstrrelid = pt.tgrelid AND pt2.tgrelid = pc.oid AND
pp2.oid = pt2.tgfoid AND pp2.proname Like '%del' AND pn1.oid =
pc1.relnamespace order by pt.tgconstrname]

***********************************************
Query is [select ta.attname, ia.attnum, ic.relname, n.nspname, tc.relname
from pg_catalog.pg_attribute ta, pg_catalog.pg_attribute ia,
pg_catalog.pg_class tc, pg_catalog.pg_index i, pg_catalog.pg_namespace n,
pg_catalog.pg_class ic where tc.relname = 'dept321' AND n.nspname = 'public'
AND tc.oid = i.indrelid AND n.oid = tc.relnamespace AND i.indisprimary = 't'
AND ia.attrelid = i.indexrelid AND ta.attrelid = i.indrelid AND ta.attnum =
i.indkey[ia.attnum-1] AND (NOT ta.attisdropped) AND (NOT ia.attisdropped)
AND ic.oid = i.indexrelid order by ia.attnum]

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

Re: [GENERAL] Script to export all privileges to csv or similar

On Friday 22 August 2008 05:15, Anton Melser wrote:
> Hi,
> Does anyone know of a script/tool that allows one to export all users
> with all privileges? I realise I could construct a query to do it but
> google turned up nothing and if someone else has done the good work...
> Cheers
> Anton
>
> --
> echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
> This will help you for 99.9% of your problems ...

Have you looked at pg_dumpall -g ?
--
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 404-6987
terry@turbocorp.com
www.turbocorp.com

--
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] LIKE and SIMILAR TO

Maybe you should give tsearch2 a try and create a GIN index.
Regex searches are sometimes a option.

Robert


c k wrote:
> Hello all,
> As we are migrating our ERP application from MySQL to PostgreSQL we
> have some difficulties. One of them is use of Like and Similar to
> operators. We often use LIKE to search a string from front-end without
> case sensetivity. As postgreSQL's LIKE is case sensitive, we tried
> ILIKE and SIMILAR TO, but both are slower than LIKE and we must need
> case insensitivity. How can we get this by increases speed. All search
> columns are VARCHAR(100)to VARCHAR(250). Currently without index.
>
> Thanks,
> CPK


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

[pgadmin-hackers] SVN Commit by dpage: r7419 - in trunk/pgadmin3: . docs/en_US pgadmin/ctl pgadmin/include/ctl

Author: dpage

Date: 2008-08-22 12:20:42 +0100 (Fri, 22 Aug 2008)

New Revision: 7419

Revision summary: http://svn.pgadmin.org/cgi-bin/viewcvs.cgi/?rev=7419&view=rev

Log:
Add options to shift selected text to upper or lower case in the SQL editor.
Add block commenting and uncommenting to the SQL editor.


Modified:
trunk/pgadmin3/CHANGELOG
trunk/pgadmin3/docs/en_US/query.html
trunk/pgadmin3/pgadmin/ctl/ctlSQLBox.cpp
trunk/pgadmin3/pgadmin/include/ctl/ctlSQLBox.h

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

[ADMIN] LIKE and SIMILAR TO

Hello all,
As we are migrating our ERP application from MySQL to PostgreSQL we have some difficulties. One of them is use of Like and Similar to operators. We often use LIKE to search a string from front-end without case sensetivity. As postgreSQL's LIKE is case sensitive, we tried ILIKE and SIMILAR TO, but both are slower than LIKE and we must need case insensitivity. How can we get this by increases speed. All search columns are VARCHAR(100)to VARCHAR(250). Currently without index.

Thanks,
CPK

Re: [JDBC] Tracing SQL statements per page/request

begin:vcard
fn:Thomas Markus
n:Markus;Thomas
org:proventis GmbH
adr:;;Zimmerstr. 79-80;Berlin;Berlin;10117;Germany
email;internet:t.markus@proventis.net
tel;work:+49 30 29 36 399 22
x-mozilla-html:FALSE
url:http://www.proventis.net
version:2.1
end:vcard

Hi,

better use log4j instead of hibernate.show_sql so you can log to a
different logger (fi file).
activate debug for category org.hibernate.SQL to show sql statements and
org.hibernate.type for binded parameters.

regards
Thomas


Shahaf Abileah schrieb:
> Using hibernate.show_sql sounds like a reasonable idea. I've used this
> option to display the SQL in standard out before. Is there a way to
> pipe that output into a different logger (e.g. an in-memory logger that
> is specific to the current request)? Also, I've noticed that the
> hibernate.show_sql option doesn't display the parameter *values*;
> instead, it has a bunch of '?' to represent the real values (which, I
> presume, are substituted somewhere along the way). Is there a way to
> configure hibernate logging to log the statement with real values
> instead of placeholders?
>
> Thanks!
>
> --S
>
>
> -----Original Message-----
> From: Guillaume Cottenceau [mailto:gc@mnc.ch]
> Sent: Thursday, August 21, 2008 2:29 AM
> To: Shahaf Abileah
> Cc: pgsql-jdbc@postgresql.org
> Subject: Re: [JDBC] Tracing SQL statements per page/request
>
> Shahaf Abileah <shahaf 'at' redfin.com> writes:
>
>
>> If not, can someone recommend another approach? In case it helps, we
>>
> use
>
>> hibernate as our O-R mapping so hibernate is responsible for
>>
> generating most
>
>> (not all) of our SQL queries (some are still issued by direct SQL).
>>
> Also, we
>
> in pg is a good idea, as already suggested, but if many other
> unrelated clients also access pg and thus it's difficult to
> isolate the queries you're interested in, why not
> hibernate.show_sql + appropriate logging on your direct SQL
> layer?
>
>

[GENERAL] Postgresql 8.3 statistic stadistinct value dead wrong even with default_statistics_target=1000

Some time ago i found one simple sql over large table eat whole ram+swap and almost killed server (postgresql 8.3.3 on 4gb freebsd server):
After some exploring i found what happens:

Query was over simple table:

profiles=# \d+ counter_vis
Table "counter_vis"
Column | Type | Modifiers | Description
--------------+---------+-----------+-------------
counter_id | bigint | not null |
visitor_id | bigint | not null |
ts | bigint | not null |
sessionstart | bigint | not null |
sessionend | bigint | not null |
numpageviews | integer | not null |
Indexes:
"counter_vis_counter" btree (counter_id)
"counter_vis_vis" btree (visitor_id)
Has OIDs: no

Which contain around 648M entries. (according fresh analyzed stats from pg_stat_user_tables).

Query was: select count(*) from (select visitor_id, sum(numpageviews) as s from counter_vis group by visitor_id having sum(numpageviews)>1) as foo;

With plan:
QUERY PLAN
---------------------------------------------------------------------------------------------------
Aggregate (cost=17429989.40..17429989.41 rows=1 width=0)
-> HashAggregate (cost=17422096.40..17426700.65 rows=263100 width=12)
Filter: (sum(counter_vis.numpageviews) > 1)
-> Seq Scan on counter_vis (cost=0.00..12554826.80 rows=648969280 width=12)


Plan look ok... but how query eat over 4gb ram?

After lookin i found one strange point: " rows=263100" because i know in table must have around 70M unique visitor_id's.

Manual analyze on table do not changed plan.
Here is pg_statistic entry after analyze (with default_statistics_target=10):

profiles=# SELECT * from pg_statistic where starelid=25488 and staattnum=2 order by 2 asc;
-[ RECORD 1 ]-------------------------------------------------------------------------------------------------------------------------------------------
starelid | 25488
staattnum | 2
stanullfrac | 0
stawidth | 8
stadistinct | 263100 (!!!! here is 70M distinct values in reality!!!!)
stakind1 | 1
stakind2 | 2
stakind3 | 3
stakind4 | 0
staop1 | 410
staop2 | 412
staop3 | 412
staop4 | 0
stanumbers1 | {0.000666667,0.000666667,0.000666667,0.000666667,0.000666667,0.000666667,0.000666667,0.000666667,0.000666667,0.000666667}
stanumbers2 |
stanumbers3 | {-0.0443004}
stanumbers4 |
stavalues1 | {413866965,489514660,624858316,753063164,790095243,1279713644,1628857812,2104294292,2726728837,2771123172}
stavalues2 | {-9035671468843485583,184524075,555699387,921684844,1329929495,1897558820,2602632340,3083805588,3511488708,3963719633,9173061477162286552}
stavalues3 |
stavalues4 |


so stadistinct is 300 times wrong from reality.

Already strange... and i need run that query anyway... so i changed default_statistics_target to 1000 and analyzed table again:

profiles=# ANALYZE verbose counter_vis;
INFO: analyzing "counter_vis"
INFO: "counter_vis": scanned 300000 of 6065134 pages, containing 32100000 live rows and 0 dead rows; 300000 rows in sample, 648969338 estimated total rows
ANALYZE

After statistic was better:

starelid | 25488
staattnum | 2
stanullfrac | 0
stawidth | 8
stadistinct | 7.12958e+06
stakind1 | 1
stakind2 | 2
stakind3 | 3
stakind4 | 0
staop1 | 410
staop2 | 412
staop3 | 412
staop4 | 0
... long stats skipped...

!!!! but stadistinct still 10 times wrong from reality:

profiles=# SELECT count(distinct visitor_id) from counter_vis;
count
----------
69573318
(1 row)

Any way deal with such situations? Because 10Ñ… difference if postgres choose hashed plan will easy kill server because OOM (because query will use 10x more ram then postgres awaited).

Probably some strange effects in statdistinc count algoritm?
Or just any way remove limits on default_statistics_target?

Thanks for help.

PS: sorry for bad english.

--
Maxim Boguk

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

[GENERAL] problem with foreign keys + data-only backup

Hi all,

I have a problem with foreign keys and data-only (no schema) backup. I
have a simple table node (pseudo-SQL):

node
(
integer node_id NOT NULL PRIMARY KEY;
integer parent_node_id NULL;
)

It contains the following two entries:

node(1, NULL) the rood
node(2, 1) a child of the root

When I do a data-only backup, the backup file contains following two lines:

INSERT INTO NODE (node_id, parent_node_id) VALUES (2, 1);
INSERT INTO NODE (node_id, parent_node_id) VALUES (1, NULL);

Restoring the backup file into another database ofcourse fails, because
the parent_node_id (1) in the first INSERT statement refers to an
unknown (to be added) node (in the second statement).

How do I make sure my backup orders the insert statements in a logical
order?

This is how I make the backup:

pg_dump.exe -h ... -p 5432 -U ... --column-inserts --ignore-version
--file=dump --format=t --data-only --verbose db

This is how I import the backup:

pg_restore.exe -h .... -p 5432 -U ... --dbname db --format=t --verbose
--table=channel dump

Thanks all. Kind regards,

Peter

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

Re: [HACKERS] Proposal: new border setting in psql

On Fri, 22 Aug 2008 08:23:01 +0200
Martijn van Oosterhout <kleptog@svana.org> wrote:
> On Thu, Aug 21, 2008 at 11:18:24PM -0400, D'Arcy J.M. Cain wrote:
> > ReST is nice because it's almost plain text. In fact, a ReST document
> > source can easily be read raw.
>
> I presume by ReST you mean this:
> http://docutils.sourceforge.net/rst.html

Yes. See the original message in this thread.

--
D'Arcy J.M. Cain <darcy@druid.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.

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

Re: [PERFORM] Postgres not using array

André Volpato <andre.volpato@ecomtecnologia.com.br> writes:

> Tom Lane escreveu:
>>> We are guessing that a dual core 3.0GHz will beat up a quad core 2.2,
>>> at least in this environmnent with less than 4 concurrent queryes.
>>
>> The most you could hope for from that is less than a 50% speedup. I'd
>> suggest investing some tuning effort first. Some rethinking of your
>> schema, for example, might buy you orders of magnitude ... with no new
>> hardware investment.
>
> I think we almost reached the tuning limit, without changing the schema.

It's hard to tell from the plan you posted (and with only a brief look) but it
looks to me like your query with that function is basically doing a join but
because the inner side of the join is in your function's index lookup it's
effectively forcing the use of a "nested loop" join. That's usually a good
choice for small queries against big tables but if you're joining a lot of
data there are other join types which are much faster. You might find the
planner can do a better job if you write your query as a plain SQL query and
let the optimizer figure out the best way instead of forcing its hand.


--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's On-Demand Production Tuning

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

Re: [PERFORM] The state of PG replication in 2008/Q2?

Dan Harris wrote:
> My desire would be to have a parallel server that could act as a hot
> standby system with automatic fail over in a multi-master role.

I will add my "me too" for DRBD + Heartbeat.

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

Re: [BUGS] Postgresql v8.3.3 + Perl v5.10

Yes, I am ActivePerl and Win32 Binary PG
Is it scheduled to fix?

----- Original Message -----
From: "Pavel Stehule" <pavel.stehule@gmail.com>
To: "Peter Eisentraut" <peter_e@gmx.net>
Cc: <pgsql-bugs@postgresql.org>; <Eugen.Konkov@aldec.com>; "Euler Taveira de
Oliveira" <euler@timbira.com>
Sent: Friday, August 22, 2008 12:20 PM
Subject: Re: [BUGS] Postgresql v8.3.3 + Perl v5.10


> 2008/8/22 Peter Eisentraut <peter_e@gmx.net>:
>> Eugen.Konkov@aldec.com wrote:
>>> 1. Install Perl v5.10
>>> 2. Install PG
>>> 3. PG does not see that machine has Perl
>>> 4. Remove Perl and PG
>>> 5. Instll Perl v5.8
>>> 6. Install PG
>>> 7. PG work fine
>>> Problem is that PG does not recognize Perl v5.10 =(
>>
>> Please provide the actual commands and the actual output, not abstract
>> descriptions.
>>
>> I can tell you that I am building and running PostgreSQL and Perl 5.10
>> just
>> fine. So the problem must be in the details, which are not evident from
>> your
>> description.
>>
>
> This bug was reported I though. win installer doesn't recognize
> installed Perl 5.10 and doesn't allow plperl installation.
>
> Pavel
>
>> --
>> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-bugs
>>
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs


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

Re: [BUGS] Postgresql v8.3.3 + Perl v5.10

2008/8/22 Peter Eisentraut <peter_e@gmx.net>:
> Eugen.Konkov@aldec.com wrote:
>> 1. Install Perl v5.10
>> 2. Install PG
>> 3. PG does not see that machine has Perl
>> 4. Remove Perl and PG
>> 5. Instll Perl v5.8
>> 6. Install PG
>> 7. PG work fine
>> Problem is that PG does not recognize Perl v5.10 =(
>
> Please provide the actual commands and the actual output, not abstract
> descriptions.
>
> I can tell you that I am building and running PostgreSQL and Perl 5.10 just
> fine. So the problem must be in the details, which are not evident from your
> description.
>

This bug was reported I though. win installer doesn't recognize
installed Perl 5.10 and doesn't allow plperl installation.

Pavel

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

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