Saturday, July 5, 2008

Re: [GENERAL] Target lists can have at most 1664 entries?

On Wed, Jul 02, 2008 at 09:22:50AM +0200, Bjørn T Johansen wrote:
> On Wed, 02 Jul 2008 03:04:04 -0400
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > =?UTF-8?Q?Bj=C3=B8rn?= T Johansen <btj@havleik.no> writes:
> > > What does this mean and how can it be fixed?
> >
> > Reduce the number of columns in your SELECTs?
> >
> > This whiffs to me of excruciatingly bad schema design. How could
> > you possibly need upwards of a thousand columns in a query result?
> > IMHO reasonable column counts are O(10), not O(bignum).
>
> Well, I do agree but it is not my design and a "fix" in PostgreSQL
> would be quicker than fixing the design....

That's where you're badly mistaken. Your application is completely
broken, and trying to adjust everybody else's Postgres to accommodate
*your* broken application is both selfish and short-sighted. It's
selfish because you're asking others to do work they don't need to do
just so you can avoid doing work you need to do, and it's
short-sighted because your application is guaranteed to be broken in
lots of other ways if it's broken this way.

Fix the application, and if you can't, find another job where they're
not being idiots. There are plenty of Postgres-related jobs out
there.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

--
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] PATCH: CITEXT 2.0

"David E. Wheeler" <david@kineticode.com> writes:
>>> Also OPERATOR || has probably wrong negator.
>>
>> Right, good catch.

> Stupid question: What would the negation of || actually be? There
> isn't one is, there?

Per the docs, NEGATOR is only sensible for operators returning boolean.

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: [GENERAL] [Postgresql 8.2.3] autovacuum starting up even after disabling ?

dushy <dushyanth@gmail.com> writes:
> On Fri, Jul 4, 2008 at 10:56 PM, Adrian Klaver <aklaver@comcast.net> wrote:
>> One question? Did you do pg_ctl reload after changing the config file?

> I did not change any config yet - autovacuum was always disabled since
> the day PG was set up.

A mistake here seems by far the most likely explanation. Does
"show autovacuum" confirm that it's off?

regards, tom lane

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

Re: [PATCHES] Explain XML patch v2

On Sat, Jul 5, 2008 at 10:41 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
>
> It can be optional since plugins can add parameters also.

GUCs I assume you mean, not grammar. Unless I'm misreading the code
though, if the plugin is there it will always run instead of the
regular explain code, so presumabiy that's optional as in XML or
nothing, not XML or standard output.

> It wouldn't take long to make up a plugin for 8.3 once this patch has
> been committed to core for 8.4, so if you're saying you'd definitely
> like it in core then I'm OK with that.

If i's always there it's definitely more useful to pgAdmin, and
doesn't require that we instruct users to install more server side
plugin code to use the features they want.

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

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

Re: [PATCHES] pgbench minor fixes

On Sun, 6 Jul 2008, Russell Smith wrote:

> Simon Riggs wrote:
>> Minor patch on pgbench
>>
>> 1. -i option should run vacuum analyze only on pgbench tables, not *all*
>> tables in database.
>>
> How does this work with custom scripts?

That's the initialization step. It creates the 4 tables, populates then,
then runs VACCUM ANALYZE. There is no notion of what script you'll end up
executing yet. If you have a truly custom script that works against other
data instead of the pgbench tables, you won't even be executing this
initialization bit.

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

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

Re: [HACKERS] introduction of WIP window function patch

On Sat, Jul 05, 2008 at 07:04:29PM +0900, H.Harada wrote:
> Hi,
>
> As I proposed a month before, I am working on window function.

Very nice!

> http://umitanuki.net/pgsql/wfv01/design.html
>
> The problem is, as written in the "Things to discussed" section of the
> document, how you define window functions (e.g. RANK()). My idea is to
> treat them as specialized functions such as SET OF functions and mark
> it in pg_proc. But this doesn't resolve RANK() boundary problem.

Actually, I would make RANK() and ROW_NUMBER() act more like
aggregates. ISTM you have two kinds of window functions:

- aggregation: a result is calculated over a set and the result copied
across all the rows.
- order depenadant: same as above, but the result is different for each
row.

I think you could make the latter work using the current aggregation
setup, just by calling the final_func for each row rather than just
once at the end.

That would make RANK() a normal aggrgate which returns the number of
distinct values seen so far (assuming input is ordered) and
ROW_NUMBER() is just an alias for COUNT().

I hope this is clear, let me know if it doesn't make sense.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org>

http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Re: [PATCHES] pgbench minor fixes

Simon Riggs wrote:
> Minor patch on pgbench
>
> 1. -i option should run vacuum analyze only on pgbench tables, not *all*
> tables in database.
>
How does this work with custom scripts?
> 2. pre-run cleanup step was DELETE FROM HISTORY then VACUUM HISTORY.
> This is just a slow version of TRUNCATE HISTORY.
>
>


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

[PATCHES] pgbench minor fixes

Index: contrib/pgbench/pgbench.c
===================================================================
RCS file: /home/sriggs/pg/REPOSITORY/pgsql/contrib/pgbench/pgbench.c,v
retrieving revision 1.80
diff -c -r1.80 pgbench.c
*** contrib/pgbench/pgbench.c 9 May 2008 15:53:07 -0000 1.80
--- contrib/pgbench/pgbench.c 5 Jul 2008 12:58:09 -0000
***************
*** 1080,1086 ****

/* vacuum */
fprintf(stderr, "vacuum...");
! executeStatement(con, "vacuum analyze");

fprintf(stderr, "done.\n");
PQfinish(con);
--- 1080,1089 ----

/* vacuum */
fprintf(stderr, "vacuum...");
! executeStatement(con, "vacuum analyze branches");
! executeStatement(con, "vacuum analyze tellers");
! executeStatement(con, "vacuum analyze accounts");
! executeStatement(con, "vacuum analyze history");

fprintf(stderr, "done.\n");
PQfinish(con);
***************
*** 1757,1764 ****
fprintf(stderr, "starting vacuum...");
executeStatement(con, "vacuum branches");
executeStatement(con, "vacuum tellers");
! executeStatement(con, "delete from history");
! executeStatement(con, "vacuum history");
fprintf(stderr, "end.\n");

if (do_vacuum_accounts)
--- 1760,1766 ----
fprintf(stderr, "starting vacuum...");
executeStatement(con, "vacuum branches");
executeStatement(con, "vacuum tellers");
! executeStatement(con, "truncate history");
fprintf(stderr, "end.\n");

if (do_vacuum_accounts)
Minor patch on pgbench

1. -i option should run vacuum analyze only on pgbench tables, not *all*
tables in database.

2. pre-run cleanup step was DELETE FROM HISTORY then VACUUM HISTORY.
This is just a slow version of TRUNCATE HISTORY.

--
Simon Riggs

www.2ndQuadrant.com

PostgreSQL Training, Services and Support

[PATCHES] psql command setting

Index: src/bin/psql/command.c
===================================================================
RCS file: /home/sriggs/pg/REPOSITORY/pgsql/src/bin/psql/command.c,v
retrieving revision 1.190
diff -c -r1.190 command.c
*** src/bin/psql/command.c 11 Jun 2008 10:48:17 -0000 1.190
--- src/bin/psql/command.c 5 Jul 2008 12:15:02 -0000
***************
*** 182,191 ****
*/
if (strcmp(cmd, "a") == 0)
{
! if (pset.popt.topt.format != PRINT_ALIGNED)
! success = do_pset("format", "aligned", &pset.popt, pset.quiet);
else
! success = do_pset("format", "unaligned", &pset.popt, pset.quiet);
}

/* \C -- override table title (formerly change HTML caption) */
--- 182,203 ----
*/
if (strcmp(cmd, "a") == 0)
{
! char *opt = psql_scan_slash_option(scan_state,
! OT_NORMAL, NULL, false);
! if (opt)
! {
! if (ParseVariableBool(opt))
! success = do_pset("format", "aligned", &pset.popt, pset.quiet);
! else
! success = do_pset("format", "unaligned", &pset.popt, pset.quiet);
! }
else
! {
! if (pset.popt.topt.format != PRINT_ALIGNED)
! success = do_pset("format", "aligned", &pset.popt, pset.quiet);
! else
! success = do_pset("format", "unaligned", &pset.popt, pset.quiet);
! }
}

/* \C -- override table title (formerly change HTML caption) */
***************
*** 538,547 ****
/* HTML mode */
else if (strcmp(cmd, "H") == 0 || strcmp(cmd, "html") == 0)
{
! if (pset.popt.topt.format != PRINT_HTML)
! success = do_pset("format", "html", &pset.popt, pset.quiet);
else
! success = do_pset("format", "aligned", &pset.popt, pset.quiet);
}


