Tuesday, August 12, 2008

[HACKERS] Copy column storage parameters on CREATE TABLE LIKE/INHERITS

Here is an updated version of the "Copy storage parameters" patch.
http://archives.postgresql.org/pgsql-hackers/2008-07/msg01417.php

This patch copies only column storage parameters and does not copy
reloptions as a result of the discussion, in which reloptions should
not be copied because LIKE and INHERITS are not table definitions,
but column definitions.

Copying reloptions (or copying just table's definition) might be useful
in some cases, but it should be done by another independent patch.


Inheriting column storage parameters is useful if we duplicate an
existing table. CREATE TABLE AS is useful to avoid WALs in that time:

CREATE TABLE (LIKE target) WITH (<same as the target table>)
AS SELECT * FROM target;

However, we cannot execute ALTER COLUMN SET STORAGE after creating the
new table and before inserting, because there are no time to execute
commands between them. So we need some methods to set column storage
parameters at creating a table.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

Re: [GENERAL] differnt behaviour of NULL in an aggregate and with an operator

Willy-Bas Loos wrote:
> Hi,
>
> Why is it that
> SELECT 1+null
> evaluates to NULL, but
> SELECT sum(foo) FROM (VALUES(1), (NULL)) AS v(foo)
> evaluates to 1 ?

SUM(x) ignores null input, like COUNT(x) etc. It's the sum of all
non-null instances of x.

There's some useful explanation of the various NULL handling of
aggregates here:

http://www.postgresql.org/docs/8.3/static/sql-createaggregate.html

though I'm not sure how well it applies to the built-in aggregates.

--
Craig Ringer

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

[GENERAL] differnt behaviour of NULL in an aggregate and with an operator

Hi,

Why is it that
  SELECT 1+null
evaluates to NULL, but
  SELECT sum(foo) FROM (VALUES(1), (NULL)) AS v(foo)
evaluates to 1 ?

WBL

Re: [PERFORM] long transaction

> long running transactions can be evil. is there a reason why this has
> to run in a single transaction?

This single transaction is used to import new information in a database. I
need it because the database cannot be disconected from the users, and the
whole new data has to be consistently. There are different constraints that
are checked during the import.

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

Re: [HACKERS] WIP: New Page API

Hi,

Zdenek Kotala wrote:
> I finished first prototype of new page API.

This might seem obvious to you, but could you please describe the
problem you are trying to solve with this new page API? How does it
relate to the relation forks, that have just been committed?

Regards

Markus


--
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] Plugin system like Firefox

Hi,

Bruce Momjian wrote:
> So, ideally, if we do a plug-in system, I think we need some way to have
> these plugins be very easily installed, perhaps by choosing object files
> pre-compile by the build farm for each operating system.

IIRC the main problem isn't compilation and packaging of plugins. On
your Ubuntu system, for example, you can easily install
'postgresql-contrib-8.x' and get most of the contrib modules as *.so
libraries. You'll even find the install_*.sql and uninstall_*.sql
scripts in '/usr/share/postgresql/8.x/contrib'.

The main problem I see is ease of installation and backup/restore
capability of these modules. Installing the tsearch2 module with:

psql $YOURDB < /usr/share/postgresql/8.x/contrib/tsearch2.sql

..is already quite easy to do. But beware of the trouble when trying to
back up and restore that database later on!


At the moment, we distinguish between system objects, initdb objects and
user objects by OID:

#define FirstBootstrapObjectId 10000
#define FirstNormalObjectId 16384


But objects created by modules are indistinguishable from user objects.
IMO, that's the main problem. Maybe we can solve this by reserving yet
another range of OIDs for modules. Then treat these objects as 'system'
objects during a pg_dump? I'm not sure if such a limited range of OIDs
is a good idea, but IMO the ability to tell apart system, module and
user objects is the key feature required here.

Regards

Markus Wanner


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

Re: [pgadmin-support] run-away query

I stopped the query this morning after 24 hours of running, restarted
pgadmin and restarted the postgresql server.

I ran the query again and it went relatively quickly (only 1.3 hours).

I don't know what went wrong, but apparently something did.

Sim

Sim Zacks wrote:
> I am running a query in PGAdmin.
> I changed the storage on a bytea field from External to Main and then ran
> update dbmail_messageblks set messageblk=messageblk || '';
> so that it would move all the rows to the new storage.
> This is a very large table, so I actually expect it to take a long time.
> The table has approximately 200,000 rows
>
> select max(length(messageblk)),avg(length(messageblk)) from
> dbmail_messageblks
> MAX AVG
> 532259; 48115.630147120314
>
> The query has been running for 6.5 hours now and in the status bar of
> the query tool it says "Query is running" and the count in ms is still
> running.
>
> I had checked a number of times using select * from pg_stat_activity and
> it was in there and running. The last time I checked the query was not
> listed in pg_stat_activity. In fact There is no row for that window. I
> have 3 windows open for that database, the one running the query, the
> one I queried pg_stat_activity from and another one.
> When I query pg_stat_activity it shows 2 rows for my ip address, the
> pg_stat_activity and an IDLE row. When I close the other window it only
> shows one row for my IP address.
>
> I also checked in Linux PS - my IP address only shows up in ps aux for
> the other windows, not for this 6.5 hour query.
>
> Is there any way to check what is going on?
>
> Thank you
> Sim
>
>
>

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

Re: [BUGS] BUG #4350: 'select' acess given to views containing "union all" even though user has no grants

Tom Lane wrote:
> I think it might be better to fix the problem in
> pull_up_union_leaf_queries instead; given that it wasn't broken till
> recently, I think it's arguably that function's fault.

Not sure what you mean. pull_up_union_leaf_queries was introduced at the
same time as the rest of the logic to pull up UNION ALL subqueries, in
8.2, and has been broken ever since.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

--
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] BUG #4350: 'select' acess given to views containing "union all" even though user has no grants