--- 550,571 ----
/* HTML mode */
else if (strcmp(cmd, "H") == 0 || strcmp(cmd, "html") == 0)
{
! char *opt = psql_scan_slash_option(scan_state,
! OT_NORMAL, NULL, false);
! if (opt)
! {
! if (ParseVariableBool(opt))
! success = do_pset("format", "html", &pset.popt, pset.quiet);
! else
! success = do_pset("format", "aligned", &pset.popt, pset.quiet);
! }
else
! {
! if (pset.popt.topt.format != PRINT_HTML)
! success = do_pset("format", "html", &pset.popt, pset.quiet);
! else
! success = do_pset("format", "aligned", &pset.popt, pset.quiet);
! }
}


Index: src/bin/psql/help.c
===================================================================
RCS file: /home/sriggs/pg/REPOSITORY/pgsql/src/bin/psql/help.c,v
retrieving revision 1.129
diff -c -r1.129 help.c
*** src/bin/psql/help.c 11 Jun 2008 10:55:43 -0000 1.129
--- src/bin/psql/help.c 5 Jul 2008 12:30:39 -0000
***************
*** 220,237 ****
fprintf(output, "\n");

fprintf(output, _("Formatting\n"));
! fprintf(output, _(" \\a toggle between unaligned and aligned output mode\n"));
fprintf(output, _(" \\C [STRING] set table title, or unset if none\n"));
fprintf(output, _(" \\f [STRING] show or set field separator for unaligned query output\n"));
! fprintf(output, _(" \\H toggle HTML output mode (currently %s)\n"),
ON(pset.popt.topt.format == PRINT_HTML));
fprintf(output, _(" \\pset NAME [VALUE] set table output option\n"
" (NAME := {format|border|expanded|fieldsep|footer|null|\n"
" numericlocale|recordsep|tuples_only|title|tableattr|pager})\n"));
! fprintf(output, _(" \\t show only rows (currently %s)\n"),
ON(pset.popt.topt.tuples_only));
fprintf(output, _(" \\T [STRING] set HTML <table> tag attributes, or unset if none\n"));
! fprintf(output, _(" \\x toggle expanded output (currently %s)\n"),
ON(pset.popt.topt.expanded));
fprintf(output, "\n");

--- 220,237 ----
fprintf(output, "\n");

fprintf(output, _("Formatting\n"));
! fprintf(output, _(" \\a [on|off] toggle between unaligned and aligned output mode\n"));
fprintf(output, _(" \\C [STRING] set table title, or unset if none\n"));
fprintf(output, _(" \\f [STRING] show or set field separator for unaligned query output\n"));
! fprintf(output, _(" \\H [on|off] toggle or set HTML output mode (currently %s)\n"),
ON(pset.popt.topt.format == PRINT_HTML));
fprintf(output, _(" \\pset NAME [VALUE] set table output option\n"
" (NAME := {format|border|expanded|fieldsep|footer|null|\n"
" numericlocale|recordsep|tuples_only|title|tableattr|pager})\n"));
! fprintf(output, _(" \\t [on|off] toggle or set showing rows only (currently %s)\n"),
ON(pset.popt.topt.tuples_only));
fprintf(output, _(" \\T [STRING] set HTML <table> tag attributes, or unset if none\n"));
! fprintf(output, _(" \\x [on|off] toggle or set expanded output (currently %s)\n"),
ON(pset.popt.topt.expanded));
fprintf(output, "\n");

***************
*** 245,251 ****

fprintf(output, _("External\n"));
fprintf(output, _(" \\cd [DIR] change the current working directory\n"));
! fprintf(output, _(" \\timing [on|off] toggle timing of commands (currently %s)\n"),
ON(pset.timing));
fprintf(output, _(" \\! [COMMAND] execute command in shell or start interactive shell\n"));
fprintf(output, "\n");
--- 245,251 ----

fprintf(output, _("External\n"));
fprintf(output, _(" \\cd [DIR] change the current working directory\n"));
! fprintf(output, _(" \\timing [on|off] toggle or set timing of commands (currently %s)\n"),
ON(pset.timing));
fprintf(output, _(" \\! [COMMAND] execute command in shell or start interactive shell\n"));
fprintf(output, "\n");
Recent patch allowed \timing [on|off]

This patch allows same option on all remaining toggles, so every option
works in the same way. We now have the ability to do
\a [on|off]
\H [on|off]

Patch also corrects help, which didn't show that \x and \t could already
be directly set, even though help said they were toggles.

--
Simon Riggs

www.2ndQuadrant.com

PostgreSQL Training, Services and Support

Re: [PERFORM] Subquery WHERE IN or WHERE EXISTS faster?

Hi Ulrich, do you try with

SELECT p.speed FROM processor p
INNER JOIN users_processors up ON p.id=up.processorid
AND up.userid=1
?
Or your question is only about IN and EXIST?

regards,

Sergio Gabriel Rodriguez
Corrientes - Argentina
http://www.3trex.com.ar

On Sat, Jun 28, 2008 at 7:07 PM, Ulrich <ulrich.mierendorff@gmx.net> wrote:
> Hi,
> I have added a bit of dummy Data, 100000 processors, 10000 users, each user
> got around 12 processors.
>
> I have tested both queries. First of all, I was surprised that it is that
> fast :) Here are the results:
>
>
> EXPLAIN ANALYZE SELECT speed FROM processors WHERE id IN (SELECT processorid
> FROM users_processors WHERE userid=4040) ORDER BY speed ASC LIMIT 10 OFFSET
> 1;
>
> Limit (cost=113.73..113.75 rows=7 width=5) (actual time=0.335..0.340
> rows=10 loops=1)
> -> Sort (cost=113.73..113.75 rows=8 width=5) (actual time=0.332..0.333
> rows=11 loops=1)
> Sort Key: processors.speed
> Sort Method: quicksort Memory: 17kB
> -> Nested Loop (cost=47.22..113.61 rows=8 width=5) (actual
> time=0.171..0.271 rows=13 loops=1)
> -> HashAggregate (cost=47.22..47.30 rows=8 width=4) (actual
> time=0.148..0.154 rows=13 loops=1)
> -> Bitmap Heap Scan on users_processors
> (cost=4.36..47.19 rows=12 width=4) (actual time=0.074..0.117 rows=13
> loops=1)
> Recheck Cond: (userid = 4040)
> -> Bitmap Index Scan on
> users_processors_userid_index (cost=0.00..4.35 rows=12 width=0) (actual
> time=0.056..0.056 rows=13 loops=1)
> Index Cond: (userid = 4040)
> -> Index Scan using processors_pkey on processors
> (cost=0.00..8.28 rows=1 width=9) (actual time=0.006..0.007 rows=1 loops=13)
> Index Cond: (processors.id =
> users_processors.processorid)
> Total runtime: 0.471 ms
> (13 rows)
>
> ___________
>
> EXPLAIN ANALYZE SELECT speed FROM processors WHERE EXISTS (SELECT 1 FROM
> users_processors WHERE userid=4040 AND processorid=processors.id) ORDER BY
> speed ASC LIMIT 10 OFFSET 1;
>
> Limit (cost=831413.86..831413.89 rows=10 width=5) (actual
> time=762.475..762.482 rows=10 loops=1)
> -> Sort (cost=831413.86..831538.86 rows=50000 width=5) (actual
> time=762.471..762.473 rows=11 loops=1)
> Sort Key: processors.speed
> Sort Method: quicksort Memory: 17kB
> -> Seq Scan on processors (cost=0.00..830299.00 rows=50000 width=5)
> (actual time=313.591..762.411 rows=13 loops=1)
> Filter: (subplan)
> SubPlan
> -> Index Scan using users_processors_pkey on
> users_processors (cost=0.00..8.29 rows=1 width=0) (actual time=0.006..0.006
> rows=0 loops=100000)
> Index Cond: ((userid = 4040) AND (processorid = $0))
> Total runtime: 762.579 ms
> (10 rows)
>
>
>
>
> As you can see the second query is much slower. First I thought "Just a
> difference of 0.3ms?", but then I realized that it was 762ms not 0.762 ;-).
> Both queries return the same result, so I will use #1 and count(*) takes
> just 0.478ms if I use query #1.
>
> Kind Regards,
> Ulrich
>
> Tom Lane wrote:
>>
>> Ulrich <ulrich.mierendorff@gmx.net> writes:
>>
>>>
>>> People say that [EXISTS is faster]
>>>
>>
>> People who say that are not reliable authorities, at least as far as
>> Postgres is concerned. But it is always a bad idea to extrapolate
>> results on toy tables to large tables --- quite aside from measurement
>> noise and caching issues, the planner might pick a different plan when
>> faced with large tables. Load up a realistic amount of data and then
>> see what you get.
>>
>> regards, tom lane
>>
>>
>
>
> --
> 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: [GENERAL] AT TIME ZONE and DST in UTC<->CET conversion

Jaromír Talíř <jaromir.talir@nic.cz> writes:

> postgres# select '2008-06-01 10:10:10 UTC' AT TIME ZONE 'CET';
> timezone
> ---------------------
> 2008-06-01 12:10:10

ISTM this is the one that's wrong. "CET" is standard time, it, GMT+1.

If you want a timezone which switches between CET and CST automatically you
should use something like Europe/Paris.

--
Gregory Stark
EnterpriseDB

http://www.enterprisedb.com

Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

--
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] Subquery WHERE IN or WHERE EXISTS faster?

Hi Ulrich, do you try with

SELECT p.speed FROM processor p
INNER JOIN users_processors up ON p.id=up.processorid
AND up.userid=1
?
Or your question is only about IN and EXIST?

regards,

Sergio Gabriel Rodriguez
Corrientes - Argentina
http://www.3trex.com.ar

On Mon, Jun 30, 2008 at 4:44 AM, Rusty Conover <rconover@infogears.com> wrote:
>
> On Jun 30, 2008, at 1:29 AM, Ulrich wrote:
>
>> I think it will be fast, because the "IN set", which is the result of
>> "SELECT processorid FROM users_processors WHERE userid=4040", is limited to
>> a maximum of ~500 processors which is not very big. Increasing Postgres' RAM
>> would be difficult for me, because I am only running a very small server
>> with 256MB RAM and the webserver also likes to use some RAM.
>>
>> Does Postgre cache the HASH-Table for later use? For example when the user
>> reloads the website.
>>
>
> No the hash table only lives as long as the query is being executed. If
> you're looking for generic caching, I'd suggest memcached may be able to
> fill your needs.
>
> Cheers,
>
> Rusty
> --
> Rusty Conover
> InfoGears Inc.
> http://www.infogears.com
>
>
>
>
>
>
>
> --
> 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

[PATCHES] Bug fix for pg_standby keepfiles calculation

Index: contrib/pg_standby/pg_standby.c
===================================================================
RCS file: /home/sriggs/pg/REPOSITORY/pgsql/contrib/pg_standby/pg_standby.c,v
retrieving revision 1.12
diff -c -r1.12 pg_standby.c
*** contrib/pg_standby/pg_standby.c 17 May 2008 01:28:21 -0000 1.12
--- contrib/pg_standby/pg_standby.c 5 Jul 2008 11:44:29 -0000
***************
*** 323,329 ****
if (seg_diff > seg)
{
log_diff++;
! seg = MaxSegmentsPerLogFile - seg_diff;
}
else
seg -= seg_diff;
--- 323,329 ----
if (seg_diff > seg)
{
log_diff++;
! seg = MaxSegmentsPerLogFile - (seg_diff - seg);
}
else
seg -= seg_diff;
Fix minor bug in pg_standby, noted by Ferenc Felhoffer

Request immediate apply to CVS HEAD and 8.3

--
Simon Riggs

www.2ndQuadrant.com

PostgreSQL Training, Services and Support

[PERFORM] How much work_mem to configure...

How can I tell if my work_mem configuration is enough to support all  Postgres user activities on the server I am managing?

Where do I find the indication if the number is lower than needed.

Thanks,
Jessica

[ADMIN] performance cost for varchar(20), varchar(255), and text

I am tuning a database created by someone else.

I noticed that some column lengths were defined longer than needed.

For example, an Id column is holding a stand length of 20 characters but was defined as varchar(255).

On some other columns, for example, a Description column is supposed to hold less than 100 characters but defined as text.

I am trying to understand the performance impact if a column is over defined in the following cases:

1. char(20) vs varchar(20)

2. varchar(20) vs varchar(255)

3. varchar(255) vs text


thanks,
Jessica

Re: [pgadmin-hackers] Enabling SQL text field in the SQL tab of object dialog

Index: pgadmin/include/dlg/dlgProperty.h
===================================================================
--- pgadmin/include/dlg/dlgProperty.h (revision 7390)
+++ pgadmin/include/dlg/dlgProperty.h (working copy)
@@ -60,6 +60,8 @@
void EnableOK(bool enable);
virtual bool IsUpToDate() { return true; };
void ShowObject();
+
+ void FillSQLTextfield();

void CheckValid(bool &enable, const bool condition, const wxString &msg);
static dlgProperty *CreateDlg(frmMain *frame, pgObject *node, bool asNew, pgaFactory *factory=0);
@@ -86,6 +88,7 @@
void OnChange(wxCommandEvent &ev);
void OnChangeOwner(wxCommandEvent &ev);
void OnChangeStc(wxStyledTextEvent& event);
+ void OnChangeReadOnly(wxCommandEvent& event);

protected:
void AddUsers(ctlComboBoxFix *cb1, ctlComboBoxFix *cb2=0);
@@ -97,7 +100,7 @@
pgDatabase *database;

frmMain *mainForm;
- ctlSQLBox *sqlPane;
+ wxPanel *sqlPane;

wxTextValidator numericValidator;

@@ -105,6 +108,10 @@
wxTextCtrl *txtName, *txtOid, *txtComment;
ctlComboBox *cbOwner;
ctlComboBox *cbClusterSet;
+ wxCheckBox *chkReadOnly;
+ ctlSQLBox *sqlTextField1;
+ ctlSQLBox *sqlTextField2;
+ bool enableSQL2;

int width, height;
wxTreeItemId item, owneritem;
Index: pgadmin/dlg/dlgProperty.cpp
===================================================================
--- pgadmin/dlg/dlgProperty.cpp (revision 7390)
+++ pgadmin/dlg/dlgProperty.cpp (working copy)
@@ -59,8 +59,6 @@
#include "schema/pgUser.h"


-
-
class replClientData : public wxClientData
{
public:
@@ -72,6 +70,9 @@
};


+#define CTRLID_CHKSQLTEXTFIELD 1000
+
+
BEGIN_EVENT_TABLE(dlgProperty, DialogWithHelp)
EVT_NOTEBOOK_PAGE_CHANGED(XRCID("nbNotebook"), dlgProperty::OnPageSelect)

@@ -80,6 +81,8 @@
EVT_COMBOBOX(XRCID("cbOwner"), dlgProperty::OnChange)
EVT_TEXT(XRCID("txtComment"), dlgProperty::OnChange)

+ EVT_CHECKBOX(CTRLID_CHKSQLTEXTFIELD, dlgProperty::OnChangeReadOnly)
+
EVT_BUTTON(wxID_HELP, dlgProperty::OnHelp)
EVT_BUTTON(wxID_OK, dlgProperty::OnOK)
EVT_BUTTON(wxID_APPLY, dlgProperty::OnApply)
@@ -90,6 +93,8 @@
{
readOnly=false;
sqlPane=0;
+ sqlTextField1=0;
+ sqlTextField2=0;
processing=false;
mainForm=frame;
database=0;
@@ -117,6 +122,11 @@
txtComment = CTRL_TEXT("txtComment");
cbOwner = CTRL_COMBOBOX2("cbOwner");
cbClusterSet = CTRL_COMBOBOX2("cbClusterSet");
+
+ wxString db = wxT("Database");
+ wxString ts = wxT("Tablespace");
+ enableSQL2 = db.Cmp(factory->GetTypeName()) == 0
+ || ts.Cmp(factory->GetTypeName()) == 0;

wxNotebookPage *page=nbNotebook->GetPage(0);
wxASSERT(page != NULL);
@@ -311,8 +321,41 @@

void dlgProperty::CreateAdditionalPages()
{
- sqlPane = new ctlSQLBox(nbNotebook, CTL_PROPSQL, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxSUNKEN_BORDER | wxTE_READONLY | wxTE_RICH2);
+ // create a panel
+ sqlPane = new wxPanel(nbNotebook);
+
+ // add panel to the notebook
nbNotebook->AddPage(sqlPane, wxT("SQL"));
+
+ // create a flex grid sizer
+ wxFlexGridSizer *fgsizer = new wxFlexGridSizer(1, 5, 5);
+
+ // add checkbox to the panel
+ chkReadOnly = new wxCheckBox(sqlPane, CTRLID_CHKSQLTEXTFIELD, wxT("Read only"));
+ chkReadOnly->SetValue(true);
+ fgsizer->Add(chkReadOnly, 1, wxALL | wxALIGN_LEFT, 5);
+
+ // add the first text entry box
+ sqlTextField1 = new ctlSQLBox(sqlPane, CTL_PROPSQL,
+ wxDefaultPosition, wxDefaultSize,
+ wxTE_MULTILINE | wxSUNKEN_BORDER | wxTE_RICH2);
+ fgsizer->Add(sqlTextField1, 1, wxALL | wxEXPAND, 5);
+
+ // add the second text entry box (if needed)
+ if (enableSQL2)
+ {
+ sqlTextField2 = new ctlSQLBox(sqlPane, CTL_PROPSQL,
+ wxDefaultPosition, wxDefaultSize,
+ wxTE_MULTILINE | wxSUNKEN_BORDER | wxTE_RICH2);
+ fgsizer->Add(sqlTextField2, 1, wxALL | wxEXPAND, 5);
+ }
+
+ fgsizer->AddGrowableCol(0);
+ fgsizer->AddGrowableRow(1);
+ fgsizer->AddGrowableRow(2);
+
+ sqlPane->SetAutoLayout(true);
+ sqlPane->SetSizer(fgsizer);
}


@@ -506,6 +549,85 @@
}