Index: src/backend/optimizer/prep/prepjointree.c
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/backend/optimizer/prep/prepjointree.c,v
retrieving revision 1.44
diff -c -r1.44 prepjointree.c
*** src/backend/optimizer/prep/prepjointree.c 4 Oct 2006 00:29:54 -0000 1.44
--- src/backend/optimizer/prep/prepjointree.c 12 Aug 2008 07:39:30 -0000
***************
*** 46,52 ****
static Node *pull_up_simple_union_all(PlannerInfo *root, Node *jtnode,
RangeTblEntry *rte);
static void pull_up_union_leaf_queries(Node *setOp, PlannerInfo *root,
! int parentRTindex, Query *setOpQuery);
static void make_setop_translation_lists(Query *query,
Index newvarno,
List **col_mappings, List **translated_vars);
--- 46,52 ----
static Node *pull_up_simple_union_all(PlannerInfo *root, Node *jtnode,
RangeTblEntry *rte);
static void pull_up_union_leaf_queries(Node *setOp, PlannerInfo *root,
! int parentRTindex, Query *setOpQuery, Bitmapset **pulledUpRtes);
static void make_setop_translation_lists(Query *query,
Index newvarno,
List **col_mappings, List **translated_vars);
***************
*** 477,482 ****
--- 477,485 ----
{
int varno = ((RangeTblRef *) jtnode)->rtindex;
Query *subquery = rte->subquery;
+ Bitmapset *pulledUpRtes = NULL;
+ ListCell *l;
+ int i;

/*
* Recursively scan the subquery's setOperations tree and copy the leaf
***************
*** 484,490 ****
* them to the parent's append_rel_list, too.
*/
Assert(subquery->setOperations);
! pull_up_union_leaf_queries(subquery->setOperations, root, varno, subquery);

/*
* Mark the parent as an append relation.
--- 487,512 ----
* them to the parent's append_rel_list, too.
*/
Assert(subquery->setOperations);
! pull_up_union_leaf_queries(subquery->setOperations, root, varno, subquery,
! &pulledUpRtes);
!
! /*
! * pull_up_union_leaf_queries already copied those range table entries
! * from the subqueries to parent that were referenced in the subqueries,
! * but we need to make sure that all non-referenced ones are copied as
! * well. They are needed for permission checks during executor startup
! * (ExecCheckRTPerms).
! */
! i = 1;
! foreach(l, subquery->rtable)
! {
! if (!bms_is_member(i, pulledUpRtes))
! {
! RangeTblEntry *rte = rt_fetch(i, subquery->rtable);
! root->parse->rtable = lappend(root->parse->rtable, rte);
! }
! i++;
! }

/*
* Mark the parent as an append relation.
***************
*** 501,510 ****
* is where to look up the RTE if setOp is a RangeTblRef. This is *not* the
* same as root->parse, which is the top-level Query we are pulling up into.
* parentRTindex is the appendrel parent's index in root->parse->rtable.
*/
static void
pull_up_union_leaf_queries(Node *setOp, PlannerInfo *root, int parentRTindex,
! Query *setOpQuery)
{
if (IsA(setOp, RangeTblRef))
{
--- 523,534 ----
* is where to look up the RTE if setOp is a RangeTblRef. This is *not* the
* same as root->parse, which is the top-level Query we are pulling up into.
* parentRTindex is the appendrel parent's index in root->parse->rtable.
+ * pulledUpRtes is a bitmap of those range table entries in setOpQuery that
+ * have already been copied to the parent
*/
static void
pull_up_union_leaf_queries(Node *setOp, PlannerInfo *root, int parentRTindex,
! Query *setOpQuery, Bitmapset **pulledUpRtes)
{
if (IsA(setOp, RangeTblRef))
{
***************
*** 535,540 ****
--- 559,565 ----
*/
parse->rtable = lappend(parse->rtable, rte);
childRTindex = list_length(parse->rtable);
+ *pulledUpRtes = bms_add_member(*pulledUpRtes, rtr->rtindex);

/*
* Build a suitable AppendRelInfo, and attach to parent's list.
***************
*** 566,573 ****
SetOperationStmt *op = (SetOperationStmt *) setOp;

/* Recurse to reach leaf queries */
! pull_up_union_leaf_queries(op->larg, root, parentRTindex, setOpQuery);
! pull_up_union_leaf_queries(op->rarg, root, parentRTindex, setOpQuery);
}
else
{
--- 591,600 ----
SetOperationStmt *op = (SetOperationStmt *) setOp;

/* Recurse to reach leaf queries */
! pull_up_union_leaf_queries(op->larg, root, parentRTindex, setOpQuery,
! pulledUpRtes);
! pull_up_union_leaf_queries(op->rarg, root, parentRTindex, setOpQuery,
! pulledUpRtes);
}
else
{
Tom Lane wrote:
> I wrote:
>> That's one heck of a scary patch: nowhere in list_union's API is there
>> any guarantee that it preserves list ordering, but we *must not* change
>> the positions of the existing rtable entries.

Good point.

> Actually there's a more fundamental problem, namely that pulled-up
> subqueries aren't necessarily equal() to the originals. They will
> definitely be different if there were any uplevel Var references.

Another good point. I just saw that they're copied with copyObject and
are thus equal, but missed the IncrementVarSublevelsUp call.

> While you could argue that it doesn't matter because we'll only
> end up redundantly checking permissions on multiple copies of the
> RTEs, that's a bit beyond my threshold of ugliness...

Yeah, that wasn't the intention.

Attached is a patch with slightly different approach. Instead of
list_union, I'm keeping track of which rtes are copied by
pull_up_union_leaf_queries in a bitmapset.

BTW, I wonder if it's possible to end up with multiple copies of the
same RTE anyway, if there's multiple references to the same RTE. I'm
guessing that it's either not possible or we don't care, because that
can happen without the patch just as well.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Re: [HACKERS] Plugin system like Firefox

On Tue, Aug 12, 2008 at 4:13 AM, Bruce Momjian <bruce@momjian.us> wrote:
> So, ideally, if we do a plug-in system, I think we need some way to have
> these plugins be very easily installed, perhaps by choosing object files
> pre-compile by the build farm for each operating system.

Hmm, that idea sounds remarkably familiar <thinks back to a meeting in
NJ about 2 years ago>

:-)

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.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: [BUGS] BUG #4321: 8.3 installer shortens allowable BASE_DIR path length?

Yep, Magnus was working on pgInstaller bugs last night.

On Tue, Aug 12, 2008 at 4:43 AM, Bruce Momjian <bruce@momjian.us> wrote:
>
> Dave, Magnus, did you see this report?
>
> ---------------------------------------------------------------------------
>
> Bob Kuhfahl wrote:
>>
>> The following bug has been logged online:
>>
>> Bug reference: 4321
>> Logged by: Bob Kuhfahl
>> Email address: bobk@asg.com
>> PostgreSQL version: 8.3
>> Operating system: windows
>> Description: 8.3 installer shortens allowable BASE_DIR path length?
>> Details:
>>
>> We're a ISV using postgres in our product and we use the postgres silent
>> installer from with ours. We install postgres next to our product and the
>> path can be anywhere the user chooses. We're currently on 8.2 and looking
>> to upgrade to 8.3.
>> ---
>> * Testing found the following problem: Failed to retrieve the
>> 'CustomActionData' property whilst preparing to execute initdb.
>> ---
>> * This was a result of the following command line: MsiExec.exe /i
>> postgresql-8.3-int.msi /qb INTERNALLAUNCH=1 SERVICEDOMAIN=USRESXROBERTKU
>> SERVICEPASSWORD="asgp0stg3sq(l)" SERVICEACCOUNT=nispostgres
>> SERVICENAME="asg postgresql" SUPERUSER=postgres SUPERPASSWORD=naviplex
>> CREATESERVICEUSER=1 LISTENPORT=5432 PERMITREMOTE=1
>> BASEDIR="C:\Program Files\ASG\Naviplex Integration
>> Services\postgresql-8.3.3-1" /l "postgres_install.log"
>> ---
>> * Putting L*v on the above, we find this in the log:
>> MSI (s) (CC:9C) [11:46:25:236]: Generating random cookie.
>> MSI (s) (CC:9C) [11:46:25:252]: Created Custom Action Server with PID 3336
>> (0xD08).
>> MSI (s) (CC:94) [11:46:25:330]: Running as a service.
>> MSI (s) (CC:3C) [11:46:25:330]: Hello, I'm your 32bit Elevated custom action
>> server.
>> MSI (s) (CC:70) [11:46:27:002]: Executing op:
>> ActionStart(Name=RunInitdb,Description=Initializing database cluster (this
>> may take a minute or two)...,)
>> MSI (s) (CC:70) [11:46:27:002]: Executing op:
>> CustomActionSchedule(Action=RunInitdb,ActionType=3073,Source=BinaryData,Targ
>> et=_RunInitdb@4,CustomActionData=1033;C:\Program Files\ASG\Naviplex
>> Integration Services\postgresql-8.3.3-1\;C:\Program Files\ASG\Naviplex
>> Integration Services\postgresql-8.3.3-1\data\;C:\Program Files\ASG\Naviplex
>> Integration
>> Services\postgresql-8.3.3-1\share\;5432;1;C;SQL_ASCII;postgres;naviplex;USRE
>> SXROBERTKU;nispostgres;asgp0stg3sq(l);;)
>> MSI (s) (CC:AC) [11:46:27:049]: Invoking remote custom action. DLL:
>> C:\WINDOWS\Installer\MSI60.tmp, Entrypoint: _RunInitdb@4
>> MSI (s) (CC!7C) [11:52:48:286]: Note: 1: 2205 2: 3: Error
>> MSI (s) (CC!7C) [11:52:48:286]: Note: 1: 2228 2: 3: Error 4: SELECT
>> `Message` FROM `Error` WHERE `Error` = 1709
>> MSI (s) (CC!7C) [11:52:48:380]: Product: PostgreSQL 8.3 -- Failed to
>> retrieve the 'CustomActionData' property whilst preparing to execute
>> initdb.
>> ---
>> * A code search indicates this changed when going from 1.103 to 1.104 of
>> pginstca.c
>> i.e.
>> http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/pginst/ca/pginstca.c
>> .diff?r1=1.103&r2=1.104&f=u
>> ============================================
>> It's not clear from the comments why this change was needed, but if someone
>> could change mybuf back to 8192 bytes (or something significantly more than
>> MAX_PATH+1 (which on windows is only 260)) - I think it would be a good
>> thing?
>> Regards,
>> Bob
>>
>> --
>> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-bugs
>
> --
> 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-bugs mailing list (pgsql-bugs@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
>

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

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

Re: [pgadmin-support] Vista Compatible

On Mon, Aug 11, 2008 at 10:21 PM, Ivan Prueitt <ivanp@phoenxgroup.com> wrote:
> Can I use pgadmin on vista Ultima?

Assuming you mean Vista Ultimate, then yes.

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

Monday, August 11, 2008

[pgsql-www] mailing list/newsgroup disconnect

I don't know if it is still going on, but last week there was a
disconnect between the general mailing list and the newsgroup. I was
getting emails responding to posts that were not getting into the
newsgroup. I believe every post to the newsgroup made it to the mailing
list.

Let me know what I can send you to help fix the problem, if it isn't
already taken care of.

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

Re: [PERFORM] Filesystem benchmarking for pg 8.3.3 server

On Mon, Aug 11, 2008 at 6:08 AM, Henrik <henke@mac.se> wrote:
> 11 aug 2008 kl. 12.35 skrev Glyn Astill:
>
>>>>
>>>>> It feels like there is something fishy going on.
>>>
>>> Maybe the RAID 10
>>>>>
>>>>> implementation on the PERC/6e is crap?
>>>>
>>
>> It's possible. We had a bunch of perc/5i SAS raid cards in our servers
>> that performed quite well in Raid 5 but were shite in Raid 10. I switched
>> them out for Adaptec 5808s and saw a massive improvement in Raid 10.
>
> I suspected that. Maybe I should just put the PERC/6 cards in JBOD mode and
> then make a RAID10 with linux software raid MD?

You can also try making mirror sets with the hardware RAID controller
and then doing SW RAID 0 on top of that. Since RAID0 requires little
or no CPU overhead, this is a good compromise because the OS has the
least work to do, and the RAID controller is doing what it's probably
pretty good at, mirror sets.

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

Re: [HACKERS] proposal: UTF8 to_ascii function

Pavel Stehule wrote:
>
>
> One note - convert_to is correct. But we have to use to_ascii without
> decode functions. It has same behave - convert from bytea to text.
> Text in "incorrect" encoding is dafacto bytea. So correct to_ascii
> function prototypes are:
>
> to_ascii(text)
> to_ascii(bytea, integer);
> to_ascii(bytea, name);
>
>
>>

What you have not said is how you propose to convert UTF8 to ASCII.

Currently to_ascii() converts a small number of single byte charsets to
ASCII by folding the chars with high bits set, so what we get is a pure
ASCII result which is safe in any server encoding, as they are all ASCII
supersets.

But what conversion rule will you use for the gazillions of Unicode
characters?

I honestly do not understand the use case for this at all.

cheers

andrew

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

Re: [NOVICE] join group by etc

Peter,

Well at least the below you have is more generic and will work for MySQL
and pretty much any relational database I can think of. I guess the
only issue is that if you use Max you are mixing records (since it
returns the max value for each field not the last record value). This
may be fine for your purposes, but something to think about.

FWIW: There is an easy way to get around the ordering issue of DISTINCT
ON and that is to wrap it in a subselect

SELECT * FROM
(SELECT DISTINCT ON(T1.iId) T1.*, T2.ttC, T3.tthD, toD as sort

FROM table_one T1 INNER JOIN

table_two T2 ON T1.iId = T2.iId INNER JOIN table_three T3 ON T3.fId =

T2.fId WHERE T1.tId = '9' and T1.toC = 'o'

ORDER BY T1.iId, toD) As result
ORDER BY sort;

Hope that helps,
Regina

-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org] On Behalf Of Peter Jackson
Sent: Saturday, August 09, 2008 2:42 AM
To: pgsql
Subject: Re: [NOVICE] join group by etc

Ok just a bit more info. Unfortunately DISTINCT ON didnt work after all
(once I started to get some more data into the tables and try different
sorts. Ended up having to select all fields and just use max(field1)
etc.
The reason I required this (which I didnt realise at the time) is that

the gui output can be sorted however you like. (and as DISTINCT ON
requires the field to be used as the first sort field it didnt work once

you decided to sort by anything but T1.iTd

The eventual output is:
T1.tOc T2.fId(24) T2.fId(25) T2.fId(26) T2.fId(27) T1.tOd
which when you click on the row brings up the rest of the record.

so whatever records that relate to t1.tId (which could be 4 or 400) are
displayed so the final outcome was

SELECT T1.iId,max(T1.tId),max(T1.toC) as status,max(T1.toD),max(T1.toE),

max(T2.ttC), max(T3.tthD), max(T1.toD) as sort FROM table_one T1 INNER
JOIN
table_two T2 ON T1.iId = T2.iId INNER JOIN table_three T3 ON T3.fId =
T2.fId WHERE T1.tId = '9' and T1.toC = 'o' GROUP BY T1.iId ORDER BY sort

Think I have explained that right. Anyway thanks for you help everyone.


-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.


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

Re: [pgadmin-hackers] Support of INHERIT in existing tables (8.2+ releases)

Dave Page a écrit :
> On Mon, Aug 11, 2008 at 1:50 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
> [...]
>>> The only thing that looks a little odd with this patch is that the Add
>>> button is always enabled, even if there is no table selected. That is
>>> actually the existing behaviour, but it's a little more obvious now
>>> the button is enabled when editing existing tables as well. Should we
>>> fix that? My gut feeling is yes.
>>>
>> hehe... I saw it but wasn't sure if I should work on that too :)
>>
>> Anyways, fixed.
>
> Cool, thanks. I'm not going to review it again - please apply.
>

Thanks, done :)


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

[pgadmin-hackers] SVN Commit by guillaume: r7398 - in trunk/pgadmin3: . pgadmin/dlg pgadmin/include/dlg pgadmin/include/schema pgadmin/schema

Author: guillaume

Date: 2008-08-11 14:01:25 +0100 (Mon, 11 Aug 2008)

New Revision: 7398

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

Log:
Support for adding/removing inherited tables with 8.2+ servers.

Modified:
trunk/pgadmin3/CHANGELOG
trunk/pgadmin3/pgadmin/dlg/dlgTable.cpp
trunk/pgadmin3/pgadmin/include/dlg/dlgTable.h
trunk/pgadmin3/pgadmin/include/schema/pgColumn.h
trunk/pgadmin3/pgadmin/include/schema/pgTable.h
trunk/pgadmin3/pgadmin/schema/pgColumn.cpp
trunk/pgadmin3/pgadmin/schema/pgTable.cpp

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

Re: [HACKERS] proposal: UTF8 to_ascii function

2008/8/11 Andrew Dunstan <andrew@dunslane.net>:
>
>
> Pavel Stehule wrote:
>>
>> Hello,
>>
>> combination functions to_ascii and convert_to is broken now. Problem
>> is in convert_to function. It doesn't support 8bit output encoding.
>>
>> Current workaround:
>>
>> CREATE FUNCTION to_ascii(bytea, name)
>> RETURNS text AS 'to_ascii_encname' LANGUAGE internal;
>>
>> SELECT to_ascii(convert_to('Příliš žlutý kůň', 'latin2'),'latin2');
>>
>> I don't expect column collate for 8.4, so we need to have workable
>> to_ascii function.
>>
>> I propose function to_ascii(text, name) that internally convert text
>> from utf8 encoding when it's necessary.cheers
>>
>>
>>
>
> convert_to is not broken. It returns a bytea, and it is up to you to
> de-escape it if you get the text representation.

One note - convert_to is correct. But we have to use to_ascii without
decode functions. It has same behave - convert from bytea to text.
Text in "incorrect" encoding is dafacto bytea. So correct to_ascii
function prototypes are:

to_ascii(text)
to_ascii(bytea, integer);
to_ascii(bytea, name);

Regards
Pavel Stehule
>
> We are surely not going to go back to a situation where we have functions
> returning text in any encoding other than the database encoding. That
> becomes a vehicle for storing wrongly encoded data in the database, and we
> have just gone through the exercise of plugging those holes. I privately
> predicted when we did this work that it might motivate people who had been
> abusing convert_to to get proper support for multiple encodings done. That
> is the right way to go, not re-opening holes we have just very deliberately
> plugged.
>
>
>
> cheers
>
> andrew
>

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

Re: [pgadmin-hackers] Support of INHERIT in existing tables (8.2+ releases)

On Mon, Aug 11, 2008 at 1:50 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:

> There's already 4 fixes for an 1.8.5. And this one.
>
> Moreover, 1.10 is not expected before PostgreSQL 8.4 (march 2009 IIRC). I
> think it would be better to have another 1.8. Not now, but there's still
> like 7 months to go before next release. Not sure we won't need another
> minor release.

<grumble>We rarely release in the second-half of the PG cycle. Still,
go ahead and backpatch if you like.

>> The only thing that looks a little odd with this patch is that the Add
>> button is always enabled, even if there is no table selected. That is
>> actually the existing behaviour, but it's a little more obvious now
>> the button is enabled when editing existing tables as well. Should we
>> fix that? My gut feeling is yes.
>>
>
> hehe... I saw it but wasn't sure if I should work on that too :)
>
> Anyways, fixed.

Cool, thanks. I'm not going to review it again - please apply.

--
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: [pgadmin-hackers] Support of INHERIT in existing tables (8.2+ releases)

Dave Page a écrit :
> On Sun, Aug 10, 2008 at 6:55 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>
>> Sorry to answer so late, it was a lot of work to get everything working.
>> Anyways, fixed.
>
> No worries. Got the following warning:
>
> ./dlg/dlgTable.cpp: In member function 'void
> dlgTable::OnAddTable(wxCommandEvent&)':
> ./dlg/dlgTable.cpp:1021: warning: unused variable 'row'
>

Fixed.

>> Fixed in the same patch. Don't know if you want a backpatch for 1.8?
>
> Thanks. I don't expect we're ever going to release another 1.8 - do you?
>

There's already 4 fixes for an 1.8.5. And this one.

Moreover, 1.10 is not expected before PostgreSQL 8.4 (march 2009 IIRC).
I think it would be better to have another 1.8. Not now, but there's
still like 7 months to go before next release. Not sure we won't need
another minor release.

> The only thing that looks a little odd with this patch is that the Add
> button is always enabled, even if there is no table selected. That is
> actually the existing behaviour, but it's a little more obvious now
> the button is enabled when editing existing tables as well. Should we
> fix that? My gut feeling is yes.
>

hehe... I saw it but wasn't sure if I should work on that too :)

Anyways, fixed.

New patch available at:
http://developer.pgadmin.org/~guillaume/inherit82+_20080811.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: [HACKERS] Proposal: PageLayout footprint

Zdenek Kotala wrote:
> Similar is 32/64 bit compilation. It is handled on x86 by MAXALIGN but
> MAXALIGN is same on SPARC for both binaries, but I'm not sure if it
> works correctly.

Are 32/64-bit binaries on Sparc incompatible, then? Does our control
file check catch it? If not, what's causing it, and would the
--footprint switch catch it?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.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: [HACKERS] Skimming icc warnings on mongoose

Gregory Stark <stark@enterprisedb.com> writes:
> I happened to be skimming the compile warnings on mongoose, an icc buildfarm
> member and noticed two interesting warnings.
> ld: warning: creating a DT_TEXTREL in object.

> There are a few instances of this. I think it indicates we are either spelling
> -fpic wrong or including some .o object that was not compiled with -fpic
> (perhaps something from the ports directory?).

If it were the latter, quite a number of platforms would just fail
outright, I believe. As for spelling -fpic wrong, that seems unlikely
too considering that icc generally tries to pretend it's gcc.
Any other theories?

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

Re: [HACKERS] proposal: UTF8 to_ascii function

Hello

2008/8/11 Andrew Dunstan <andrew@dunslane.net>:
>
>
> Pavel Stehule wrote:
>>
>> Hello,
>>
>> combination functions to_ascii and convert_to is broken now. Problem
>> is in convert_to function. It doesn't support 8bit output encoding.
>>
>> Current workaround:
>>
>> CREATE FUNCTION to_ascii(bytea, name)
>> RETURNS text AS 'to_ascii_encname' LANGUAGE internal;
>>
>> SELECT to_ascii(convert_to('Příliš žlutý kůň', 'latin2'),'latin2');
>>
>> I don't expect column collate for 8.4, so we need to have workable
>> to_ascii function.
>>
>> I propose function to_ascii(text, name) that internally convert text
>> from utf8 encoding when it's necessary.cheers
>>
>>
>>
>
> convert_to is not broken. It returns a bytea, and it is up to you to
> de-escape it if you get the text representation.
>

ok, I talked about combination convert_to and to_ascii. to_ascii
doesn't support bytea, what is probably correct. We cannot use
descape, because it remove 8bit. This issue was noticed more times -
http://archives.postgresql.org/pgsql-general/2008-06/msg00495.php


> We are surely not going to go back to a situation where we have functions
> returning text in any encoding other than the database encoding. That
> becomes a vehicle for storing wrongly encoded data in the database, and we
> have just gone through the exercise of plugging those holes. I privately
> predicted when we did this work that it might motivate people who had been
> abusing convert_to to get proper support for multiple encodings done. That
> is the right way to go, not re-opening holes we have just very deliberately
> plugged.
>

to_ascii isn't related to multiple encodings. And actually there is
only one man who works on it. We will be happy for database collation
in 8.4. So without any change this feature will be broken more than
two years.

Regards
Pavel

>
>
> cheers
>
> andrew

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

[HACKERS] Skimming icc warnings on mongoose

I happened to be skimming the compile warnings on mongoose, an icc buildfarm
member and noticed two interesting warnings.

----------------------------------------------------------------
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I../../../src/include/snowball -I../../../src/include/snowball/libstemmer -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o stem_UTF_8_swedish.o ./libstemmer/stem_UTF_8_swedish.c
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I../../../src/include/snowball -I../../../src/include/snowball/libstemmer -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o stem_UTF_8_turkish.o ./libstemmer/stem_UTF_8_turkish.c
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -shared dict_snowball.o api.o utilities.o stem_ISO_8859_1_danish.o stem_ISO_8859_1_dutch.o stem_ISO_8859_1_english.o stem_ISO_8859_1_finnish.o stem_ISO_8859_1_french.o stem_ISO_8859_1_german.o stem_ISO_8859_1_hungarian.o stem_ISO_8859_1_italian.o stem_ISO_8859_1_norwegian.o stem_ISO_8859_1_porter.o stem_ISO_8859_1_portuguese.o stem_ISO_8859_1_spanish.o stem_ISO_8859_1_swedish.o stem_ISO_8859_2_romanian.o stem_KOI8_R_russian.o stem_UTF_8_danish.o stem_UTF_8_dutch.o stem_UTF_8_english.o stem_UTF_8_finnish.o stem_UTF_8_french.o stem_UTF_8_german.o stem_UTF_8_hungarian.o stem_UTF_8_italian.o stem_UTF_8_norwegian.o stem_UTF_8_porter.o stem_UTF_8_portuguese.o stem_UTF_8_romanian.o stem_UTF_8_russian.o stem_UTF_8_spanish.o stem_UTF_8_swedish.o stem_UTF_8_turkish.o -L../../../src/port -o dict_snowball.so
ld: warning: creating a DT_TEXTREL in object.
----------------------------------------------------------------

There are a few instances of this. I think it indicates we are either spelling
-fpic wrong or including some .o object that was not compiled with -fpic
(perhaps something from the ports directory?).

This can result in a performance drain when the .so is linked in since the
text segment can't be mapped directly from the file and instead needs to be
read in and adjusted to the base address to which it was loaded.

It isn't unique to tsearch stuff either, plpgsql has the same warning:

----------------------------------------------------------------
make[4]: Entering directory `/home/data/local/jeremyd/postgres/buildfarm/root/HEAD/pgsql.4376/src/pl/plpgsql/src'
bison -y -d gram.y
mv -f y.tab.c ./pl_gram.c
mv -f y.tab.h ./pl.tab.h
LC_CTYPE=C /usr/bin/flex -o'pl_scan.c' scan.l
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I. -I../../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o pl_gram.o pl_gram.c
pl_scan.c(1944) : (col. 2) remark: LOOP WAS VECTORIZED.
pl_scan.c(2495) : (col. 2) remark: LOOP WAS VECTORIZED.
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I. -I../../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o pl_handler.o pl_handler.c
pl_handler.c(199) : (col. 3) remark: LOOP WAS VECTORIZED.
pl_handler.c(200) : (col. 3) remark: LOOP WAS VECTORIZED.
pl_handler.c(206) : (col. 4) remark: LOOP WAS VECTORIZED.
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I. -I../../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o pl_comp.o pl_comp.c
pl_comp.c(157) : (col. 3) remark: LOOP WAS VECTORIZED.
pl_comp.c(211) : (col. 4) remark: LOOP WAS VECTORIZED.
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I. -I../../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o pl_exec.o pl_exec.c
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I. -I../../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o pl_funcs.o pl_funcs.c
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -shared pl_gram.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o -L../../../../src/port -o plpgsql.so
ld: warning: creating a DT_TEXTREL in object.
----------------------------------------------------------------


And then there's this -- plen is a size_t...

plpython.c(1420): warning #186: pointless comparison of unsigned integer with zero
Assert(plen >= 0 && plen < mlen);


--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

--
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] Proposal: PageLayout footprint

Heikki Linnakangas napsal(a):
> Zdenek Kotala wrote:
>> By my opinion -fipa-struct-reorg GCC option could break structure.
>
> That option would probably break a lot of things. Like our
> "variable-sized array as last field of a struct" hacks.

Yes, it is extreme case.

>> And maybe there are more compiler magic switches and optimization on
>> different platforms which can modify structure alignment or member
>> order. It probably does not happen often but footprint should protect
>> people to shot himself.
>
> We depend on a certain member order and alignment rules. If we're
> worried about that, we should add checks in configure instead, to barf
> if you try to use such options.
>

You are able to check order, but you cannot complain about structure member
alignment during configure time. But if you have two binaries which you get from
two sources then you need to verify that both binaries has same structure footprint.

Similar is 32/64 bit compilation. It is handled on x86 by MAXALIGN but MAXALIGN
is same on SPARC for both binaries, but I'm not sure if it works correctly.

Any other usage is to protect developers to make a mistake and break silently
compatibility, but it should be caught by --footprint switch.

Zdenek

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

[pgadmin-support] run-away query

I am running a query in PGAdmin.
I changed the storage on a bytea field from External to Main and then ran
update dbmail_messageblks set messageblk=messageblk || '';
so that it would move all the rows to the new storage.
This is a very large table, so I actually expect it to take a long time.
The table has approximately 200,000 rows

select max(length(messageblk)),avg(length(messageblk)) from
dbmail_messageblks
MAX AVG
532259; 48115.630147120314

The query has been running for 6.5 hours now and in the status bar of
the query tool it says "Query is running" and the count in ms is still
running.

I had checked a number of times using select * from pg_stat_activity and
it was in there and running. The last time I checked the query was not
listed in pg_stat_activity. In fact There is no row for that window. I
have 3 windows open for that database, the one running the query, the
one I queried pg_stat_activity from and another one.
When I query pg_stat_activity it shows 2 rows for my ip address, the
pg_stat_activity and an IDLE row. When I close the other window it only
shows one row for my IP address.

I also checked in Linux PS - my IP address only shows up in ps aux for
the other windows, not for this 6.5 hour query.

Is there any way to check what is going on?

Thank you
Sim

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

Re: [HACKERS] proposal: UTF8 to_ascii function

Pavel Stehule wrote:
> Hello,
>
> combination functions to_ascii and convert_to is broken now. Problem
> is in convert_to function. It doesn't support 8bit output encoding.
>
> Current workaround:
>
> CREATE FUNCTION to_ascii(bytea, name)
> RETURNS text AS 'to_ascii_encname' LANGUAGE internal;
>
> SELECT to_ascii(convert_to('Příliš žlutý kůň', 'latin2'),'latin2');
>
> I don't expect column collate for 8.4, so we need to have workable
> to_ascii function.
>
> I propose function to_ascii(text, name) that internally convert text
> from utf8 encoding when it's necessary.cheers
>
>
>

convert_to is not broken. It returns a bytea, and it is up to you to
de-escape it if you get the text representation.

We are surely not going to go back to a situation where we have
functions returning text in any encoding other than the database
encoding. That becomes a vehicle for storing wrongly encoded data in the
database, and we have just gone through the exercise of plugging those
holes. I privately predicted when we did this work that it might
motivate people who had been abusing convert_to to get proper support
for multiple encodings done. That is the right way to go, not re-opening
holes we have just very deliberately plugged.

cheers

andrew

--
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] Using PK value as a String

On Aug 11, 2008, at 4:30 AM, Gregory Stark wrote:

> "Jay" <arrival123@gmail.com> writes:
>
>> I have a table named table_Users:
>>
>> CREATE TABLE table_Users (
>> UserID character(40) NOT NULL default '',
>> Username varchar(256) NOT NULL default '',
>> Email varchar(256) NOT NULL default ''
>> etc...
>> );
>>
>> The UserID is a character(40) and is generated using UUID function.
>> We
>> started making making other tables and ended up not really using
>> UserID, but instead using Username as the unique identifier for the
>> other tables. Now, we pass and insert the Username to for
>> discussions,
>> wikis, etc, for all the modules we have developed. I was wondering if
>> it would be a performance improvement to use the 40 Character UserID
>> instead of Username when querying the other tables, or if we should
>> change the UserID to a serial value and use that to query the other
>> tables. Or just keep the way things are because it doesn't really
>> make
>> much a difference.
>
> Username would not be any slower than UserID unless you have a lot of
> usernames longer than 40 characters.
>
> However making UserID an integer would be quite a bit more
> efficient. It would
> take 4 bytes instead of as the length of the Username which adds up
> when it's
> in all your other tables... Also internationalized text collations
> are quite a
> bit more expensive than a simple integer comparison.
>
> But the real question here is what's the better design. If you use
> Username
> you'll be cursing if you ever want to provide a facility to allow
> people to
> change their usernames. You may not want such a facility now but one
> day...
>

If you generate UUID's with the UUID function and you are on 8.3,
why not use the UUID type to store it?

Ries


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

Ries van Twisk
tags: Freelance TYPO3 Glassfish JasperReports JasperETL Flex Blaze-DS
WebORB PostgreSQL DB-Architect
email: ries@vantwisk.nl
web: http://www.rvantwisk.nl/
skype: callto://r.vantwisk


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

Re: [HACKERS] Proposal: PageLayout footprint

Gregory Stark wrote:
> "Zdenek Kotala" <Zdenek.Kotala@Sun.COM> writes:
>> By my opinion -fipa-struct-reorg GCC option could break structure. And maybe
>> there are more compiler magic switches and optimization on different platforms
>> which can modify structure alignment or member order. It probably does not
>> happen often but footprint should protect people to shot himself.
>
> My version of GCC doesn't have that option, what does it do?

From gcc man page:

> -fipa-struct-reorg
> Perform structure reorganization optimization, that change C-like
> structures layout in order to better utilize spatial locality.
> This transformation is affective for programs containing arrays of
> structures. Available in two compilation modes: profile-based
> (enabled with -fprofile-generate) or static (which uses built-in
> heuristics). Require -fipa-type-escape to provide the safety of
> this transformation. It works only in whole program mode, so it
> requires -fwhole-program and -combine to be enabled. Structures
> considered cold by this transformation are not affected (see
> --param struct-reorg-cold-struct-ratio=value).

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

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

[COMMITTERS] stackbuilder - wizard: Allow apps to be targetting at specific

Log Message:
-----------
Allow apps to be targetting at specific platforms.

Modified Files:
--------------
wizard:
App.cpp (r1.22 -> r1.23)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/stackbuilder/wizard/App.cpp.diff?r1=1.22&r2=1.23)
AppList.cpp (r1.15 -> r1.16)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/stackbuilder/wizard/AppList.cpp.diff?r1=1.15&r2=1.16)
CMakeLists.txt (r1.5 -> r1.6)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/stackbuilder/wizard/CMakeLists.txt.diff?r1=1.5&r2=1.6)
wizard/include:
App.h (r1.10 -> r1.11)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/stackbuilder/wizard/include/App.h.diff?r1=1.10&r2=1.11)

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

Re: [PERFORM] Filesystem benchmarking for pg 8.3.3 server

11 aug 2008 kl. 12.35 skrev Glyn Astill:

>>>
>>>> It feels like there is something fishy going on.
>> Maybe the RAID 10
>>>> implementation on the PERC/6e is crap?
>>>
>
> It's possible. We had a bunch of perc/5i SAS raid cards in our
> servers that performed quite well in Raid 5 but were shite in Raid
> 10. I switched them out for Adaptec 5808s and saw a massive
> improvement in Raid 10.
I suspected that. Maybe I should just put the PERC/6 cards in JBOD
mode and then make a RAID10 with linux software raid MD?


>
>
>
> __________________________________________________________
> Not happy with your email address?.
> Get the one you really want - millions of new email addresses
> available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org
> )
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance


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

Re: [HACKERS] Proposal: PageLayout footprint

"Zdenek Kotala" <Zdenek.Kotala@Sun.COM> writes:

> By my opinion -fipa-struct-reorg GCC option could break structure. And maybe
> there are more compiler magic switches and optimization on different platforms
> which can modify structure alignment or member order. It probably does not
> happen often but footprint should protect people to shot himself.

My version of GCC doesn't have that option, what does it do?

If structure members aren't in the order they're defined and padded to the
alignment they're declared to have in pg_type then Postgres catalogs won't
work anyways.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's RemoteDBA services!

--
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] Proposal: PageLayout footprint

Zdenek Kotala wrote:
> By my opinion -fipa-struct-reorg GCC option could break structure.

That option would probably break a lot of things. Like our
"variable-sized array as last field of a struct" hacks.

> And
> maybe there are more compiler magic switches and optimization on
> different platforms which can modify structure alignment or member
> order. It probably does not happen often but footprint should protect
> people to shot himself.

We depend on a certain member order and alignment rules. If we're
worried about that, we should add checks in configure instead, to barf
if you try to use such options.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.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: [GENERAL] compiling Xpath functions in PostgreSQL 8.3.3

Am Wednesday, 6. August 2008 schrieb sagswe:
> When i run ' \i  /usr/local/pgsql/share/pgxml.sql' in postgre , I get error
> saying file or directory named 'MODULE_PATHNAME' doesn't exist. How to get
> this MODULE_PATHNAME exist?.

This sounds like your installation is botched? How did you install this?

--
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] problem using a xpath function

Am Wednesday, 6. August 2008 schrieb erithema:>
> SELECT id_autori , xpath ('/Authority/Nome', testo)
> FROM autori
> WHERE xpath_bool('/Authority[Nome="ABELARDO"]', testo) ;
>
> I get this error:
> ERROR : the function xpath_bool(unknown , xml) do not exsist at character
> 69 HINT: no function matches the given name and argument types. You might
> need to add explicit type casts

The xpath_bool function takes its XML data as type text. The new xpath()
function uses the XML type. Those are two different sets of functions.

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

[pgsql-it-generale] == Postgres Weekly News - 10 agosto 2008 ==

== Postgres News prodotti ==

Rilasciato BitNami LAPPStack 1.0
http://bitnami.org/stack/lappstack

Rilasciato pgbouncer 1.2.3
http://pgfoundry.org/projects/pgbouncer/

Rilasciato phpPgAdmin 4.2.1
http://sourceforge.net/project/showfiles.php?group_id=37132

Rilasciato PyReplica 1.0.3
http://pgfoundry.org/projects/pyreplica/

Rilasciato Another PostgreSQL Diff Tool 1.2
http://pgfoundry.org/projects/apgdiff/

Rilasciato pgSphere 1.0.1
http://pgfoundry.org/projects/pgsphere/

Rilasciato PostgreSQL Toolbox 1
http://pgfoundry.org/projects/pg-toolbox/

== Offerte di lavoro legate a PostgreSQL per il mese di Agosto ==
http://archives.postgresql.org/pgsql-jobs/2008-08/threads.php

== PostgreSQL news locali ==

Il Prato Linux User Group terrà dei talk su PostgreSQL talks a Settembre.
Il calendario in italiano si trova all'url:
http://www.prato.linux.it/serate_a_tema_2008

Il PGCon Brasile 2008 ci sara' il 26 e 27 settembre 2008 a Unicamp, Campinas.
http://pgcon.postgresql.org.br/index.en.html

Il PgDay.fr ci sarà il 4 ottobrea a Toulouse. Il Call for Papers è aperto:
http://www.postgresqlfr.org/?q=node/1686
Per registrarsi:
http://www.pgday.fr/doku.php/inscription

Sponsorizzate il PGDay Europeo!
http://www.pgday.org/en/sponsors/campaign

E' iniziato il call for papers per il PGDay europeo.
http://www.pgday.org/en/call4papers

Il PGDay.(IT|EU) 2008 ci sarà il 17 e 18 ottobre a Prato.
http://www.pgday.org/it/

== News su PostgreSQL ==

Planet PostgreSQL: http://www.planetpostgresql.org/

General Bits, archivi e nuovi articoli occasionali:
http://www.varlena.com/GeneralBits/

PostgreSQL Weekly News è stato spedito questa settimana grazie a David
Fetter e Devrim GUNDUZ.

Per segnalare news e annunci invia un email in inglese entro le ore 15,
fuso orario della costa orientale degli U.S.A, di domenica.

Per segnalazioni in inglese david@fetter.org, per segnalazioni in
Tedesco pwn@pgug.de, per segnalazioni in italiano pwn@itpug.org


== Patch applicate ==
Tom Lane committed:

- Improve CREATE/DROP/RENAME DATABASE so that when failing because the
source or target database is being accessed by other users, it tells
you whether the "other users" are live sessions or uncommitted
prepared transactions. (Indeed, it tells you exactly how many of
each, but that's mostly just because it was easy to do so.) This
should help forestall the gotcha of not realizing that a prepared
transaction is what's blocking the command. Per discussion.

- Improve SELECT DISTINCT to consider hash aggregation, as well as
sort/uniq, as methods for implementing the DISTINCT step. This
eliminates the former performance gap between DISTINCT and GROUP BY,
and also makes it possible to do SELECT DISTINCT on datatypes that
only support hashing not sorting. SELECT DISTINCT ON is still
always implemented by sorting; it would take executor changes to
support hashing that, and it's not clear it's worth the trouble.
This is a release-note-worthy incompatibility from previous PG
versions, since SELECT DISTINCT can no longer be counted on to
deliver sorted output without explicitly saying ORDER BY. (Anyone
who can't cope with that can consider turning off enable_hashagg.)
Several regression test queries needed to have ORDER BY added to
preserve stable output order. I fixed the ones that manifested
here, but there might be some other cases that show up on other
platforms.

- In pgsql/src/test/regress/pg_regress.c, fix some message style
guideline violations in pg_regress, as well as some failures to
expose messages for translation.

- In pgsql/src/backend/storage/buffer/bufmgr.c, in ReadOrZeroBuffer
(and related entry points), don't bother to call PageHeaderIsValid
when we zero the buffer instead of reading the page in. The actual
performance improvement is probably marginal since this function
isn't very heavily used, but a cycle saved is a cycle earned Zdenek
Kotala

- Add an ORDER BY to one more SELECT DISTINCT test case, per buildfarm
results.

- In pgsql/src/backend/optimizer/plan/planner.c, department of second
thoughts: fix newly-added code in planner.c to make real sure that
DISTINCT ON does what it's supposed to, ie, sort by the full ORDER
BY list before unique-ifying. The error seems masked in simple
cases by the fact that query_planner won't return query pathkeys
that only partially match the requested sort order, but I wouldn't
want to bet that it couldn't be exposed in some way or other.

- Do not allow Unique nodes to be scanned backwards. The code claimed
that it would work, but in fact it didn't return the same rows when
moving backwards as when moving forwards. This would have no
visible effect in a DISTINCT query (at least assuming the column
datatypes use a strong definition of equality), but it gave entirely
wrong answers for DISTINCT ON queries.

- Teach the system how to use hashing for UNION. (INTERSECT/EXCEPT
will follow, but seem like a separate patch since most of the
remaining work is on the executor side.) I took the opportunity to
push selection of the grouping operators for set operations into the
parser where it belongs. Otherwise this is just a small exercise in
making prepunion.c consider both alternatives. As with the recent
DISTINCT patch, this means we can UNION on datatypes that can hash
but not sort, and it means that UNION without ORDER BY is no longer
certain to produce sorted output.

- Support hashing for duplicate-elimination in INTERSECT and EXCEPT
queries. This completes my project of improving usage of hashing
for duplicate elimination (aggregate functions with DISTINCT remain
undone, but that's for some other day). As with the previous
patches, this means we can INTERSECT/EXCEPT on datatypes that can
hash but not sort, and it means that INTERSECT/EXCEPT without ORDER
BY are no longer certain to produce sorted output.

- Improve INTERSECT/EXCEPT hashing by realizing that we don't need to
make any hashtable entries for tuples that are found only in the
second input: they can never contribute to the output. Furthermore,
this implies that the planner should endeavor to put first the
smaller (in number of groups) input relation for an INTERSECT.
Implement that, and upgrade prepunion's estimation of the number of
rows returned by setops so that there's some amount of sanity in the
estimate of which one is smaller.

- In pgsql/src/backend/executor/execMain.c, install checks in executor
startup to ensure that the tuples produced by an INSERT or UPDATE
will match the target table's current rowtype. In pre-8.3 releases
inconsistency can arise with stale cached plans, as reported by
Merlin Moncure. (We patched the equivalent hazard on the SELECT
side in Feb 2007; I'm not sure why we thought there was no risk on
the insertion side.) In 8.3 and HEAD this problem should be
impossible due to plan cache invalidation management, but it seems
prudent to make the check anyway. Back-patch as far as 8.0. 7.x
versions lack ALTER COLUMN TYPE, so there seems no way to abuse a
stale plan comparably.

- Fix corner-case bug introduced with HOT: if REINDEX TABLE pg_class
(or a REINDEX DATABASE including same) is done before a session has
done any other update on pg_class, the pg_class relcache entry was
left with an incorrect setting of rd_indexattr, because the
indexed-attributes set would be first demanded at a time when we'd
forced a partial list of indexes into the pg_class entry, and it
would remain cached after that. This could result in incorrect
decisions about HOT-update safety later in the same session. In
practice, since only pg_class_relname_nsp_index would be missed out,
only ALTER TABLE RENAME and ALTER TABLE SET SCHEMA could trigger a
problem. Per report and test case from Ondrej Jirman.

Magnus Hagander committed:

- Move pgstat.tmp into a temporary directory under $PGDATA named
pg_stat_tmp. This allows the use of a ramdrive (either through
mount or symlink) for the temporary file that's written every half
second, which should reduce I/O. On server shutdown/startup, the
file is written to the old location in the global directory, to
preserve data across restarts. Bump catversion since the $PGDATA
directory layout changed.

== Patch rigettate (per ora) ==
Nessuno è stato scontentato questa settimana :-)

== Patch in attesa ==

ITAGAKI Takahiro sent in a patch to user NDirectFileRead/Write
counters to get I/O counts in BufFile the module. These counters are
visible when log_statement_stats is on.

Pavel Stehule sent in a patch to implement GROUPING SETS.

Tom Lane sent in a patch to use hashes for set operations.

Martin Pihlak sent in a patch to make dropping and re-creating
functions work more nicely with plan invalidation.

Simon Riggs sent in a patch which adds a hook for stats plugins.

Abhijit Menon-Sen sent in a patch which extend has_table_privilege()
to include sequence information.

Robert Haas sent in a patch to implement CREATE OR REPLACE VIEW.

Simon Riggs sent two revisions of a patch to fix pg_stop_backup per
suggestion by Fujii Masao. pg_stop_backup now tests XLogArchiveCheckDone()
for both stopxlogfilename and history file and then stats the stop
WAL.

Marko Kreen sent in a patch to fix a security issue in dblink.

Alvaro Herrera sent in two revisions of a patch to make autovacuum
process TOAST tables separately from main tables.

Volkan YAZICI sent in three revisions of a patch to allow people to
increase the verbosity of set-returning functions.

David Wheeler sent in some touch-ups for his citext patch.

Euler Taveira de Oliveira sent in a patch which allows symlinking
statistics files at initdb time.

--
(all opinions expressed are my own)
Federico Campoli
PostgreSQL Consulting -> PGHost http://www.pghost.eu

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

Re: [HACKERS] Multiple anyelement types

He

2008/8/11 ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>:
> I'm working on improvements of orafce.
> http://pgfoundry.org/projects/orafce
>
> I found postgres supports only one type of anyelement at one time
> when I added nvl2() and decode(). I'd like to use multiple types of
> anyelement something like:
>
> template < typename Expr, typename Ret >
> CREATE FUNCTION nvl(Expr, Ret, Ret) RETURNS Ret
>
> template < typename Expr, typename Ret >
> CREATE FUNCTION decode(Expr, Expr, Ret, ..., Ret) RETURNS Ret
>
> I don't mean to propose the above C++-like syntax, but such feature
> is important to develop a generic porting tool. Two independent
> anyelements are enough for me, but three or more might be better
> for general use.
>

it's good idea - I though so 2 independent types are enough:
anyelement2, enyarray2. If you are C coder, you should use "any" type.

regards
Pavel Stehule

> What syntax is suitable for postgres? Comments welcome.
>
> Regards,
> ---
> ITAGAKI Takahiro
> NTT Open Source Software Center
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

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

[COMMITTERS] pgsql: Introduce the concept of relation forks.

Log Message:
-----------
Introduce the concept of relation forks. An smgr relation can now consist
of multiple forks, and each fork can be created and grown separately.

The bulk of this patch is about changing the smgr API to include an extra
ForkNumber argument in every smgr function. Also, smgrscheduleunlink and
smgrdounlink no longer implicitly call smgrclose, because other forks might
still exist after unlinking one. The callers of those functions have been
modified to call smgrclose instead.

This patch in itself doesn't have any user-visible effect, but provides the
infrastructure needed for upcoming patches. The additional forks envisioned
are a rewritten FSM implementation that doesn't rely on a fixed-size shared
memory block, and a visibility map to allow skipping portions of a table in
VACUUM that have no dead tuples.

Modified Files:
--------------
pgsql/src/backend/access/hash:
hashpage.c (r1.75 -> r1.76)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/hash/hashpage.c?r1=1.75&r2=1.76)
pgsql/src/backend/access/heap:
heapam.c (r1.261 -> r1.262)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/heap/heapam.c?r1=1.261&r2=1.262)
rewriteheap.c (r1.14 -> r1.15)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/heap/rewriteheap.c?r1=1.14&r2=1.15)
pgsql/src/backend/access/nbtree:
nbtsort.c (r1.116 -> r1.117)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/nbtree/nbtsort.c?r1=1.116&r2=1.117)
pgsql/src/backend/access/transam:
twophase.c (r1.44 -> r1.45)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/twophase.c?r1=1.44&r2=1.45)
xact.c (r1.264 -> r1.265)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xact.c?r1=1.264&r2=1.265)
xlog.c (r1.316 -> r1.317)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlog.c?r1=1.316&r2=1.317)
xlogutils.c (r1.57 -> r1.58)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlogutils.c?r1=1.57&r2=1.58)
pgsql/src/backend/catalog:
catalog.c (r1.77 -> r1.78)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/catalog.c?r1=1.77&r2=1.78)
heap.c (r1.336 -> r1.337)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/heap.c?r1=1.336&r2=1.337)
index.c (r1.301 -> r1.302)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/index.c?r1=1.301&r2=1.302)
pgsql/src/backend/commands:
tablecmds.c (r1.261 -> r1.262)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c?r1=1.261&r2=1.262)
pgsql/src/backend/postmaster:
bgwriter.c (r1.50 -> r1.51)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/bgwriter.c?r1=1.50&r2=1.51)
pgsql/src/backend/rewrite:
rewriteDefine.c (r1.127 -> r1.128)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/rewrite/rewriteDefine.c?r1=1.127&r2=1.128)
pgsql/src/backend/storage/buffer:
bufmgr.c (r1.236 -> r1.237)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/buffer/bufmgr.c?r1=1.236&r2=1.237)
localbuf.c (r1.80 -> r1.81)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/buffer/localbuf.c?r1=1.80&r2=1.81)
pgsql/src/backend/storage/smgr:
README (r1.5 -> r1.6)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/smgr/README?r1=1.5&r2=1.6)
md.c (r1.138 -> r1.139)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/smgr/md.c?r1=1.138&r2=1.139)
smgr.c (r1.110 -> r1.111)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/smgr/smgr.c?r1=1.110&r2=1.111)
pgsql/src/backend/utils/adt:
dbsize.c (r1.19 -> r1.20)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/dbsize.c?r1=1.19&r2=1.20)
pgsql/src/include/access:
heapam.h (r1.137 -> r1.138)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/heapam.h?r1=1.137&r2=1.138)
htup.h (r1.100 -> r1.101)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/htup.h?r1=1.100&r2=1.101)
xact.h (r1.94 -> r1.95)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/xact.h?r1=1.94&r2=1.95)
xlog_internal.h (r1.23 -> r1.24)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/xlog_internal.h?r1=1.23&r2=1.24)
xlogutils.h (r1.25 -> r1.26)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/xlogutils.h?r1=1.25&r2=1.26)
pgsql/src/include/catalog:
catalog.h (r1.40 -> r1.41)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catalog.h?r1=1.40&r2=1.41)
pgsql/src/include/postmaster:
bgwriter.h (r1.11 -> r1.12)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/postmaster/bgwriter.h?r1=1.11&r2=1.12)
pgsql/src/include/storage:
buf_internals.h (r1.97 -> r1.98)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/buf_internals.h?r1=1.97&r2=1.98)
bufmgr.h (r1.114 -> r1.115)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/bufmgr.h?r1=1.114&r2=1.115)
relfilenode.h (r1.15 -> r1.16)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/relfilenode.h?r1=1.15&r2=1.16)
smgr.h (r1.62 -> r1.63)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/smgr.h?r1=1.62&r2=1.63)

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

Re: [HACKERS] Proposal: PageLayout footprint

Heikki Linnakangas napsal(a):
> Zdenek Kotala wrote:
>> Current content of control file is insufficient to check if database
>> is compatible with postgres server.
>
> It is? Do you have an example of where it's insufficient?
>

Current control file contain following information (related to page layout):

maxAlign
blcksz
toast_max_chunk_size

But you don't have control how aligned is each member of data structure.

By my opinion -fipa-struct-reorg GCC option could break structure. And maybe
there are more compiler magic switches and optimization on different platforms
which can modify structure alignment or member order. It probably does not
happen often but footprint should protect people to shot himself.

Zdenek

PS: And of course toast_max_chunk_size is not insufficient as well. There are
more constants like MaxHeapTupleSize and so on, but it is different story.

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

Re: [BUGS] BUG #3818: Cross compilation problems

Am Saturday, 9. August 2008 schrieb Richard Evans:
> I've made a couple of patches, for 8.3.3 and 8.2.9, which enable cross
> compilation for windows (mingw32) from a unix platform.

This looks good, with a couple of tweaks. I don't think we are going to be
making these kinds of changes in the 8.2 and 8.3 branches, so I suggest you
prepare a patch for 8.4. Some of the makefiles have changed, so a bit of
work might be involved.

> 2. in various makefiles, checking BUILDOS not PORTNAME when deciding
> whether to use 'pwd -W' or just 'pwd'

I was wondering, what is the difference between these? And couldn't we just
use $(CURDIR) instead?

> 5. Working round a binutils-2.18 bug in windres when the rc file has /
> or \ in the path

What is the status of this bug? Shouldn't it be fixed instead?

--
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] BUG #4344: initdb -L timezone directory

Am Thursday, 7. August 2008 schrieb Tom Lane:
> I rather wonder whether -L has any reason to live at all. initdb's
> default is to locate PGSHAREDIR relative to where it finds the backend
> executable, which is consistent with what the backend itself is going
> to do. Is there any scenario where specifying a different location
> wouldn't be broken?

I think the -L option only exists for legacy reasons.

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

Re: [PERFORM] Filesystem benchmarking for pg 8.3.3 server

> >
> >> It feels like there is something fishy going on.
> Maybe the RAID 10
> >> implementation on the PERC/6e is crap?
> >

It's possible. We had a bunch of perc/5i SAS raid cards in our servers that performed quite well in Raid 5 but were shite in Raid 10. I switched them out for Adaptec 5808s and saw a massive improvement in Raid 10.


__________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html

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

[COMMITTERS] stackbuilder - wizard: Pass the installer platform name to StackBuilder

Log Message:
-----------
Pass the installer platform name to StackBuilder

Modified Files:
--------------
wizard:
CMakeLists.txt (r1.4 -> r1.5)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/stackbuilder/wizard/CMakeLists.txt.diff?r1=1.4&r2=1.5)

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

[PERFORM] 答复: [PERFORM] Using PK value as a String

If UserID just be unique internal key and the unique id of other tables, I'd
like sequence, which is unique and just use 8 bytes(bigint) When it querying
other tables, it will faster , and disk space smaller than UUID(40 bytes).

莫建祥
阿里巴巴软件(上海)有限公司
研发中心-IM服务端开发部
联系方式:86-0571-85022088-13072
贸易通ID:jaymo 淘宝ID:jackem
公司网站:www.alisoft.com
wiki:http://10.0.32.21:1688/confluence/pages/viewpage.action?pageId=10338

-----邮件原件-----
发件人: pgsql-performance-owner@postgresql.org
[mailto:pgsql-performance-owner@postgresql.org] 代表 Jay
发送时间: 2008年8月11日 15:35
收件人: pgsql-performance@postgresql.org
主题: [PERFORM] Using PK value as a String

I have a table named table_Users:

CREATE TABLE table_Users (
UserID character(40) NOT NULL default '',
Username varchar(256) NOT NULL default '',
Email varchar(256) NOT NULL default ''
etc...
);

The UserID is a character(40) and is generated using UUID function. We
started making making other tables and ended up not really using
UserID, but instead using Username as the unique identifier for the
other tables. Now, we pass and insert the Username to for discussions,
wikis, etc, for all the modules we have developed. I was wondering if
it would be a performance improvement to use the 40 Character UserID
instead of Username when querying the other tables, or if we should
change the UserID to a serial value and use that to query the other
tables. Or just keep the way things are because it doesn't really make
much a difference.

We are still in development and its about half done, but if there is
going to be performance issues because using PK as a String value, we
can just take a day change it before any production as been started.
Anyway advice you can give would be much appreciated.

Postgres performance guru where are you?

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


--
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] Using PK value as a String

--- On Mon, 11/8/08, Gregory Stark <stark@enterprisedb.com> wrote:

> From: Gregory Stark <stark@enterprisedb.com>
> Subject: Re: [PERFORM] Using PK value as a String
> To: "Jay" <arrival123@gmail.com>
> Cc: pgsql-performance@postgresql.org
> Date: Monday, 11 August, 2008, 10:30 AM
> "Jay" <arrival123@gmail.com> writes:
>
> > I have a table named table_Users:
> >
> > CREATE TABLE table_Users (
> > UserID character(40) NOT NULL default
> '',
> > Username varchar(256) NOT NULL default
> '',
> > Email varchar(256) NOT NULL default
> ''
> > etc...
> > );
> >
> > The UserID is a character(40) and is generated using
> UUID function. We
> > started making making other tables and ended up not
> really using
> > UserID, but instead using Username as the unique
> identifier for the
> > other tables. Now, we pass and insert the Username to
> for discussions,
> > wikis, etc, for all the modules we have developed. I
> was wondering if
> > it would be a performance improvement to use the 40
> Character UserID
> > instead of Username when querying the other tables, or
> if we should
> > change the UserID to a serial value and use that to
> query the other
> > tables. Or just keep the way things are because it
> doesn't really make
> > much a difference.
>
> Username would not be any slower than UserID unless you
> have a lot of
> usernames longer than 40 characters.
>
> However making UserID an integer would be quite a bit more
> efficient. It would
> take 4 bytes instead of as the length of the Username which
> adds up when it's
> in all your other tables... Also internationalized text
> collations are quite a
> bit more expensive than a simple integer comparison.
>
> But the real question here is what's the better design.
> If you use Username
> you'll be cursing if you ever want to provide a
> facility to allow people to
> change their usernames. You may not want such a facility
> now but one day...
>

I don't understand Gregory's suggestion about the design. I thought using natural primary keys as opposed to surrogate ones is a better design strategy, even when it comes to performance considerations and even more so if there are complex relationships within the database.

Regards,
Valentin


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


__________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html

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

[HACKERS] Multiple anyelement types

I'm working on improvements of orafce.
http://pgfoundry.org/projects/orafce

I found postgres supports only one type of anyelement at one time
when I added nvl2() and decode(). I'd like to use multiple types of
anyelement something like:

template < typename Expr, typename Ret >
CREATE FUNCTION nvl(Expr, Ret, Ret) RETURNS Ret

template < typename Expr, typename Ret >
CREATE FUNCTION decode(Expr, Expr, Ret, ..., Ret) RETURNS Ret

I don't mean to propose the above C++-like syntax, but such feature
is important to develop a generic porting tool. Two independent
anyelements are enough for me, but three or more might be better
for general use.

What syntax is suitable for postgres? Comments welcome.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


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