+void dlgProperty::OnChangeReadOnly(wxCommandEvent &ev)
+{
+ size_t pos;
+ bool showmessage;
+
+ showmessage = chkReadOnly->GetValue()
+ && ! (!enableSQL2 && GetSql().Length() == 0 && sqlTextField1->GetText().Cmp(_("-- nothing to change")) == 0)
+ && ! (!enableSQL2 && GetSql().Length() == 0 && sqlTextField1->GetText().Cmp(_("-- definition incomplete")) == 0)
+ && ! (enableSQL2 && GetSql().Length() == 0 && GetSql2().Length() == 0 && sqlTextField1->GetText().Cmp(_("-- nothing to change")) == 0 && sqlTextField2->GetText().Length() == 0)
+ && ! (enableSQL2 && GetSql().Length() == 0 && GetSql2().Length() == 0 && sqlTextField1->GetText().Cmp(_("-- definition incomplete")) == 0 && sqlTextField2->GetText().Length() == 0)
+ && (sqlTextField1->GetText().Cmp(GetSql()) != 0 || (enableSQL2 && sqlTextField2->GetText().Cmp(GetSql2()) != 0));
+
+ if (showmessage)
+ {
+ if (wxMessageBox(_("Are you sure you wish to cancel your edit?"), _("SQL editor"), wxYES_NO|wxNO_DEFAULT) == wxNO)
+ {
+ chkReadOnly->SetValue(false);
+ return;
+ }
+ }
+
+ sqlTextField1->SetReadOnly(chkReadOnly->GetValue());
+ if (enableSQL2)
+ {
+ sqlTextField2->SetReadOnly(chkReadOnly->GetValue());
+ }
+ for (pos = 0; pos < nbNotebook->GetPageCount() - 1; pos++)
+ {
+ nbNotebook->GetPage(pos)->Enable(chkReadOnly->GetValue());
+ }
+
+ if (chkReadOnly->GetValue())
+ {
+ FillSQLTextfield();
+ }
+}
+
+
+void dlgProperty::FillSQLTextfield()
+{
+ // create a function because this is a duplicated code
+ sqlTextField1->SetReadOnly(false);
+ if (enableSQL2)
+ {
+ sqlTextField2->SetReadOnly(false);
+ }
+ if (btnOK->IsEnabled())
+ {
+ wxString tmp;
+ if (cbClusterSet && cbClusterSet->GetSelection() > 0)
+ {
+ replClientData *data=(replClientData*)cbClusterSet->GetClientData(cbClusterSet->GetSelection());
+ tmp.Printf(_("-- Execute replicated using cluster \"%s\", set %ld\n"), data->cluster.c_str(), data->setId);
+ }
+ sqlTextField1->SetText(tmp + GetSql());
+ if (enableSQL2)
+ {
+ sqlTextField2->SetText(GetSql2());
+ }
+ }
+ else
+ {
+ if (GetObject())
+ sqlTextField1->SetText(_("-- nothing to change"));
+ else
+ sqlTextField1->SetText(_("-- definition incomplete"));
+ if (enableSQL2)
+ {
+ sqlTextField2->SetText(wxT(""));
+ }
+ }
+ sqlTextField1->SetReadOnly(true);
+ if (enableSQL2)
+ {
+ sqlTextField2->SetReadOnly(true);
+ }
+}
+
+
bool dlgProperty::tryUpdate(wxTreeItemId collectionItem)
{
ctlTree *browser=mainForm->GetBrowser();
@@ -608,7 +730,7 @@
mainForm->GetSqlPane()->SetReadOnly(true);
}
}
- else if (item)
+ else if (item && chkReadOnly->GetValue())
{
wxTreeItemId collectionItem=item;

@@ -753,8 +875,25 @@
return;
}

- wxString sql=GetSql();
- wxString sql2=GetSql2();
+ wxString sql;
+ wxString sql2;
+ if (chkReadOnly->GetValue())
+ {
+ sql = GetSql();
+ sql2 = GetSql2();
+ }
+ else
+ {
+ sql = sqlTextField1->GetText();
+ if (enableSQL2)
+ {
+ sql2 = sqlTextField2->GetText();
+ }
+ else
+ {
+ sql2 = wxT("");
+ }
+ }

if (!apply(sql, sql2))
{
@@ -768,27 +907,10 @@

void dlgProperty::OnPageSelect(wxNotebookEvent& event)
{
- if (sqlPane && event.GetSelection() == (int)nbNotebook->GetPageCount()-1)
+ if (sqlTextField1 && chkReadOnly->GetValue() &&
+ event.GetSelection() == (int)nbNotebook->GetPageCount()-1)
{
- sqlPane->SetReadOnly(false);
- if (btnOK->IsEnabled())
- {
- wxString tmp;
- if (cbClusterSet && cbClusterSet->GetSelection() > 0)
- {
- replClientData *data=(replClientData*)cbClusterSet->GetClientData(cbClusterSet->GetSelection());
- tmp.Printf(_("-- Execute replicated using cluster \"%s\", set %ld\n"), data->cluster.c_str(), data->setId);
- }
- sqlPane->SetText(tmp + GetSql() + GetSql2());
- }
- else
- {
- if (GetObject())
- sqlPane->SetText(_("-- nothing to change"));
- else
- sqlPane->SetText(_("-- definition incomplete"));
- }
- sqlPane->SetReadOnly(true);
+ FillSQLTextfield();
}
}

Dave Page a écrit :
> On Tue, Jul 1, 2008 at 11:52 AM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>
>> I'm at the PostgreSQL booth, for the RMLL in Mont-de-Marsan
>> (http://rmll.info). I'm trying the wifi system :)
>
> :-)
>
>> Here is the patch that fixes your issue on Win32. Works great on Win32 and
>> Linux... I'm not sure for Mac OS X though.
>
> Hmm, this still isn't looking so good I'm afraid:
>

:-/

> - If I open the properties dialogue on a database, click the SQL tab
> and then uncheck Read only, having changed nothing, I get asked if I
> want to cancel my edit. I believe this is because in the edit case,
> GetSQL() will return nothing, whilst the textbox may contain '--
> nothing to change'
>

Fixed.

> - The sizing is still wrong on Mac. Worse, the text boxes no longer
> resize on the resizeable dialogues (dlgFunction, dlgPackage,
> dlgTrigger and friends).
>
> I would suggest avoiding trying to calculate the dimensions in code -

I like this idea.

> in my experience this almost never works well. Instead, I would
> suggest laying the two textboxes and the checkbox in a sizer and
> letting that do the work. Not only should that be easier to code (once
> you fully understand sizers!), but it should work properly on all
> platforms, and be resize-friendly.
>

OK, it wasn't easy to do. But it now works. I don't specify any size and
the rendering looks great... on Linux. On Windows, it doesn't. I spent
part of the last two days to try to understand the Windows behaviour but
I failed. Do you have any idea on the Windows behavior? is there
something Windows specific when we use the flex grid sizer?

> The same should probably be done for other standard tabs (eg,
> privileges, gucs) when you update all the XRC files as you discussed
> previously.
>
> Sorry, I know this isn't what you wanted to hear - but we'll get there :-)
>

Oh no problem with me on this. I'm just worried on the number of bad
patches.

The patch attached fixed some issues:
* The "Are you sure..." message is displayed only when "Read Only" is
checked.
* No button is the default on the "Are you sure" message (which has a
weird behaviour... hitting Esc will validate the dialog and the user
will lose his changes... I'm not sure we should keep this).
* the first issue you had.
* Sizing problems fixed on Linux with a wxFlexGridSizer.

Remaining issues:
* Objects' size on Windows (and Max OS X ?).


--
Guillaume.

http://www.postgresqlfr.org

http://dalibo.com

[GENERAL] AT TIME ZONE and DST in UTC<->CET conversion

First, if I do conversion from UTC to CET and back when a timestamp is
OUTSIDE of daylight saving period, it's correct:

postgres# select '2008-01-01 10:10:10 UTC' AT TIME ZONE 'CET';
timezone
---------------------
2008-01-01 11:10:10

postgres# select '2008-01-01 11:10:10 CET' AT TIME ZONE 'UTC';
timezone
---------------------
2008-01-01 10:10:10


When I do the same INSIDE this period just the UCT->CET direction is
correct but back direction will fail subtracting only 1 hour instead of
2 hours.

postgres# select '2008-06-01 10:10:10 UTC' AT TIME ZONE 'CET';
timezone
---------------------
2008-06-01 12:10:10

postgres# select '2008-06-01 12:10:10 CET' AT TIME ZONE 'UTC';
timezone
---------------------
2008-06-01 11:10:10

If it supports automatic discovery of DST in conversion from UTC to CET
(and this is great), why it doesn't support this discovery in opposit
direction?

Regards,
Jaromir

[HACKERS] introduction of WIP window function patch

Hi,

As I proposed a month before, I am working on window function.
Although this work is at quite early step, I would like to introduce
it since a part of it have been finished. If you can afford and are
interested in it, please review the document and patch, or compile the
applied source to execute an attached sample SQL.

http://umitanuki.net/pgsql/wfv01/design.html

Currently, only aggregation over window does work. I am planning to
work for the combination of window and normal aggregation from now on,
which I guess I can manage to do.

The problem is, as written in the "Things to discussed" section of the
document, how you define window functions (e.g. RANK()). My idea is to
treat them as specialized functions such as SET OF functions and mark
it in pg_proc. But this doesn't resolve RANK() boundary problem.

I am so happy with any kind of comments, reviews or critiques.

Regards,

--
Hitoshi Harada

--
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] PATCH: CITEXT 2.0

"David E. Wheeler" <david@kineticode.com> writes:

> do I need to worry about memory leaks in citext_eq, citext_ne, citext_gt,
> etc.,

yes

--
Gregory Stark
EnterpriseDB

http://www.enterprisedb.com

Ask me about EnterpriseDB's 24x7 Postgres support!

--
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] PATCH: CITEXT 2.0

"David E. Wheeler" <david@kineticode.com> writes:

> On Jul 3, 2008, at 09:53, Alvaro Herrera wrote:
>
>>> Thanks. What would citext_hash() look like? I don't see a text_hash() to
>>> borrow from anywhere in src/.
>>
>> See hash_any(). I assume the difficulty is making sure that
>> hash("FOO") = hash("foo") ...
>
> Great, big help, thank you. So does this look sensible?
>
> txt = cilower( PG_GETARG_TEXT_PP(0) );
> str = VARDATA_ANY(txt);
>
> result = hash_any((unsigned char *) str, VARSIZE_ANY_EXHDR(txt));

I thought your data type implemented a locale dependent collation, not just
a case insensitive collation. That is, does this hash agree with your
citext_eq on strings like "foo bar" <=> "foobar" and "fooß" <=> "fooss" ?

You may have to use strxfrm

--
Gregory Stark
EnterpriseDB

http://www.enterprisedb.com

Ask me about EnterpriseDB's PostGIS support!

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

Re: [PATCHES] Explain XML patch v2

On Fri, 2008-07-04 at 17:20 +0100, Simon Riggs wrote:
> <!ELEMENT plan (estimate, runtime?)>

Sorry, I noticed a few typos in my sample DTD.

<!ELEMENT plan (node+)> with some additional elements for stats

and the attlist below was for the <node> not <plan> element

<!ATTLIST node
nodetype CDATA #REQUIRED>


--
Simon Riggs

www.2ndQuadrant.com

PostgreSQL Training, Services and Support


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

Re: [PATCHES] Explain XML patch v2

On Fri, 2008-07-04 at 19:38 +0100, Dave Page wrote:
> On Fri, Jul 4, 2008 at 5:20 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> >
> > * If the patch was implemented as an ExplainOneQuery_hook we would be
> > able to use this with 8.3 also, which might be interesting. So there's
> > no real need for this to be a patch on core.
>
> Would that mean that instead of being an optional format that pgAdmin
> could request with appropriate grammar, it would be something that was
> only available if the plugin was loaded, and would replace regular
> EXPLAIN output? If so, that would be extremely inconvenient, and next
> to useless for general purpose utilities.

It can be optional since plugins can add parameters also.

It wouldn't take long to make up a plugin for 8.3 once this patch has
been committed to core for 8.4, so if you're saying you'd definitely
like it in core then I'm OK with that.

--
Simon Riggs

www.2ndQuadrant.com

PostgreSQL Training, Services and Support


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

Re: [COMMITTERS] pgsql: Fix a couple of bugs in win32 shmem name generation: * Don't cut

Alvaro Herrera wrote:
> Magnus Hagander wrote:
>> Tom Lane wrote:
>
>>> According to what you just told me, the original coding is storing the
>>> name in a "local namespace", which presumably means it won't conflict
>>> anyway. Ergo, the existing coding is simply broken and there's nothing
>>> we can do about it.
>> Local namespace = Session local, not process local. So it would properly
>> protect against two processes started in the same session. One session
>> is, for example, an interactive login. But not if they were started by
>> different users, since they'd be in different sessions.
>
> But those different users would not have access to the same set of
> files, so it wouldn't work anyway, right?

Depends on what permissions you set on the directory, obviously....
Default ones depend on windows version and where in the filesystem they go.

//Magnus

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

Re: [PATCHES] [HACKERS] WITH RECURSIVE updated to CVS TIP

hello david,

i did some quick testing with this wonderful patch.
it seems there are some flaws in there still:

test=# explain select count(*)
test-#         from ( WITH RECURSIVE t(n) AS ( SELECT 1 UNION ALL SELECT DISTINCT n+1 FROM t )
test(#                 SELECT * FROM t WHERE n < 5000000000) as t
test-#         WHERE n < 100;
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!> \q

this one will kill the planner :(
removing the (totally stupid) distinct avoids the core dump.


i found one more issue;

-- broken: wrong result
test=# select count(*) from ( WITH RECURSIVE t(n) AS (
        SELECT 1 UNION ALL SELECT n + 1 FROM t)
        SELECT * FROM t WHERE n < 5000000000) as t WHERE n < (
                select count(*) from ( WITH RECURSIVE t(n) AS (
                        SELECT 1 UNION ALL SELECT n + 1 FROM t )
        SELECT * FROM t WHERE n < 5000000000) as t WHERE n < 100) ;
 count
-------
     1
(1 row)

if i am not totally wrong, this should give us a different result.

i am looking forward to see this patch in core :).
it is simply wonderful ...

many thanks,

hans






On Jul 3, 2008, at 1:11 AM, David Fetter wrote:

Folks,

Please find patch enclosed, including some documentation.

Can we see about getting this in this commitfest?

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate<recursive_query-7.patch.bz2>
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:



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

Friday, July 4, 2008

Re: [PERFORM] Fusion-io ioDrive

On Tue, Jul 1, 2008 at 5:18 PM, Jeffrey Baker <jwbaker@gmail.com> wrote:
> I recently got my hands on a device called ioDrive from a company
> called Fusion-io. The ioDrive is essentially 80GB of flash on a PCI
> card.

[...]

> Service Time Percentile, millis
> R/W TPS R-O TPS 50th 80th 90th 95th
> RAID 182 673 18 32 42 64
> Fusion 971 4792 8 9 10 11

Essentially the same benchmark, but on a quad Xeon 2GHz with 3GB main
memory, and the scale factor of 300. Really all we learn from this
exercise is the sheer futility of throwing CPU at PostgreSQL.

R/W TPS: 1168
R-O TPS: 6877

Quadrupling the CPU resources and tripling the RAM results in a 20% or
44% performance increase on read/write and read-only loads,
respectively. The system loafs along with 2-3 CPUs completely idle,
although oddly iowait is 0%. I think the system is constrained by
context switch, which is tens of thousands per second. This is a
problem with the ioDrive software, not with pg.

Someone asked for bonnie++ output:

Block output: 495MB/s, 81% CPU
Block input: 676MB/s, 93% CPU
Block rewrite: 262MB/s, 59% CPU

Pretty respectable. In the same ballpark as an HP MSA70 + P800 with
25 spindles.

-jwb

--
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] PATCH: CITEXT 2.0

Replying to myself, but I've made some local changes (see other
messages) and just wanted to follow up on some of my own comments.

On Jul 2, 2008, at 21:38, David E. Wheeler wrote:

>> 4) Operator = citext_eq is not correct. See comment http://doxygen.postgresql.org/varlena_8c.html#8621d064d14f259c594e4df3c1a64cac
>
> So should citextcmp() call strncmp() instead of varst_cmp()? The
> latter is what I saw in varlena.c.

I'm guessing that the answer is "no," since varstr_cmp() uses
strncmp() internally, as appropriate to the locale. Correct?

>> There must be difference between equality and collation for example
>> in Czech language 'láska' and 'laská' are different word it means
>> that 'láska' != 'laská'. But there is no difference in collation
>> order. See Unicode Universal Collation Algorithm for detail.
>
> I'll leave the collation stuff to the functions I call (*far* from
> my specialty), but I'll add a test for this and make sure it works
> as expected. Um, although, with what collation should it be tested?
> The tests I wrote assume en_US.UTF-8.

I added this test and is passes:

SELECT isnt( 'láska'::citext, 'laská'::citext, 'Diffrent accented
characters should not be equivalent' );

>> 5) There are several commented out lines in CREATE OPERATOR
>> statement mostly related to NEGATOR. Is there some reason for that?
>
> I copied it from the original citext.sql. Not sure what effect it has.

I restored these (and one of them was wrong anyway).

>> Also OPERATOR || has probably wrong negator.
>
> Right, good catch.

Stupid question: What would the negation of || actually be? There
isn't one is, there?

Thanks!

David
--
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] PATCH: CITEXT 2.0

On Jul 2, 2008, at 22:14, Tom Lane wrote:

> The "leak" is irrelevant for larger/smaller. The only place where
> it's
> actually useful to do PG_FREE_IF_COPY is in a btree or hash index
> support function. In other cases you can assume that you're being
> called in a memory context that's too short-lived for it to matter.

Stupid question: for the btree index support function, is that *only*
the function referenced in the OPERATOR CLASS, or does it also apply
to functions that implement the operators in that class? IOW, do I
need to worry about memory leaks in citext_eq, citext_ne, citext_gt,
etc., or only in citext_cmp()?

Thanks,

David

--
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] PATCH: CITEXT 2.0

On Jul 3, 2008, at 09:53, Alvaro Herrera wrote:

>> Thanks. What would citext_hash() look like? I don't see a
>> text_hash() to
>> borrow from anywhere in src/.
>
> See hash_any(). I assume the difficulty is making sure that
> hash("FOO") = hash("foo") ...

Great, big help, thank you. So does this look sensible?

Datum
citext_hash(PG_FUNCTION_ARGS)
{
char *txt;
char *str;
Datum result;

txt = cilower( PG_GETARG_TEXT_PP(0) );
str = VARDATA_ANY(txt);

result = hash_any((unsigned char *) str, VARSIZE_ANY_EXHDR(txt));

/* Avoid leaking memory for toasted inputs */
PG_FREE_IF_COPY(txt, 0);
pfree( str );

return result;
}

And how might I be able to test that it actually works?

Best,

David

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

Re: [pgsql-es-ayuda] DATESTYLE

Porke no manejas el formato con to_char o to_date?

Saludos,


2008/7/4, Noel Martínez Juárez <noelius79@hotmail.com>:
> Buenas noches, he intentado cambiar el formato de la fecha en postgresql, a
> día-mes-año, pero el PG-ADMIN no me muestra dicho cambio, la variable que
> modifico es DATESTYLE, gracias.NOEL
>
> _________________________________________________________________
> Juega y gana, tenemos 3 Xbox a la semana.
> http://club.prodigymsn.com/


--
Fabio Hernando Arias Vera
Cel. 314 411 7776
--
TIP 8: explain analyze es tu amigo

[pgsql-es-ayuda] DATESTYLE

Buenas noches, he intentado cambiar el formato de la fecha en postgresql, a día-mes-año, pero el PG-ADMIN no me muestra dicho cambio, la variable que modifico es DATESTYLE, gracias.

NOEL



Conoce el perfil completo de todos tus amigos de Windows Live Messenger justo aquí: Windows Live Spaces

Re: [PORTS] Fwd: 8.3.3 compile fails on Mac OS X 10.5.2

Tom Lane wrote:
> > When I blow away /sw/bin/awk, so that make uses /usr/bin/awk instead,
> > I get a make that executes perfectly and a make check with "All 114
> > tests passed."
>
> <spock>Fascinating.</spock>

OK, that wins the most creative tag award from me.

--
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-ports mailing list (pgsql-ports@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-ports

[PORTS] contrib - fuzzystrmatch installation issue

Hi everyone,

I am running Postgres 8.3.3 on a CentOS box and I had a few issues when trying to install the fuzzystrmatch library. The library seemed to compile and make install correctly, but when I ran the sql scripts to add the functions to a database, I came up with this issue:

# psql -d template1 -U postgres -f fuzzystrmatch.sql
SET
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
psql:fuzzystrmatch.sql:24: ERROR:  could not find function "difference" in file "/usr/lib/pgsql/fuzzystrmatch.so"
psql:fuzzystrmatch.sql:28: ERROR:  could not find function "dmetaphone" in file "/usr/lib/pgsql/fuzzystrmatch.so"
psql:fuzzystrmatch.sql:32: ERROR:  could not find function "dmetaphone_alt" in file "/usr/lib/pgsql/fuzzystrmatch.so"

Apparently, these three functions did not compile into the module. I'm not much of a C/C++ programmer, but according to the Makefile, both object files were included in the resulting fuzzystrmatch shared object, and the three functions in question where definitely present in fuzzystrmatch.c to begin with.

The following is a list of symbols inside the shared object:

# nm libfuzzystrmatch.so
00002ee4 A __bss_start
00000938 t call_gmon_start
00002ec4 D _codes
00002ee4 b completed.1
00002d7c d __CTOR_END__
00002d78 d __CTOR_LIST__
         U __ctype_b_loc@@GLIBC_2.3
         U __ctype_toupper_loc@@GLIBC_2.3
         U CurrentMemoryContext
         w __cxa_finalize@@GLIBC_2.1.3
00001a64 T difference
         U DirectFunctionCall1
00001ae8 t __do_global_ctors_aux
0000095c t __do_global_dtors_aux
00002ebc d __dso_handle
00002d84 d __DTOR_END__
00002d80 d __DTOR_LIST__
00002d8c A _DYNAMIC
00002ee4 A _edata
         U elog_finish
         U elog_start
00002ee8 A _end
         U errcode
         U errfinish
         U errmsg
         U errstart
00001b18 T _fini
000009b8 t frame_dummy
00001d74 r __FRAME_END__
00001bd4 r __func__.2
00001ca4 r __func__.3
00001bc4 r __func__.5
00002e78 A _GLOBAL_OFFSET_TABLE_
         w __gmon_start__
00000830 T _init
00002d88 d __JCR_END__
00002d88 d __JCR_LIST__
         w _Jv_RegisterClasses
00000f7e t .L1027
000011d7 t .L1034
00001340 t .L110
000012f5 t .L180
000013a8 t .L185
00000d8f t .L208
00000eac t .L253
00001132 t .L254
00001096 t .L266
0000102d t .L392
00000e27 t .L487
00000f90 t .L667
00000f1d t .L760
0000105e t .L774
00000f40 t .L785
0000117f t .L789
00000d55 t .L83
000012a4 t .L874
0000116a t .L930
000011fe t .L932
00000f5c t .L977
000013c7 t .L98
00001251 t .L982
00000a24 T levenshtein
00000bf4 T Lookahead
         U MemoryContextAlloc
000016ac T metaphone
00000c24 T _metaphone
00001cb4 r my_finfo.0
00001cb0 r my_finfo.1
00001bd0 r my_finfo.4
00001bc0 r my_finfo.6
00002ec0 d p.0
         U pg_detoast_datum
00001a4c T pg_finfo_difference
00000a0c T pg_finfo_levenshtein
00000bdc T pg_finfo_metaphone
000018f8 T pg_finfo_soundex
00001bac r Pg_magic_data.7
000009f4 T Pg_magic_func
00001a00 T soundex
00001910 t _soundex
00002ee0 d soundex_table
         U textin
         U textout

The compiler didn't return any errors during the build process, leaving me clueless as to why it's not working correctly. Any help would be greatly appreciated.

Thanks,
Kenaniah Cerny

[COMMITTERS] veil - veil: Initial release of changes for serialisation.

Log Message:
-----------
Initial release of changes for serialisation. All session variables
are now serialisable. Still need to do serialisation of the session
as a whole. Also comments are needed but regression tests look good.

Modified Files:
--------------
veil/demo:
funcs.sql (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/demo/funcs.sql.diff?r1=1.2&r2=1.3)
veil/docs:
Doxyfile (r1.11 -> r1.12)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/docs/Doxyfile.diff?r1=1.11&r2=1.12)
veil/regress:
regress.sh (r1.5 -> r1.6)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/regress/regress.sh.diff?r1=1.5&r2=1.6)
veil/src:
veil_bitmap.c (r1.4 -> r1.5)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/src/veil_bitmap.c.diff?r1=1.4&r2=1.5)
veil_config.c (r1.3 -> r1.4)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/src/veil_config.c.diff?r1=1.3&r2=1.4)
veil_datatypes.h (r1.5 -> r1.6)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/src/veil_datatypes.h.diff?r1=1.5&r2=1.6)
veil_funcs.h (r1.5 -> r1.6)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/src/veil_funcs.h.diff?r1=1.5&r2=1.6)
veil_interface.c (r1.7 -> r1.8)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/src/veil_interface.c.diff?r1=1.7&r2=1.8)
veil_interface.sqs (r1.3 -> r1.4)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/src/veil_interface.sqs.diff?r1=1.3&r2=1.4)
veil_shmem.c (r1.7 -> r1.8)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/src/veil_shmem.c.diff?r1=1.7&r2=1.8)
veil_variables.c (r1.5 -> r1.6)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/src/veil_variables.c.diff?r1=1.5&r2=1.6)
veil_version.h.in (r1.7 -> r1.8)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/veil/veil/src/veil_version.h.in.diff?r1=1.7&r2=1.8)

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

[BUGS] BUG #4281: some types of errors do not log statements

The following bug has been logged online:

Bug reference: 4281
Logged by: thomas
Email address: me@alternize.com
PostgreSQL version: 8.3.3
Operating system: Windows 2003
Description: some types of errors do not log statements
Details:

this isn't really a bug but rather a request for an improvement.

i've noticed that in some cases of errornous sql statements, the statement
itself is logged to the pg_log, in other cases it isn't:

logged:

2008-07-05 01:53:02 CEST 3528 486eade5.dc8 10.1.1.71(53082)ERROR: column
"xyz" does not exist at character 294
2008-07-05 01:53:02 CEST 3528 486eade5.dc8 10.1.1.71(53082)STATEMENT:
SELECT xyz FROM test


not logged:

2008-07-05 02:16:15 CEST 6644 486ebab4.19f4 127.0.0.1(1616)ERROR: invalid
byte sequence for encoding "UTF8": 0xc474
2008-07-05 02:16:15 CEST 6644 486ebab4.19f4 127.0.0.1(1616)HINT: This error
can also happen if the byte sequence does not match the encoding expected by
the server, which is controlled by "client_encoding".


it would be usefull to always see the sql statement that provoked the error.
especially in the case of wrong utf byte sequences it can get very difficult
to find the point of failure without more information.

thanks,
thomas

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

[pgadmin-hackers] First beta release of pgScript

Hi pgadmin hackers,

My Google Summer of Code project pgScript is going on pretty well. I
have just released a standalone beta version. As a reminder, my final
goal is to integrate pgScript into the Query Tool of pgAdmin and then
provide:
* Control-of-flow language
* Local variables
* Random data generators

The website with the documentation: http://pgscript.projects.postgresql.org
The page for download: http://pgfoundry.org/frs/?group_id=1000371

* pgScript-1.0-beta-1.exe : Windows binary file directly usable
* pgScript-1.0-beta-1.tar.gz : Source, can be compiled with g++
(tested in Slackware and MinGW)

I hope I will get your feedbacks,
Mickael

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

Re: [ADMIN] How many table scans in a delete...

On Fri, Jul 4, 2008 at 10:00 AM, Jessica Richard <rjessil@yahoo.com> wrote:
> I am just trying to understand how Postgres does its delete work.
>
> If I have a table testDad with a primary key on cola and no index on colb,
> and I have a kid table testKid with a foreign key to reference testDad but
> no index created on the foreign key column on table testKid.
>
> I have 10,000 rows in each table and I want to delete 5000 rows from the Dad
> table, of course , I have to kill all the kids in the Kid table first so
> that I won't get the constraint error.

Generally speaking, that's doing things wrong. It's generally easier
to use a cascading delete fk so that you don't have to delete the rows
from the kid table first.

> Now I am ready to run my delete command on the Dad table with the following
> command:
>
> delete from testDad where colb = 'abc';
>
> (supposed select count(*) from testDad where colb = 'abc' will give me 5000
> rows)
>
> Since I don't have any index on testDad.colb, I know it is going to do a
> table scan on the table testDad to find all the qualified rows for the
> delete.
>
> My question1: how many table scans will this single transaction do to find
> all 5000 qualified rows on the Dad table testDad? Does it scan the entire
> table once to get all qualified deletes? or it has to do the table scan 5000
> times on testDad?

One on table Dad.

> then, after all the 5000 qualified rows have been found on table testDad,
> the constraints between the Dad and Kid table will be checked against those
> 5000 qualified rows on table testDad.
>
> My question 2: does it take one qualified row at a time from the Dad table
> then do a table scan on the kid table for constraint check? In this case,
> it will have to do 5000 times of table scan on the kid table. very unlikely
> it will scan the kid table only once to do all constraint checking for 5000
> different primary values...

Maybe. Depends on how much memory it would take to run it with
various join methods. But the worst case scenario is a seq scan on
the child table for each row in Dad table. Which is why it's a good
idea to use indexes on FK fields.

--
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] Problema con caractere en un select

El día 4 de julio de 2008 17:21, Fernando Siguenza <fsigu@hotmail.com> escribió:
>
> Amigos yo nuevamente espero me puedan dar una mano ota ves muchas gracias a
> todos los que me han ayudado hasta el momento
> ahora tengo otro inconveniente, quiero realizar un select a la base de
> datos.
> tengo un campo de tipo cod varchar(3) y otro nom varchar(20) lo que quiero
> hacer es esto
> select * from tabla where cod like '%' or nom like '%' para que me retorne
> todos los valores.

quieres saber si cod o nom contiene el string "%" ???
--
TIP 7: no olvides aumentar la configuración del "free space map"

[pgsql-es-ayuda] Manejo de Imagenes

Un gusto Saludarlos
Quisiera molestarlos eh estado investigando la forma de poder insertar o
eliminar imagenes a una tabla desde el pgadmin y mandando a llamar las
imagenes a una maquina de W$, si alguien me pudiera ayudar con un
pequeño ejemplo para poder hacer mis pruebas.
Ademas eh tenido algunos inconvenientes con mi tabla de usuarios ya que
a veces mi aplicacion no llama bien a los usuarios para que se
autentiquen en la aplicacion y la solucion ah sido reindexar la tabla y
despues de ello no tengo inconvenientes, tengo ejecutando autovacuum y
creen ustedes que es recomendable poner en un Cron que reindexe todos
los dias mi tabla de usuarios.?

Utilizo
Postgresql 8.3
OS Leopard
De antemano Gracias.
Douglas Escobar

--
TIP 2: puedes desuscribirte de todas las listas simultáneamente
(envía "unregister TuDirecciónDeCorreo" a majordomo@postgresql.org)

[pgsql-es-ayuda] Problema con caractere en un select


Amigos yo nuevamente espero me puedan dar una mano ota ves muchas gracias a todos los que me han ayudado hasta el momento
ahora tengo otro inconveniente, quiero realizar un select a la base de datos.
tengo un campo de tipo cod varchar(3) y otro nom varchar(20) lo que quiero hacer es esto
select * from tabla where cod like '%' or nom like '%' para que me retorne todos los valores.

Pero al realizar la consulta me sale esto

ERROR: 42883: operator does not exist: @ character varying

estos con mis parametros

comando.Parameters.Add(new NpgsqlParameter("@AgeCod", NpgsqlDbType.Char, 3)).Value = cod + '%';
comando.Parameters.Add(new NpgsqlParameter("@AgeNom", NpgsqlDbType.Char, 20)).Value = nom + '%';

cual puede ser el error, he intentado concatenar con doble comillas y nada me da el mismo erro

Espero que me puedan ayudar. estoy usando Npgsql con c#

Saludos

Blog your life in 3D with Windows Live Writer. Get Windows Live-Free

RE: [pgsql-es-ayuda] Error en Insert


Gracias raul realmente ese rea el problema yo estaba considerando que era un valor de 12 enteros y 5 decimales.
Ahora que he corregido eso tengo otro incinveniente, quiero realizar un select a la base de datos.
tengo un campo de tipo cod varchar(3) y otro nom varchar(20) lo que quiero hacer es esto
select * from tabla where cod like '%' or nom like '%' para que me retorne todos los valores.

Pero al realizar la consulta me sale esto

ERROR: 42883: operator does not exist: @ character varying

esots con mis parametros
comando.Parameters.Add(new NpgsqlParameter("@AgeCod", NpgsqlDbType.Char, 3)).Value = cod + '%';
comando.Parameters.Add(new NpgsqlParameter("@AgeNom", NpgsqlDbType.Char, 20)).Value = nom + '%';

cual puede ser el error, he intentado concatenar con doble comillas y nada me da el mismo erro

Espero que me puedan ayudar.

Saludos

> From: ra_duque@yahoo.com.mx
> To: baron.rojo.cuerdas.de.acero@gmail.com; fsigu@hotmail.com
> CC: pgsql-es-ayuda@postgresql.org
> Subject: Re: [pgsql-es-ayuda] Error en Insert
> Date: Fri, 4 Jul 2008 12:03:40 +0200
>
>
>
> --------------------------------------------------
> From: 'Marcos Saldivar' <baron.rojo.cuerdas.de.acero@gmail.com>
> Sent: Friday, July 04, 2008 5:48 PM
> To: 'Fernando Siguenza' <fsigu@hotmail.com>
> Cc: <pgsql-es-ayuda@postgresql.org>
> Subject: Re: [pgsql-es-ayuda] Error en Insert
>
> > 2008/7/4 Fernando Siguenza <fsigu@hotmail.com>:
> >>
> >>
> >>> Date: Fri, 4 Jul 2008 10:03:22 -0400
> >>> From: baron.rojo.cuerdas.de.acero@gmail.com
> >>> To: fsigu@hotmail.com
> >>> Subject: Re: [pgsql-es-ayuda] Error en Insert
> >>> CC: pgsql-es-ayuda@postgresql.org
> >>>
> >>> 2008/7/4 Fernando Siguenza <fsigu@hotmail.com>:
> >>> > Amigos como estan, de nuevo recurro a su ayuda, estoy iniciandome en
> >>> > t¡esto
> >>> > de postgre y punto net, y tengo un problema, en la base de dartos
> >>> > tengo
> >>> > uan
> >>> > tabla y un campodefinido como numeric 12,5, pero al intentar realizar
> >>> > un
> >>> > insert desde el c# tengo me muestre este mensaje.
> >>> > ERROR: 22003: numeric field overflow.
> >>> >
> >>> > El campo que intendo insertar esta declarado igual como numeric, he
> >>> > probado
> >>> > con doble y nada, este es el parametro y comando que uso
> >>> >
> >>> > comando.Parameters.Add(new
> >>> > NpgsqlParameter('@saldo',NpgsqlDbType.Numeric,12)).Value=cos
> >>> >
> >>>
> >>> no se nada de punto net, pero el valor que quieres ingresar es mayor a
> >>> 9.999.999,99999 ???
> >>> --
> >>> TIP 6: ¿Has buscado en los archivos de nuestra lista de correo?
> >>> http://archives.postgresql.org/pgsql-es-ayuda
> >>
> >> No realmente solo para pruebas quise poner 12.5, y con este valor no me
> >> deja... Help Me Please
> >
> > Yo entendí que tenias un 'campo numeric(12,5)' de todas formas el error es
> > de que intentas almacenar un valor que no acepta la definición de la
> > columna,
> > te sugiero que imprimas el valor a insertar justo antes de hacer el
> > insert ya que
> > puede estar intentado ingresar un 12.49999999999 o algo asi.
> >
>
> Recuerda que un numeric (12, 5) quiere decir que son 7 números enteros y 5
> decimales.
>
> Atentamente,
>
> RAUL DUQUE
> BOGOTÁ, COLOMBIA
>
> > Al final la columna que te da el error en el insert como esta definida ???
> > --
> > TIP 6: ¿Has buscado en los archivos de nuestra lista de correo?
> > http://archives.postgresql.org/pgsql-es-ayuda
> >
> > __________ Information from ESET Smart Security, version of virus
> > signature database 3243 (20080704) __________
> >
> > The message was checked by ESET Smart Security.
> >
> > http://www.eset.com
> >
> >
> --
> TIP 5: ¿Has leído nuestro extenso FAQ?
> http://www.postgresql.org/docs/faqs.FAQ.html


Get your fix of news, sports, entertainment and more on MSN Mobile Get your fix now!

Re: [GENERAL] [Postgresql 8.2.3] autovacuum starting up even after disabling ?

Hey,

>> There is only one autovacuum process when it starts up. Below is the
>> correct output from one of the logs
>
> Good.
>
> Do you have entries in the pg_autovacuum table in this database?

No. Its empty.

TIA
Dushyanth

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

Re: [PATCHES] Relation forks & FSM rewrite patches

Alvaro Herrera wrote:
> I wonder if we could instead make vacuum write a new FSM tree from
> scratch, rather than updating it piecemeal.

I'd like to move away from that, as we'll hopefully get some sort of
partial vacuum capability soon.

We might want to have some sort of bulk update operation, though, so
that you could refresh FSM information for say 100 pages, or one FSM
page, at a time. That would reduce the WAL traffic of a VACUUM
significantly, though I'm not sure how significant that is to begin with.

--
Heikki Linnakangas
EnterpriseDB

http://www.enterprisedb.com

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

Re: [HACKERS] gsoc, text search selectivity and dllist enhancments

Tom Lane wrote:
> "Heikki Linnakangas" <heikki@enterprisedb.com> writes:
>> Tom Lane wrote:
>>> The data structure I'd suggest is a simple array of pointers
>>> to the underlying hash table entries. Since you have a predetermined
>>> maximum number of lexemes to track, you can just palloc the array once
>>> --- you don't need the expansibility properties of a list.
>
>> The number of lexemes isn't predetermined. It's 2 * (longest tsvector
>> seen so far), and we don't know beforehand how long the longest tsvector is.
>
> Hmm, I had just assumed without looking too closely that it was stats
> target times a fudge factor. What is the rationale for doing it as
> above? I don't think I like the idea of the limit varying over the
> course of the scan --- that means that lexemes in different places
> in the input will have significantly different probabilities of
> surviving to the final result.

Well, clearly if the list is smaller than the longest tsvector,
inserting all elements of that long tsvector will flush out all other
entries. Or if we throw away the newly inserted entries, some elements
will never have a chance to climb up the list. I'm not sure where the
"times two" figure comes from, maybe it's just a fudge factor, but the
bottom line is that the minimum size needed depends on the size of the
longest tsvector.

(Jan is offline until Saturday...)

--
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: [COMMITTERS] pgsql: Fix a couple of bugs in win32 shmem name generation: * Don't cut

Magnus Hagander wrote:
> Tom Lane wrote:

> > According to what you just told me, the original coding is storing the
> > name in a "local namespace", which presumably means it won't conflict
> > anyway. Ergo, the existing coding is simply broken and there's nothing
> > we can do about it.
>
> Local namespace = Session local, not process local. So it would properly
> protect against two processes started in the same session. One session
> is, for example, an interactive login. But not if they were started by
> different users, since they'd be in different sessions.

But those different users would not have access to the same set of
files, so it wouldn't work anyway, right?

--
Alvaro Herrera

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

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

Re: [GENERAL] [Postgresql 8.2.3] autovacuum starting up even after disabling ?

dushy escribió:

> My bad - I messed up the above. I grepped for autovacuum in my process
> logs and included all matches.

Ah, ok -- that makes more sense.

> There is only one autovacuum process when it starts up. Below is the
> correct output from one of the logs

Good.

Do you have entries in the pg_autovacuum table in this database?

--
Alvaro Herrera

http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

--
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] [QUESTION]Concurrent Access

tlevisilva@gmail.com ("Leví Teodoro da Silva") writes:
> Hi guys, How are you ?
> I am from Brazil and i work for a little company and it company is working is medium-big project and we want to use PostGree like the DataBase
> system, but i got some questions.
> I want to know if the PostGree has limitations about the concurrent access, because a lot of people will access this database at the same time.
> I want to know about the limitations, like how much memory do i have to use !? How big could be my database and how simultaneously access this
> database support ?

PostGree is a system I am not familiar with; this list is for
discussion of PostgreSQL, sometimes aliased as "Postgres," so I will
assume you are referring instead to PostgreSQL.

PostgreSQL does have limitations; each connection spawns a process,
and makes use of its own "work_mem", which has the result that the
more connections you configure a particular backend to support, the
more memory that will consume, and eventually your system will
presumably run out of memory.

The size of the database doesn't have as much to do with how many
users you can support as does the configuration that you set up.
--
select 'cbbrowne' || '@' || 'linuxfinances.info';
http://cbbrowne.com/info/lsf.html
Rules of the Evil Overlord #145. "My dungeon cell decor will not
feature exposed pipes. While they add to the gloomy atmosphere, they
are good conductors of vibrations and a lot of prisoners know Morse
code." <http://www.eviloverlord.com/>

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