Re: 7.4 Wishlist

Lists: pgsql-advocacypgsql-generalpgsql-hackers
From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: 7.4 Wishlist
Date: 2002-11-29 18:51:26
Message-ID: 088001c297d8$5260a230$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Hi guys,

Just out of interest, if someone was going to pay you to hack on Postgres
for 6 months, what would you like to code for 7.4?

My ones are:

* Compliant ADD COLUMN
* Integrated full text indexes
* pg_dump dependency ordering

What would you guys do? Even if it isn't feasible right now...

Chris


From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-29 21:54:20
Message-ID: 1038606859.1940.64.camel@rh72.home.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Christopher Kings-Lynne kirjutas R, 29.11.2002 kell 23:51:
> Hi guys,
>
> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?
>
> My ones are:
>
> * Compliant ADD COLUMN
> * Integrated full text indexes
> * pg_dump dependency ordering
>
> What would you guys do? Even if it isn't feasible right now...

As I don't have a permanent job starting next year (my main employer
went bust), I'm planning to do more on postgreSQL anyway (at least until
I run out of money ;)

I have done some (or sometimes a lot of) brain-twitching on items in the
following list, but very little actual useful coding on most.

My personal todo list is:

"Application server support"
----------------------------
* better XML integration

- XML(*) aggregate function returning XML representation of subquery

- XML input/output to/from tables

- XML searchable/indexable in fields)

* Overhaul of OO features (moving closer to SQL99)

- type/table inheritance,

table inheritance would be done using SQL99's UNDER and would be
single inheritance, stored in single logical table, possibly
subdivided in physical tables reusing our current huge table 1GB
split mechanisms

type inheritance would be done using SQL99's LIKE and would be
multiple inheritance and would reuse as much as possible the
current code for ADD/DROP/RENAME column

- check constraints would apply to both type and table inheritance

- pk/fk constraints would apply only to table inheritance

- types as base of tables,

- study feasibility of reference types,

- dynamic invocation of table function on queries over hierarchies

* WITH (as part of query/view)

* WITH RECURSIVE for recursive queries

* better NOTIFY (with optional argument, using shared memory
instead of tables)

General stuff
-------------

* making array types btree-indexable in a general way

* study feasibility of using SQL99's ARRAY syntax for arrays

Data warehousing
----------------
* bitmap indexes,

- using bitmap "indexes" internally for star joins

- real bitmap indexes

- clustered multiple bitmap indexes especially
clustering on group of bitmap indexes

* clustering in general - specifying pages to be filled only to a
certain percentage in clustered tables so that updated tuples can
be placed near original ones if needed and parallel vacuum can
then reclaim the space and keep table clustered with less shuffling.

* OLAP features
- WINDOW clause, PARTITION BY
- GROUPING SETS, ROLLUP, CUBE, ()

WAL-based master-slave replication
----------------------------------

* if someone is not doing it (which I hope is not true ;)

UNICODE / Localization
----------------------

* UTEXT, UCHAR, UVARCHAR types using IBM's ICU, stored in UTF-16 or SCSU

* fast LIKE, ILIKE, REGEX code for UTF-16, possibly lifted from python2

* field-level localization, again using ICU

FE/BE protocol
--------------

all can be worked on independently

* try to find a better wire protocol from existing ones (X-window
system seems simple enough, perhaps DB2's DRDA) or fix the existing
one for high performance (mainly make sure that as big chunks as
possible have preceeding length), make it easy to send
out-of-band/optional data (Notifications, info on actual query
performance (so one can visualize it for user), ...)

* standardize a fire-level binary protocol for field types (currently
whatever is stored is sent)

* work on making python use this protocol and port some postgres
datatypes (initially timestamp/date/time and varbit)to python

Really Dark Arts
------------------

* making backend internals available to a scripting language (for me it
means python ;) for making more parts (especially planner/optimizer)
more easily hackable

* using the stuff from previous point ;)

And that's all ;)

----------------
Hannu Krosing


From: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-29 22:29:32
Message-ID: 001301c297f6$d369f200$6700a8c0@terrielaptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

pg_dump, our upgrade process is painful enough having to do a dump, reload.
I think we should be able to guarantee (or at least let much closer to it)
that the process works in all cases.

Personally pg_upgrade would be even nicer.

----- Original Message -----
From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: <pgsql-hackers(at)postgresql(dot)org>
Sent: Friday, November 29, 2002 1:51 PM
Subject: [HACKERS] 7.4 Wishlist

> Hi guys,
>
> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?
>
> My ones are:
>
> * Compliant ADD COLUMN
> * Integrated full text indexes
> * pg_dump dependency ordering
>
> What would you guys do? Even if it isn't feasible right now...
>
> Chris
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>


From: Daniele Orlandi <daniele(at)orlandi(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-11-29 23:06:46
Message-ID: 3DE7F306.9060506@orlandi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Christopher Kings-Lynne wrote:
> Hi guys,
>
> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?

Replication. Replication. Replication. Replication. Replication.
Replication. Replication. Replication. Replication. Replication.
Replication. Replication. Replication. Replication. Replication.

Well, jokes apart, I think this is one of the most needed features to
me. Currently I'm using strange voodoo to replicate some tables on other
machines in order to spread load and resilency. Compared to what I am
doing now a good master to slave replication would be heaven.

I understand that a good replication is painful but in my experience, if
you start by integrating some rude, experimental implementation in the
mainstream PostgreSQL the rest will come by itself.

For example, RI was something I wouldn't consider "production level" in
7.2, but was a start, now in 7.3 is much much better, probably complete
in the most important parts.

Other wishes (not as important as the replication issue) are:

- Better granularity of security and access control, like in mysql.

- Ability to reset the state of an open backend, including aborting open
transaction to allow for better connection pooling and reusing, maybe
giving the client the ability to switch between users...

Bye!

--
Daniele Orlandi
Planet Srl


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Hannu Krosing" <hannu(at)tm(dot)ee>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-29 23:31:56
Message-ID: 096101c297ff$85bfcf30$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Wow Hannu - your list puts mine to shame!

> "Application server support"
> ----------------------------
> * better XML integration
>
> - XML(*) aggregate function returning XML representation of subquery
>
> - XML input/output to/from tables
>
> - XML searchable/indexable in fields)

I've had thoughts about XML too. Since XML is hierachical, imagine being
able to index xml using contrib/ltree or something!

ie. We create a new 'xml' column type.

We create a new indexing scheme for it based on ltree & gist.

You index the xml column.

Then you can do sort of XPath queries:

SELECT * FROM requests WHERE xml_xpath('/request/owner/name', datafield) =
'Bob';

And it would be indexed. Imaging being able to pull up all XML documents
that had certain properties, etc.

MS-SQL has a SELECT ... FOR XML clause, but we could always just create
function called xml_select() or something now that we can return recordsets.

Chris


From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 00:45:20
Message-ID: 5.1.0.14.0.20021130114032.06289438@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

At 10:51 AM 29/11/2002 -0800, Christopher Kings-Lynne wrote:
>* pg_dump dependency ordering

I've actually started working on pg_dump in the background, but if you want
to do it let me know.

In terms of things I would like to see:

- background/integrated vacuum (not just an overwriting storage manager)

- insert/update...returning

- function result caches -- assuming I can demonstrate that they are a Good
Thing.

- COPY TO/FROM with a list of columns (maybe we have it?) - it's useful for
making metadata changes then reloading data (Inserts are much slower).

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 03 5330 3172 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: <pgsql-hackers(at)postgresql(dot)org>, "Philip Warner" <pjw(at)rhyme(dot)com(dot)au>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 00:56:24
Message-ID: 09cf01c2980b$4fcd1de0$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> I've actually started working on pg_dump in the background, but if you
want
> to do it let me know.

Nah - you can do it! I don't have much time to code Postgres as it is.
I'll stick to working on making ADD COLUMN compliant.

> In terms of things I would like to see:
>
> - background/integrated vacuum (not just an overwriting storage manager)

Work has started on this already, which is neat.

> - insert/update...returning

That would be so useful for our web app where we're always needing to get
the primary key as opposed to oid. We keep needing to requery.

> - function result caches -- assuming I can demonstrate that they are a
Good
> Thing.
>
> - COPY TO/FROM with a list of columns (maybe we have it?) - it's useful
for
> making metadata changes then reloading data (Inserts are much slower).

We do already have it in 7.3:

http://developer.postgresql.org/docs/postgres/sql-copy.html

Chris


From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 01:22:03
Message-ID: 5.1.0.14.0.20021130122106.06437d08@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

At 04:56 PM 29/11/2002 -0800, Christopher Kings-Lynne wrote:
> >
> > - COPY TO/FROM with a list of columns (maybe we have it?) - it's useful
>for
> > making metadata changes then reloading data (Inserts are much slower).
>
>We do already have it in 7.3:

Excellent. Then I just need to add support in pg_dump.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 03 5330 3172 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: <pgsql-hackers(at)postgresql(dot)org>, "Philip Warner" <pjw(at)rhyme(dot)com(dot)au>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 01:33:09
Message-ID: 0a0401c29810$70852d70$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> > > - COPY TO/FROM with a list of columns (maybe we have it?) - it's
useful
> >for
> > > making metadata changes then reloading data (Inserts are much slower).
> >
> >We do already have it in 7.3:
>
> Excellent. Then I just need to add support in pg_dump.

Hmmm. I could have sworn that someone (Neil?) already did that?

Chris


From: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Locale-dependent case conversion in {identifier}
Date: 2002-11-30 01:40:39
Message-ID: 01df01c29811$7cea48b0$8016a8c0@apb.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Comment in {identifier} section in src/backend/parser/scan.l states:
[...]
* Note: here we use a locale-dependent case conversion,
* which seems appropriate under SQL99 rules, whereas
* the keyword comparison was NOT locale-dependent.
*/

And in ScanKeywordLookup() in src/backend/parser/keywords.c:

/*
* Apply an ASCII-only downcasing. We must not use tolower()
since it
* may produce the wrong translation in some locales (eg, Turkish),
* and we don't trust isupper() very much either. In an ASCII-based
* encoding the tests against A and Z are sufficient, but we also
* check isupper() so that we will work correctly under EBCDIC. The
* actual case conversion step should work for either ASCII or
EBCDIC.
*/

And I happen to have bad luck to use PostgreSQL with Turkish locale. And, as
you
may know our "I" is not your "I":

pgsql=# create table a(x char(1));
CREATE TABLE
pgsql=# grant SELECT ON a to PUBLIC;
ERROR: user "public" does not exist
pgsql=#

Oracle, the second best database I have does seem to convert relation names
in
locale-dependent fassion:

SQL> alter session set NLS_LANGUAGE='TURKISH';
Session altered.
SQL> create table a(x char(1));
Table created.
SQL> grant select on a to PUBLIC;
Grant succeeded.

Further, if I try to create a table in oracle using Turkish-specific
characters,
it is creating it alright, without trying to make them upper-case as it
usually does.

So I have changed lower-case conversion code in scan.l to make it purely
ASCII-based
as in keywords.c. Mini-patch is given below. Please bear in mind that it is
my first
attempt at hacking PostgreSQL code, so there can be some mistakes.

Regards,
Nick

diff -Nur src/backend/parser/scan.l.orig src/backend/parser/scan.l
--- src/backend/parser/scan.l.orig Sat Nov 30 02:54:06 2002
+++ src/backend/parser/scan.l Sat Nov 30 02:57:45 2002
@@ -551,9 +551,12 @@
ident = pstrdup(yytext);
for (i = 0; ident[i]; i++)
{
- if (isupper((unsigned char)
ident[i]))
- ident[i] =
tolower((unsigned char) ident[i]);
+ char ch =
ident[i];
+ if (ch >= 'A' && ch <= 'Z'
&& isupper((unsigned char) ch))
+ ch += 'a' - 'A';
+ ident[i] = ch;
}
+ ident[i] = '\0';
if (i >= NAMEDATALEN)
{
int len;


From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 01:40:56
Message-ID: 5.1.0.14.0.20021130123922.06285350@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

At 05:33 PM 29/11/2002 -0800, Christopher Kings-Lynne wrote:
>Hmmm. I could have sworn that someone (Neil?) already did that?

Not AFAICT - at least based on looking at the manual. I'll check the code.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 03 5330 3172 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Locale-dependent case conversion in {identifier}
Date: 2002-11-30 04:24:08
Message-ID: 25510.1038630248@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

"Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr> writes:
> So I have changed lower-case conversion code in scan.l to make it purely
> ASCII-based.
> as in keywords.c. Mini-patch is given below.

Rather than offering a patch, you need to convince us why our reading of
the SQL standard is wrong. ("Oracle does it that way" is not an
argument that will carry a lot of weight.)

SQL99 states that identifier case conversions are done on the basis of
the Unicode upper/lower case equivalences, so it seems clear that they
intend more than ASCII-only conversion for identifiers. Locale-based
conversion might not be an exact implementation of the spec, but it's
surely closer than ASCII-only.

regards, tom lane


From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 05:55:07
Message-ID: 20021130055507.GA18151@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Fri, Nov 29, 2002 at 10:51:26AM -0800, Christopher Kings-Lynne wrote:

> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?

Well, nobody is paying me, but I want to

- fix the btree problem leaking unused pages (I think I'm getting near,
I just haven't had free time during the last month). This one is a
must to me.

- try different regexp algorithms, compare efficiency. Both Henry
Spencer's new code for Tcl, and Baeza-Navarro shift-or approach (can
be much faster than "traditional" regex engines)
(do people care for allowing "search with errors", similar to what
agrep and nrgrep do?)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Nunca confiaré en un traidor. Ni siquiera si el traidor lo he creado yo"
(Barón Vladimir Harkonnen)


From: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Locale-dependent case conversion in {identifier}
Date: 2002-11-30 07:57:44
Message-ID: 3DE86F78.9000905@apb.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

By no means I would try to convince that your reading of
the SQL standards is wrong. What I am trying to tell is
that Turkish alphabet is broken beyond repair. And since
there is absolutely no way to change our alphabet, we
may can code a workaround in the code.

So i do not claim that your code is wrong. It is
behaviang according to specification. But unfortunately
folks at SQL99 probably were not aware of the woes
of Turkish "I".

The very special case of letter "I" in Turkish is not
only PostgreSQL's problem. Many java programs have
failed miserably trying to open files with "I"s in
pathnames.

So basically, there are two letters "I" in Trukish.
The wone is with dot on top and another is without.
The with dot on top walways has the dot and the one
without never has it. Simple. The problem is
with the standard Latin "I". So why small "i" does
have a dot and capital "I" does not?

Standard conversion is
Lower: "I" -> "y'" and "Y'" -> "i".
Upper: "y'" -> "I" and "i" -> "Y'".
(font may not be displayed correctly in your mail reader)

Historically programs that operate in Turkish locale have
chosen to hardcode the capitalisation of "i" in system
messages and identifier names like this:

Lower: "I" -> "i" and "Y'" -> "i".
Upper: "y'" -> "I" and "i" -> "I".

With this, no matter what kind of "I" you used in names,
it is always going to end up a valid ASCII character.

Would it be acceptable if I submit a path that applies this
special logic in src/backend/parser/scan.l if the locale is "tr_TR"?

Because for many folks setting locale to Turkish would
render their database unusable. For, god forbid, if your
sql has a column name written in capitlas including "I".
It is not working. So I deeply believe that PostgreSQL community
have to provide a workaround for this problem.

So what should I do?

Best regards,
Nick

Tom Lane wrote:
> "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr> writes:
>
>>So I have changed lower-case conversion code in scan.l to make it purely
>>ASCII-based.
>>as in keywords.c. Mini-patch is given below.
>
>
> Rather than offering a patch, you need to convince us why our reading of
> the SQL standard is wrong. ("Oracle does it that way" is not an
> argument that will carry a lot of weight.)
>
> SQL99 states that identifier case conversions are done on the basis of
> the Unicode upper/lower case equivalences, so it seems clear that they
> intend more than ASCII-only conversion for identifiers. Locale-based
> conversion might not be an exact implementation of the spec, but it's
> surely closer than ASCII-only.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly


From: Neil Conway <neilc(at)samurai(dot)com>
To: Daniele Orlandi <daniele(at)orlandi(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 08:06:16
Message-ID: 1038643576.367.9.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Fri, 2002-11-29 at 18:06, Daniele Orlandi wrote:
> - Better granularity of security and access control, like in mysql.

Can you be more specific on exactly what features you'd like to see?

> - Ability to reset the state of an open backend, including aborting open
> transaction to allow for better connection pooling and reusing

IIRC, it's been suggested that we can implement this by passing back the
transaction state as part of the FE/BE protocol -- if we're doing a
protocol change for 7.4, this could be part of it.

Cheers,

Neil
--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC


From: Neil Conway <neilc(at)samurai(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 08:18:30
Message-ID: 1038644310.370.24.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Fri, 2002-11-29 at 13:51, Christopher Kings-Lynne wrote:
> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?

Here's some of my current TODO list:

* FOR EACH STATEMENT triggers (already done)

* column lists for UPDATE triggers (will be done soon)

* Improve the buffer manager's replacement algorithm (LRU-K, perhaps?)

* Implement support for hugetlb pages on linux 2.5

* Finish off PITR (if no one else does ...)

* Asynchronous notification improvements (optional message, store
notifications in shared memory)

* Rowtype assignment in PL/PgSQL

Cheers,

Neil
--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC


From: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
To: pgsql-hackers(at)postgresql(dot)org, EG <EG(at)CYBERTEC(dot)at>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 09:19:53
Message-ID: 3DE882B9.3080808@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

What I'd like to have in future versions of PostgreSQL:

- replication, replication, ... (you have seen that before). i guess
most people would like to see that.

- a dblink like system for connecting to remote database systems
(not just PostgreSQL???)
something like CREATE REMOTE VIEW would be damn good.
it would solve many problem when it comes to migration

- tablespaces (the directory based stuff which has been discussed on
the list)

- somebody has mentioned XML before. the XPath stuff would be really
cool

- PL/Sh should be in contrib. i know that the core team has decided
not to put it in the core but contrib would be fine (I keep forgetting
the URL of Peters website :( ...)

- packages: is there a way to define a set of functions as a package
so that they can be removed using just one DROP PACKAGE or so? would be
nice for huge projects

- urgent: being able to use PL/Perl in combination with SPI (There
is a Pg-SPI but it is 0.01 - see
http://search.cpan.org/author/APILOS/DBD-PgSPI-0.01/PgSPI.pm). a full
and reliable implementation would be fine.

- preforking for faster startup

- declare MySQL as evil *g*.

Thanks a lot :)

Hans


From: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 09:35:00
Message-ID: 3DE88644.9050709@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Oops, there is something I have forgotten:

- "nicing" backends: this would be nice for administration tasks

- CREATE DATABASE ... WITH MAXSIZE (many providers would like to see
that; quotas are painful in this case - especially when porting the
database to a different or a second server)

Hans


From: "Al Sutton" <al(at)alsutton(dot)com>
To: "Daniele Orlandi" <daniele(at)orlandi(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 10:58:11
Message-ID: 00f301c2985f$79f13080$0100a8c0@cloud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

My list is;

Point to Point and Broadcast replication
----------------------------------------
With point to point you specify multiple endpoints, with broadcast you can
specify a subnet address and the updates are broadcast over that subnet.

The difference being that point to point works well for cross network
replication, or where you have a few replicants. I have multiple database
servers which could have a deadicated class C network that they are all on,
by broadcasting updates you can cutdown the amount of traffic on that net by
a factor of n minus 1 (where n is the number of servers involved).

Ability to use raw partitions
----------------------------

I've not seen an install of PostgreSQL yet that didn't put the database
files onto a filesystem, so I'm assuming it's the only way of doing it. By
using the filesystem the files are at the mercy of filesystem handler code
as to where they end up on the disk, and thus the speed of access will
always have some dependancy on the speed of the filesystem.

With a raw partition it would be possible to use two devices (e.g. /dev/hde
and /dev/hdg on an eight channel ide linux box), and PostgreSQL could then
ensure the WALs were located on one the disk with the entries running
sequentally, and that the database files were located on the other disk in
the most appropriate location (e.g. index data starting near the center of
the disk, and user table data starting near the outside).

Win32 Port
------------
I've explained the reasons before. Apart from that it's always useful to
open PostgreSQL up to a larger audience.

----- Original Message -----
From: "Daniele Orlandi" <daniele(at)orlandi(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Sent: Friday, November 29, 2002 11:06 PM
Subject: [mail] Re: [HACKERS] 7.4 Wishlist

> Christopher Kings-Lynne wrote:
> > Hi guys,
> >
> > Just out of interest, if someone was going to pay you to hack on
Postgres
> > for 6 months, what would you like to code for 7.4?
>
> Replication. Replication. Replication. Replication. Replication.
> Replication. Replication. Replication. Replication. Replication.
> Replication. Replication. Replication. Replication. Replication.
>
> Well, jokes apart, I think this is one of the most needed features to
> me. Currently I'm using strange voodoo to replicate some tables on other
> machines in order to spread load and resilency. Compared to what I am
> doing now a good master to slave replication would be heaven.
>
> I understand that a good replication is painful but in my experience, if
> you start by integrating some rude, experimental implementation in the
> mainstream PostgreSQL the rest will come by itself.
>
> For example, RI was something I wouldn't consider "production level" in
> 7.2, but was a start, now in 7.3 is much much better, probably complete
> in the most important parts.
>
> Other wishes (not as important as the replication issue) are:
>
> - Better granularity of security and access control, like in mysql.
>
> - Ability to reset the state of an open backend, including aborting open
> transaction to allow for better connection pooling and reusing, maybe
> giving the client the ability to switch between users...
>
> Bye!
>
> --
> Daniele Orlandi
> Planet Srl
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>


From: Kaare Rasmussen <kar(at)kakidata(dot)dk>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 11:07:09
Message-ID: 200211301107.gAUB79O03417@bering.webline.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> And that's all ;)
> ----------------
> Hannu Krosing

- and what will you do after January? ;-)

Just kidding. I hope you have a big fat bank account if you want to finish
all that!

--
Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582
Kaki Data tshirts, merchandize Fax: 3816 2501
Howitzvej 75 Åben 12.00-18.00 Email: kar(at)kakidata(dot)dk
2000 Frederiksberg Lørdag 12.00-16.00 Web: www.suse.dk


From: "Alice Lottini" <alice_lottini(at)yahoo(dot)it>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Mailing List PgSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 11:15:15
Message-ID: 000501c29862$14b5f040$970ab9d5@polito.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Hi,
although I'm just a novice in this mailing list I'd like to give my
contribution to the 7.4 wishlist.
I'd like to add to the PostgreSQL code some new low-level, primitive
fuctions in order to give native support to FP-based algorithms for rule
mining (Frequent Pattern Growth and extensions such as CLOSET and so on).
As a matter of fact, this is more than just a wish to me... this is the task
I have to accomplish for my thesis (I'm going to degree in Informatics
Engineering at the Politecnico di Torino, Italy on next July), and so I can
assure you that this will be done (and working) by the end of June.
Obviously, any kind of hint and suggestion by you guruz is welcome! :)
Bye, alice

----- Original Message -----
From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: <pgsql-hackers(at)postgresql(dot)org>
Sent: Friday, November 29, 2002 7:51 PM
Subject: [HACKERS] 7.4 Wishlist

> Hi guys,
>
> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?
>
> My ones are:
>
> * Compliant ADD COLUMN
> * Integrated full text indexes
> * pg_dump dependency ordering
>
> What would you guys do? Even if it isn't feasible right now...
>
> Chris
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

______________________________________________________________________
Scarica il nuovo Yahoo! Messenger: con webcam, nuove faccine e tante altre novità.
http://it.yahoo.com/mail_it/foot/?http://it.messenger.yahoo.com/


From: snpe <snpe(at)snpe(dot)co(dot)yu>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 11:31:07
Message-ID: 200211301131.07229.snpe@snpe.co.yu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Friday 29 November 2002 06:51 pm, Christopher Kings-Lynne wrote:
> Hi guys,
>
> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?
>
> My ones are:
>
> * Compliant ADD COLUMN
> * Integrated full text indexes
> * pg_dump dependency ordering
>
> What would you guys do? Even if it isn't feasible right now...
>
> Chris
>

My wishlist :
- savepoint
- cursor out of a transaction
- distributed databases and replication (two phase commit)
- only share lock in foreign keys
- prepare/execute on backend level
- error in a statement break a statement, not complete transaction

regards
Haris Peco


From: Horacio Miranda <hmiranda(at)yale(dot)cl>
To: pgsql-hackers(at)postgresql(dot)org
Subject: about ODBC
Date: 2002-11-30 14:54:11
Message-ID: 3DE8D113.7942A2C9@yale.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Someone know any ODBC driver without problem with UPPER CASE ?
--
Saludos Horacio Miranda.
hmiranda(at)yale(dot)cl
------------------------------------------------------------
PostgreSQL. Because life's too short to learn Oracle. :)
Billy O'Connor

IBM --> Immer Backup Machen


From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Locale-dependent case conversion in {identifier}
Date: 2002-11-30 15:41:17
Message-ID: 1038670876.9216.2.camel@huli
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Sat, 2002-11-30 at 01:40, Nicolai Tufar wrote:
> And I happen to have bad luck to use PostgreSQL with Turkish locale. And, as
> you
> may know our "I" is not your "I":
>
> pgsql=# create table a(x char(1));
> CREATE TABLE
> pgsql=# grant SELECT ON a to PUBLIC;
> ERROR: user "public" does not exist
> pgsql=#
>
> Oracle, the second best database I have does seem to convert relation names
> in
> locale-dependent fassion:
>
> SQL> alter session set NLS_LANGUAGE='TURKISH';
> Session altered.
> SQL> create table a(x char(1));
> Table created.
> SQL> grant select on a to PUBLIC;
> Grant succeeded.

could it just be that we store identifiers in lower case, whereas most others
(including SQL spec IIRC)have them in upper case ?

Could you try the grant in both databases also in lower case ?

i.e.:

grant select on a to public;

------------------
Hannu


From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Locale-dependent case conversion in {identifier}
Date: 2002-11-30 15:47:58
Message-ID: 1038671277.9209.8.camel@huli
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Sat, 2002-11-30 at 07:57, Nicolai Tufar wrote:
> With this, no matter what kind of "I" you used in names,
> it is always going to end up a valid ASCII character.
>
> Would it be acceptable if I submit a path that applies this
> special logic in src/backend/parser/scan.l if the locale is "tr_TR"?
>
> Because for many folks setting locale to Turkish would
> render their database unusable. For, god forbid, if your
> sql has a column name written in capitlas including "I".
> It is not working. So I deeply believe that PostgreSQL community
> have to provide a workaround for this problem.
>
> So what should I do?

In SQL in general and in postgreSQL in particular, you can always use
quoted names and thus escape the stupidities of case conversion:

grant SELECT ON "a" to "public";

should work everywhere (except Oracle and other DB's where it should be
grant SELECT ON "A" to "PUBLIC";
)

I can't help you on Win32/VMS filenames ;)

---------------
Hannu


From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 15:57:52
Message-ID: 1038671872.9209.14.camel@huli
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Sat, 2002-11-30 at 05:55, Alvaro Herrera wrote:
> On Fri, Nov 29, 2002 at 10:51:26AM -0800, Christopher Kings-Lynne wrote:
>
> > Just out of interest, if someone was going to pay you to hack on Postgres
> > for 6 months, what would you like to code for 7.4?
>
> Well, nobody is paying me, but I want to
>
> - fix the btree problem leaking unused pages (I think I'm getting near,
> I just haven't had free time during the last month). This one is a
> must to me.
>
> - try different regexp algorithms, compare efficiency. Both Henry
> Spencer's new code for Tcl, and Baeza-Navarro shift-or approach (can
> be much faster than "traditional" regex engines)

Perhaps bigger effect could be possible if we could could make
LIKE/REGEXP use indexes - perhaps some approach based on trigrams could
be usable here ?

> (do people care for allowing "search with errors", similar to what
> agrep and nrgrep do?)

Yes, especially if integrated with some full text index scheme.

--
Hannu Krosing <hannu(at)tm(dot)ee>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Locale-dependent case conversion in {identifier}
Date: 2002-11-30 16:02:19
Message-ID: 160.1038672139@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr> writes:
> Historically programs that operate in Turkish locale have
> chosen to hardcode the capitalisation of "i" in system
> messages and identifier names like this:

> Lower: "I" -> "i" and "Y'" -> "i".
> Upper: "y'" -> "I" and "i" -> "I".

If that's the behavior you want, why don't you set up a variant locale
definition that does it that way? That would fix *all* your locale-
dependent programs, not just Postgres ...

> Would it be acceptable if I submit a path that applies this
> special logic in src/backend/parser/scan.l if the locale is "tr_TR"?

It really seems like an inappropriate wart to me :-(

> Because for many folks setting locale to Turkish would
> render their database unusable. For, god forbid, if your
> sql has a column name written in capitlas including "I".
> It is not working.

I am not seeing why this is any worse than the universal problems of
using upper-case letters without double-quoting 'em. If you
consistently spell the name the same way, you will not have a problem;
if you don't, you might have a problem, but why is it worse than
anyone else's?

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: hs(at)cybertec(dot)at
Cc: pgsql-hackers(at)postgresql(dot)org, EG <EG(at)cybertec(dot)at>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 16:13:51
Message-ID: 200211301613.gAUGDpE21164@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Hans-Jrgen Schnig wrote:
> What I'd like to have in future versions of PostgreSQL:
>
> - PL/Sh should be in contrib. i know that the core team has decided
> not to put it in the core but contrib would be fine (I keep forgetting
> the URL of Peters website :( ...)

I like PL/Sh too, but too many people are concerned it isn't
transaction-safe and has poor performance. I want it in /contrib, but
Peter, the author, doesn't want it in there, so there isn't much we can
do.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: hs(at)cybertec(dot)at, pgsql-hackers(at)postgresql(dot)org, EG <EG(at)cybertec(dot)at>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 17:33:23
Message-ID: 200211301733.gAUHXNm29075@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Hannu Krosing wrote:
> On Sat, 2002-11-30 at 16:13, Bruce Momjian wrote:
> > Hans-J?rgen Sch?nig wrote:
> > > What I'd like to have in future versions of PostgreSQL:
> > >
> > > - PL/Sh should be in contrib. i know that the core team has decided
> > > not to put it in the core but contrib would be fine (I keep forgetting
> > > the URL of Peters website :( ...)
>
> You could put the URL in /contrib

The URL used to be main site under:

http://www.us.postgresql.org/interfaces.html

but I don't see it there anymore. In fact, that page needs updating
because some projects have moved.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 17:47:53
Message-ID: 20021130094436.N28859-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


On Fri, 29 Nov 2002, Christopher Kings-Lynne wrote:

> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?

> What would you guys do? Even if it isn't feasible right now...

Hmm, mine would probably be fixing foreign keys (along with making it
work with inheritance and match partial) and check constraints with
subselects.


From: "Gabor Csuri" <gcsuri(at)auto999(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 18:58:51
Message-ID: NGBBLBOMOLDNJFMPIGKLIEMACGAA.gcsuri@auto999.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Hi All,

here is my wishlist /very short/ :

* Oracle syntax support in OUTER JOIN

Thanks, Gabor

> Hans-Jürgen Schönig wrote:
> > What I'd like to have in future versions of PostgreSQL:
> >
> > - PL/Sh should be in contrib. i know that the core team has decided
> > not to put it in the core but contrib would be fine (I keep forgetting
> > the URL of Peters website :( ...)
>
> I like PL/Sh too, but too many people are concerned it isn't
> transaction-safe and has poor performance. I want it in /contrib, but
> Peter, the author, doesn't want it in there, so there isn't much we can
> do.
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square,
> Pennsylvania 19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html


From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: hs(at)cybertec(dot)at, pgsql-hackers(at)postgresql(dot)org, EG <EG(at)cybertec(dot)at>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 19:02:35
Message-ID: 1038682954.9216.22.camel@huli
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Sat, 2002-11-30 at 16:13, Bruce Momjian wrote:
> Hans-Jürgen Schönig wrote:
> > What I'd like to have in future versions of PostgreSQL:
> >
> > - PL/Sh should be in contrib. i know that the core team has decided
> > not to put it in the core but contrib would be fine (I keep forgetting
> > the URL of Peters website :( ...)

You could put the URL in /contrib

> I like PL/Sh too, but too many people are concerned it isn't
> transaction-safe and has poor performance. I want it in /contrib, but
> Peter, the author, doesn't want it in there, so there isn't much we can
> do.

perhaps the URL and a file WARNING.TXT ;)

--
Hannu Krosing <hannu(at)tm(dot)ee>


From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Hannu Krosing <hannu(at)tm(dot)ee>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 19:24:49
Message-ID: Pine.GSO.4.44.0211302223160.2586-100000@ra.sai.msu.su
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Me and Teodor hope to work on contrib/ltree to add support for sort of
xml. Any ideas are welcome !

Regards,

Oleg
On Fri, 29 Nov 2002, Christopher Kings-Lynne wrote:

> Wow Hannu - your list puts mine to shame!
>
> > "Application server support"
> > ----------------------------
> > * better XML integration
> >
> > - XML(*) aggregate function returning XML representation of subquery
> >
> > - XML input/output to/from tables
> >
> > - XML searchable/indexable in fields)
>
> I've had thoughts about XML too. Since XML is hierachical, imagine being
> able to index xml using contrib/ltree or something!
>
> ie. We create a new 'xml' column type.
>
> We create a new indexing scheme for it based on ltree & gist.
>
> You index the xml column.
>
> Then you can do sort of XPath queries:
>
> SELECT * FROM requests WHERE xml_xpath('/request/owner/name', datafield) =
> 'Bob';
>
> And it would be indexed. Imaging being able to pull up all XML documents
> that had certain properties, etc.
>
> MS-SQL has a SELECT ... FOR XML clause, but we could always just create
> function called xml_select() or something now that we can return recordsets.
>
> Chris
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83


From: bpalmer <bpalmer(at)crimelabs(dot)net>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 20:06:15
Message-ID: Pine.BSO.4.44.0211301505360.27908-100000@mizer.crimelabs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> * Compliant ADD COLUMN

I've missed the thread (if there was one), how is it non-compliant?

Thanks,
- Brandon

----------------------------------------------------------------------------
c: 917-697-8665 h: 201-798-4983
b. palmer, bpalmer(at)crimelabs(dot)net pgp:crimelabs.net/bpalmer.pgp5


From: Rod Taylor <rbt(at)rbt(dot)ca>
To: bpalmer <bpalmer(at)crimelabs(dot)net>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 20:13:48
Message-ID: 1038687228.72409.76.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Sat, 2002-11-30 at 15:06, bpalmer wrote:
> > * Compliant ADD COLUMN
>
> I've missed the thread (if there was one), how is it non-compliant?

ALTER TABLE .. ADD COLUMN colname integer DEFAULT 42 NOT NULL
CHECK(colname <= 42) REFERENCES tab2 ON DELETE CASCADE;

Can't do the above in a single statement. It takes five statements.

It's something I'd like to see added as well.

--
Rod Taylor <rbt(at)rbt(dot)ca>


From: Dan Langille <dan(at)langille(dot)org>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Hannu Krosing <hannu(at)tm(dot)ee>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 20:19:09
Message-ID: 20021130151746.S28227-100000@m20.unixathome.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Can you see this tying in with my recent hack of contrib/ltree to work
with a wider range of node names?

On Sat, 30 Nov 2002, Oleg Bartunov wrote:

> Me and Teodor hope to work on contrib/ltree to add support for sort of
> xml. Any ideas are welcome !


From: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
To: "Hannu Krosing" <hannu(at)tm(dot)ee>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Locale-dependent case conversion in {identifier}
Date: 2002-11-30 21:18:34
Message-ID: 003a01c298b6$0ae42970$8016a8c0@apb.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

----- Original Message -----
From: "Hannu Krosing" <hannu(at)tm(dot)ee>
To: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Sent: Saturday, November 30, 2002 5:41 PM
Subject: Re: [HACKERS] Locale-dependent case conversion in {identifier}

[ ... ]
>
> could it just be that we store identifiers in lower case, whereas most
others
> (including SQL spec IIRC)have them in upper case ?

That seem to be the case. All the databases I used, automaticaly convert
identifiers to upper case.
And they all do it using ASCII-only conversion.

>
> Could you try the grant in both databases also in lower case ?
>
> i.e.:
>
> grant select on a to public;

The statement works in both databases. But the problem is that it was
pg_dumpall who created SQL statements with PUBLIC. Why
pg_dumpall does not enclose identifiers in quotes, like:

REVOKE ALL ON TABLE "tamara2" FROM "public";
insted of
REVOKE ALL ON TABLE tamara2 FROM PUBLIC;
as it does now.

I will make an attempt to modify pg_dump accordingly, and will send a
patch to the list.

Regards,
Nic


From: Joe Conway <mail(at)joeconway(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 21:44:40
Message-ID: 3DE93148.2050608@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Christopher Kings-Lynne wrote:
> Hi guys,
>
> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?
>
> My ones are:
>
> * Compliant ADD COLUMN
> * Integrated full text indexes
> * pg_dump dependency ordering
>
> What would you guys do? Even if it isn't feasible right now...

Well, I might as well join in the fun. Here's my personal TODO for 7.4 (with
much wishing that I'll actually have the time to do most if not all of it ;-))

* continue to improve usability of bytea datatype
- easier explicit casting between bytea and text
* stored procedures (procedures not functions)
- no return value, but allow projection of results similar to SHOW ALL
(i.e. also similar to MSSQL and Sybase)
- CREATE PROCEDURE sp_my_stored_proc() AS '...' LANGUAGE '...';
- CALL sp_my_stored_proc;
* array related improvements (note: some of this may exist in contrib as
I haven't looked too close yet, but I'm aiming for these to be internal
backend functions)
- function to return users in a group as rows instead of as an array
- generic table function to unspool an array into rows [and columns for
2 dim array]
- split -- split string into array on delimiter
- implode -- join array elements into a string using given string delimiter
- array_contains -- Return TRUE if a value exists in an array
- array_search -- Searches the array for a given value and returns the
corresponding key if successful
* PL/R
- new PL interface to R (statistical analysis package based on the S
language)
* improvements to contrib/tablefunc
- enhanced crosstab functionality
- possibly enhanced connectby functionality (may not be worth it if
RECURSIVE JOIN functionality makes it into 7.4)
* improvements to dblink
- see details on other recently sent message (ability to connect to
non-PostgreSQL databases)
* revisit table function scan issues (i.e. tuplestore vs streaming vs
portal based)

Things not on my list, but that I'm keenly interested in (in no particular order):
- native win32 port
- two-phase commit
- PITR
- replication
- recursive joins (CONNECT BY PRIOR ... START WITH ...)

Joe


From: David Wheeler <david(at)wheeler(dot)net>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 22:35:32
Message-ID: 093C0FCD-04B4-11D7-8D38-0003931A964A@wheeler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Saturday, November 30, 2002, at 01:44 PM, Joe Conway wrote:

> * continue to improve usability of bytea datatype
> - easier explicit casting between bytea and text

This wouldn't happen to include the idea of somehow eliminating the
difference between how text strings are delimited and how bytea strings
are delimited, would it?

Best,

David

--
David Wheeler AIM: dwTheory
david(at)wheeler(dot)net ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory(at)jabber(dot)org


From: ow <oneway_111(at)yahoo(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-11-30 23:39:48
Message-ID: 20021130233948.72218.qmail@web21412.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Cross-db queries.

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


From: Joe Conway <mail(at)joeconway(dot)com>
To: David Wheeler <david(at)wheeler(dot)net>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-01 00:14:12
Message-ID: 3DE95454.7040902@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

David Wheeler wrote:
> On Saturday, November 30, 2002, at 01:44 PM, Joe Conway wrote:
>> * continue to improve usability of bytea datatype
>> - easier explicit casting between bytea and text
>
> This wouldn't happen to include the idea of somehow eliminating the
> difference between how text strings are delimited and how bytea strings
> are delimited, would it?

Not quite sure what you mean by delimiter -- are you referring to double
escaping vs single escaping?

Joe


From: David Wheeler <david(at)wheeler(dot)net>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-01 00:25:57
Message-ID: 75C7C67E-04C3-11D7-8D38-0003931A964A@wheeler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Saturday, November 30, 2002, at 04:14 PM, Joe Conway wrote:

> Not quite sure what you mean by delimiter -- are you referring to
> double
> escaping vs single escaping?

Oh crap, yes, that's exactly what I meant.

s/delimited/escaped/g;

Sorry. :-)

David

--
David Wheeler AIM: dwTheory
david(at)wheeler(dot)net ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory(at)jabber(dot)org


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Joe Conway" <mail(at)joeconway(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-01 00:27:50
Message-ID: 0cbb01c298d0$7b6e7050$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> > My ones are:
> >
> > * Compliant ADD COLUMN
> > * Integrated full text indexes
> > * pg_dump dependency ordering
> >
> > What would you guys do? Even if it isn't feasible right now...

Actually - I think I might add MODIFY COLUMN to that list. Just look at the
list of poor buggers in the interactive docs who can't change their column
types. Guess that means I'd need to bring in attlognum's tho.

Chris


From: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 01:45:46
Message-ID: Pine.GSO.4.10.10212010328110.26370-100000@prana
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

src/bin/pg_dump/pg_dump.c happen to have hard-coded PUBLIC role name.
It completly breaks dumps when run with Turksh locale setting. In my
opinion making it lower-case would do much good and no harm. A mini
patch is given below.

On the other hand, I was thinking about wrapping all the identifiers in
dump files in single quotes. It is done in "SET SESSION AUTHORIZATION"
clause. Is there a reason for not doing this with table and colum names?

Regards,
Nic

*** ./src/bin/pg_dump/pg_dump.c.orig Sun Dec 1 03:23:56 2002
--- ./src/bin/pg_dump/pg_dump.c Sun Dec 1 03:24:48 2002
***************
*** 4918,4924 ****
* wire-in knowledge about the default public privileges for different
* kinds of objects.
*/
! appendPQExpBuffer(sql, "REVOKE ALL ON %s %s FROM PUBLIC;\n",
type, name);

/* Make a working copy of acls so we can use strtok */
--- 4918,4924 ----
* wire-in knowledge about the default public privileges for different
* kinds of objects.
*/
! appendPQExpBuffer(sql, "REVOKE ALL ON %s %s FROM public;\n",
type, name);

/* Make a working copy of acls so we can use strtok */
***************
*** 4980,4986 ****
if (eqpos == tok)
{
/* Empty left-hand side means "PUBLIC" */
! appendPQExpBuffer(sql, "PUBLIC;\n");
}
else if (strncmp(tok, "group ", strlen("group ")) == 0)
appendPQExpBuffer(sql, "GROUP %s;\n",
--- 4980,4986 ----
if (eqpos == tok)
{
/* Empty left-hand side means "PUBLIC" */
! appendPQExpBuffer(sql, "public;\n");
}
else if (strncmp(tok, "group ", strlen("group ")) == 0)
appendPQExpBuffer(sql, "GROUP %s;\n",


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 02:05:29
Message-ID: 002501c298de$201cb870$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> src/bin/pg_dump/pg_dump.c happen to have hard-coded PUBLIC role name.
> It completly breaks dumps when run with Turksh locale setting. In my
> opinion making it lower-case would do much good and no harm. A mini
> patch is given below.

Hmmmm...does putting double quotes (eg. "PUBLIC") around the public word fix
it?

> On the other hand, I was thinking about wrapping all the identifiers in
> dump files in single quotes. It is done in "SET SESSION AUTHORIZATION"
> clause. Is there a reason for not doing this with table and colum names?

You can't put single quotes around table and column names. You need to use
double quotes as they are identifiers rather than literals.

Bear in mind that some improvements have been made in Postgres 7.3 with
regards to quoting, so have you checked 7.3?

Chris


From: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 02:29:27
Message-ID: 00c301c298e1$785dc530$8016a8c0@apb.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

----- Original Message -----
From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>; <pgsql-hackers(at)postgresql(dot)org>
Sent: Sunday, December 01, 2002 4:05 AM
Subject: Re: [HACKERS] Hard-coded PUBLIC in pg_dump

>
> Hmmmm...does putting double quotes (eg. "PUBLIC") around the public word
fix
> it?

No:
apb=> GRANT SELECT ON TABLE maras2.esya TO "PUBLIC";
ERROR: user "PUBLIC" does not exist
apb=> GRANT SELECT ON TABLE maras2.esya TO 'PUBLIC';
ERROR: parser: parse error at or near "'PUBLIC'" at character 38
apb=> GRANT SELECT ON TABLE maras2.esya TO public;
GRANT
apb=>

The problem here is case conversion from capital "I" to lower-case "i".
In Turkish locale tolower('I') is not equal to 'i'. So, since "public" role
is lower-case internally, why would we not make it lower-case in dump file.

>
> You can't put single quotes around table and column names. You need to
use
> double quotes as they are identifiers rather than literals.
>
> Bear in mind that some improvements have been made in Postgres 7.3 with
> regards to quoting, so have you checked 7.3?

I stand corrected. It is indeed has to be double-quoted.

7.3 is quoting only SET SESSION AUTHORIZATION 'role' clause in my dump.
Possibly,
because it has been added recently. Old code does not quote anything.

>
> Chris

Regards,
Nic.


From: Neil Conway <neilc(at)samurai(dot)com>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-01 03:16:08
Message-ID: 1038712568.369.28.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Sat, 2002-11-30 at 12:47, Stephan Szabo wrote:
> check constraints with subselects.

Have we decided how this would even work? Last I heard, Tom still had
some major reservations about the practicality of implementing these --
for example, would you re-evaluate all constraints that SELECT from a
table when the table changes?

Cheers,

Neil
--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC


From: Joe Conway <mail(at)joeconway(dot)com>
To: David Wheeler <david(at)wheeler(dot)net>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-01 03:24:39
Message-ID: 3DE980F7.90306@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

David Wheeler wrote:
> On Saturday, November 30, 2002, at 04:14 PM, Joe Conway wrote:
>> Not quite sure what you mean by delimiter -- are you referring to double
>> escaping vs single escaping?
>
> Oh crap, yes, that's exactly what I meant.
>
> s/delimited/escaped/g;
>

That is one thing I'd like to take a look at. I think the problem is that
certain byte-sequence/multibyte-encoding combinations are illegal, so it's not
as simple an issue as it might first appear.

Joe


From: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Segmentation fault while COPY in 7.3
Date: 2002-12-01 03:52:46
Message-ID: 00ff01c298ed$1c0eac70$8016a8c0@apb.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Help!
Backend crashes on any COPY command I issue:
PostgreSQL is 7.3 release, is compiled from sources.
The message I get is:

apb=# COPY maras2.mrk_yyn (bsvr_no, yyn_tur, yyn_no, yyn_syf, yyn_trh) TO
stdout;
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.
!#

The output of strace on backend is following:

# strace -p 18883
recv(7, "QCOPY maras2.mrk_yyn (bsvr_no, y"..., 8192, 0) = 77
gettimeofday({1038713111, 629131}, NULL) = 0
_llseek(11, 0, [0], SEEK_SET) = 0
read(11, "\0\0\0\0\20\0\0\0\1\0\0\0\24\0\360\37\360\37\1 b1\5\0\1"..., 8192)
= 8192
read(11, "\0\0\0\0x#\375\"\20\0\0\0008\0h\35\360\37\1 \370\235\220"...,
8192) = 8192
_llseek(12, 0, [0], SEEK_SET) = 0
read(12, "\0\0\0\0\0#\375\"\20\0\0\0008\0(at)\34\0 \1 \200\237\0\1\0"..., 8192)
= 8192
_llseek(21, 40960, [40960], SEEK_SET) = 0
read(21, "\0\0\0\0\4\251\3#\20\0\0\0004\4p\17\360\37\1 \340\237 "..., 8192)
= 8192
_llseek(22, 106496, [106496], SEEK_SET) = 0
read(22, "\0\0\0\0(\326\377\"\20\0\0\0\10\1\200\1\0 \1 \200\237\0"..., 8192)
= 8192
read(17, "\0\0\0\0\20\0\0\0\1\0\0\0\360\0\20\1\0 \1 p\237 \1\340"..., 8192)
= 8192
open("/data/pgsql/base/2015749/2015757", O_RDWR|O_LARGEFILE) = 39
_llseek(39, 0, [20037632], SEEK_END) = 0
_llseek(39, 0, [0], SEEK_SET) = 0
read(39, "\0\0\0\0\270\7\4#\20\0\0\0\300\1\350\1\0 \1 \270\237\216"...,
8192) = 8192
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
#

I have recompiled postgres with debug information enabled, run gdb, attached
to backend process
and caught SIGSEGV as following:

(gdb) continue
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x081697bf in pfree (pointer=0x828a7b0) at mcxt.c:480
480 (*header->context->methods->free_p) (header->context,
pointer);
(gdb)

The output of bt is:

(gdb) bt
#0 0x081697bf in pfree (pointer=0x828a7b0) at mcxt.c:480
#1 0x080b37be in CopyTo (rel=0x402be088, attnumlist=0x828a3f8, binary=0
'\0', oids=0 '\0',
fp=0x0, delim=0x81c2a57 "\t", null_print=0x81b2c22 "\\N") at copy.c:671
#2 0x080b32f6 in DoCopy (stmt=0x827b398) at copy.c:491
#3 0x08118a6a in pg_exec_query_string (query_string=0x827af48, dest=Remote,
parse_context=0x8245378) at postgres.c:789
#4 0x08119b89 in PostgresMain (argc=4, argv=0xbfffd2a0, username=0x8240a81
"postgres")
at postgres.c:2016
#5 0x08101d7c in DoBackend (port=0x8240950) at postmaster.c:2293
#6 0x081016c2 in BackendStartup (port=0x8240950) at postmaster.c:1915
#7 0x08100875 in ServerLoop () at postmaster.c:1000
#8 0x08100326 in PostmasterMain (argc=1, argv=0x82270c0) at
postmaster.c:779
#9 0x080debab in main (argc=1, argv=0xbfffdc34) at main.c:210
#10 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6
(gdb)

Thanks in advance,
Nic


From: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-01 04:20:50
Message-ID: Pine.GSO.4.10.10212010613570.27674-100000@prana
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

While waiting for help I decided to fix my problem by
brute-forcing it. I commented out offending call to pfree()
in src/backend/commands/copy.c at line 671. I may introduced
a memory leak, but it works fine for me now.

Best regards,
Nic.

*** ./src/backend/commands/copy.c.orig Sun Dec 1 06:02:34 2002
--- ./src/backend/commands/copy.c Sun Dec 1 06:02:48 2002
***************
*** 668,674 ****
ObjectIdGetDatum(elements[attnum - 1]),
Int32GetDatum(attr[attnum - 1]->atttypmod)));
CopyAttributeOut(fp, string, delim);
! pfree(string);
}
else
{
--- 668,674 ----
ObjectIdGetDatum(elements[attnum - 1]),
Int32GetDatum(attr[attnum - 1]->atttypmod)));
CopyAttributeOut(fp, string, delim);
! /*pfree(string);*/
}
else
{


From: David Wheeler <david(at)wheeler(dot)net>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-01 04:24:17
Message-ID: C1805CA7-04E4-11D7-8D38-0003931A964A@wheeler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Saturday, November 30, 2002, at 07:24 PM, Joe Conway wrote:

> That is one thing I'd like to take a look at. I think the problem is
> that certain byte-sequence/multibyte-encoding combinations are
> illegal, so it's not as simple an issue as it might first appear.

My understanding is that the nul character is legal in a byte sequence,
but if it's not properly escaped, it'll be parsed as the end of the
statement. Unfortunately, I think that it's a very tough problem to
solve.

David

--
David Wheeler AIM: dwTheory
david(at)wheeler(dot)net ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory(at)jabber(dot)org


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 04:53:33
Message-ID: 15516.1038718413@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr> writes:
> src/bin/pg_dump/pg_dump.c happen to have hard-coded PUBLIC role name.

As it should. I think the real problem here is the hack in gram.y:

grantee: ColId
{
PrivGrantee *n = makeNode(PrivGrantee);
/* This hack lets us avoid reserving PUBLIC as a keyword*/
if (strcmp($1, "public") == 0)
n->username = NULL;
else
n->username = $1;
n->groupname = NULL;
$$ = (Node *)n;
}

If the parser treated PUBLIC as an actual keyword, you'd not be having
this problem, because keywords are case-folded on an ASCII-only basis
(which is consistent with the SQL99 spec, amazingly enough).

We put in the above hack after someone complained that PUBLIC didn't use
to be a reserved word ... but considering that SQL92 clearly lists it as
a reserved word, there's not a lot of ground for that complaint to stand
on.

I'd prefer shifting PUBLIC back to the true-keyword category over any
of the other workarounds you've suggested ...

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-01 04:57:26
Message-ID: 15558.1038718646@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

"Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr> writes:
> (gdb) bt
> #0 0x081697bf in pfree (pointer=0x828a7b0) at mcxt.c:480
> #1 0x080b37be in CopyTo (rel=0x402be088, attnumlist=0x828a3f8, binary=0
> '\0', oids=0 '\0',
> fp=0x0, delim=0x81c2a57 "\t", null_print=0x81b2c22 "\\N") at copy.c:671
> #2 0x080b32f6 in DoCopy (stmt=0x827b398) at copy.c:491

Hm. Offhand it would seem that somebody's output function is returning
a non-palloc'd string. What are the datatypes in that table, exactly?

regards, tom lane


From: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-01 05:09:56
Message-ID: 006201c298f7$e3e365b0$8016a8c0@apb.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>
> Hm. Offhand it would seem that somebody's output function is returning
> a non-palloc'd string. What are the datatypes in that table, exactly?

apb=> \d maras2.mrk_yyn
Table "maras2.mrk_yyn"
Column | Type | Modifiers
---------+-----------------------+-----------
bsvr_no | character varying(10) |
yyn_tur | character varying(1) |
yyn_no | numeric |
yyn_syf | numeric |
yyn_trh | date |

apb=>

> regards, tom lane

Thanks for attention.
Regards,
Nic


From: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 05:11:31
Message-ID: 006701c298f8$1cbe7370$8016a8c0@apb.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> ... but considering that SQL92 clearly lists it as
> a reserved word, there's not a lot of ground for that complaint to stand
> on.
>
> I'd prefer shifting PUBLIC back to the true-keyword category over any
> of the other workarounds you've suggested ...

It will work for me.
But why not change PUBLIC in pg_dump output to lower-case as well?

>
> regards, tom lane

Nic.


From: Joe Conway <mail(at)joeconway(dot)com>
To: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
Cc: pgsql-general(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-01 05:32:22
Message-ID: 3DE99EE6.3000102@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Nicolai Tufar wrote:
> From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>>Hm. Offhand it would seem that somebody's output function is returning
>>a non-palloc'd string. What are the datatypes in that table, exactly?
>
> apb=> \d maras2.mrk_yyn
> Table "maras2.mrk_yyn"
> Column | Type | Modifiers
> ---------+-----------------------+-----------
> bsvr_no | character varying(10) |
> yyn_tur | character varying(1) |
> yyn_no | numeric |
> yyn_syf | numeric |
> yyn_trh | date |

FWIW, I just tried to repeat this on cvs tip and could not. Seems to work just
fine:

regression=# create table foo(bsvr_no character varying(10),yyn_tur character
varying(1),yyn_no numeric,yyn_syf numeric,yyn_trh date);
CREATE TABLE
regression=# insert into foo values('a','a','1.0','1.0',now()::date);
INSERT 556825 1
regression=# copy foo to stdout;
a a 1.0 1.0 2002-11-30
regression=# copy foo(bsvr_no) to stdout;
a
regression=# copy foo(bsvr_no,yyn_tur,yyn_no,yyn_syf,yyn_trh) to stdout;
a a 1.0 1.0 2002-11-30
regression=# insert into foo values('a','a','1.0','1.0',null);
INSERT 556826 1
regression=# copy foo(bsvr_no,yyn_tur,yyn_no,yyn_syf,yyn_trh) to stdout;
a a 1.0 1.0 2002-11-30
a a 1.0 1.0 \N

Joe


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-01 05:55:14
Message-ID: 15949.1038722114@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Joe Conway <mail(at)joeconway(dot)com> writes:
> - possibly enhanced connectby functionality (may not be worth it if
> RECURSIVE JOIN functionality makes it into 7.4)

Several of my Red Hat cohorts are pretty interested in making the
RECURSIVE query stuff work for 7.4. (The fact that they're ex-DB2
folk might explain their preference for the SQL99 syntax, nee DB2
syntax, over Oracle's CONNECT BY ... but I'm with them ;-(. Oracle's
recursive-join syntax is nearly as bad as their outer-join syntax.)

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-01 06:10:29
Message-ID: 16042.1038723029@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Joe Conway <mail(at)joeconway(dot)com> writes:
> FWIW, I just tried to repeat this on cvs tip and could not. Seems to work just
> fine:

I have a sneaking suspicion that it can only be reproduced with Nicolai's
locale setting. Not sure exactly what aspect of the locale is causing
the problem though ...

regards, tom lane


From: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
To: "Joe Conway" <mail(at)joeconway(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-01 06:22:55
Message-ID: 004301c29902$15f00130$8016a8c0@apb.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>

> Joe Conway <mail(at)joeconway(dot)com> writes:
> > FWIW, I just tried to repeat this on cvs tip and could not. Seems to
work just
> > fine:
>
> I have a sneaking suspicion that it can only be reproduced with Nicolai's
> locale setting. Not sure exactly what aspect of the locale is causing
> the problem though ...

I am trying to reproduce the same on another server with no success.
Locale is what also comes to my mind. I have compiled PostgreSQL
with --with-nls option. All databases, including template0 are in
LATIN5 encoding. My postgresql.conf contains:

LC_MESSAGES = 'tr_TR'
LC_MONETARY = 'tr_TR'
LC_NUMERIC = 'tr_TR'
LC_TIME = 'tr_TR'
datestyle = 'European'

Regards,
Nic.

>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


From: Joe Conway <mail(at)joeconway(dot)com>
To: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-01 06:32:57
Message-ID: 3DE9AD19.3050109@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Nicolai Tufar wrote:
> From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>>I have a sneaking suspicion that it can only be reproduced with Nicolai's
>>locale setting. Not sure exactly what aspect of the locale is causing
>>the problem though ...
>
> I am trying to reproduce the same on another server with no success.
> Locale is what also comes to my mind. I have compiled PostgreSQL
> with --with-nls option. All databases, including template0 are in
> LATIN5 encoding. My postgresql.conf contains:
>
> LC_MESSAGES = 'tr_TR'
> LC_MONETARY = 'tr_TR'
> LC_NUMERIC = 'tr_TR'
> LC_TIME = 'tr_TR'
> datestyle = 'European'
>

Here's what I have:
$ pg_config --configure
'--with-tcl' '--enable-integer-datetimes' '--enable-debug' '--enable-cassert'
'--enable-nls' '--enable-depend'
'DOCBOOKSTYLE=/usr/share/sgml/docbook/dsssl-stylesheets-1.76'

testl5=# select * from pg_settings where name like 'lc%' or name = 'DateStyle';
name | setting
-------------+-------------------------------
DateStyle | ISO with European conventions
lc_messages | tr_TR
lc_monetary | tr_TR
lc_numeric | tr_TR
lc_time | tr_TR
(5 rows)

testl5=# \l
List of databases
Name | Owner | Encoding
------------+----------+-----------
parts | postgres | SQL_ASCII
regression | postgres | SQL_ASCII
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
test | postgres | SQL_ASCII
testjp | postgres | EUC_JP
testl5 | postgres | LATIN5
(7 rows)

testl5=# copy foo(bsvr_no,yyn_tur,yyn_no,yyn_syf,yyn_trh) to stdout;
a a 1.0 1.0 2002-11-30

Still works for me. Could it be related to --enable-integer-datetimes?

Joe


From: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-01 06:34:32
Message-ID: 006101c29903$b588fac0$8016a8c0@apb.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>
> Can you extract more info? For example, it would be useful to see
> exactly which line of the table the COPY dies at, and what's in that
> row.

COPY dies at the first row and the data is as following:

apb=> select * from mrk_yyn limit 3;
bsvr_no | yyn_tur | yyn_no | yyn_syf | yyn_trh
---------+---------+--------+---------+---------
045030 | T | 176 | 39 |
045033 | T | 176 | 39 |
045035 | T | 176 | 39 |
(3 rows)

apb=>

yyn_trh semm to be null. I tried to COPY other tables, the ones
without date columns, I created new tables, but it still segfaults.
And I can not reproduce it on other system.

>
> regards, tom lane
>

Nic


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-01 06:50:38
Message-ID: 16270.1038725438@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Ohhh ...

Nicolai, are you running with a client encoding different from server
encoding?

I'm thinking that the real problem is that pg_server_to_client() can
return its input pointer as its result, meaning that CopyAttributeOut
might try to pfree() its input.

regards, tom lane


From: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
To: "Joe Conway" <mail(at)joeconway(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-01 07:32:47
Message-ID: 008301c2990b$d85cb700$8016a8c0@apb.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>

> Ohhh ...
>
> Nicolai, are you running with a client encoding different from server
> encoding?

Got it!
Gentlemen, thank you very much for assistance. The body of evidence was
slowly
growing, then, finaly Tom Lan's message have enlightened me.

It all started with initdb's warning that it can not set client's connection
to 'LATIN5'.
Okay, I said, maybe some system files are not installed. Then I tried to
create a database
with ENCODING='LATIN5'. I did not pay much attention either since my
template1 and
template0 are in LATIN5. Then on Tom's suggestion I tried to change client
encoding:

aaa=# \encoding
LATIN5
aaa=# \encoding SQL_ASCII
SQL_ASCII: invalid encoding name or conversion procedure not found
aaa=# \encoding LATIN5
LATIN5: invalid encoding name or conversion procedure not found
aaa=# \encoding SQL_ASCii
aaa=# \encoding
SQL_ASCII
aaa=# \encoding LATiN5
aaa=# \encoding
LATIN5
aaa=#

So it all falls back to Turkish "I" problem I mentioned earlier. To
perform COPY successfully I had to set client locale to 'LATiN5'
(note quotes and lower-case "i"). Any other combinations result
in segmentation fault.

Now, would it be right to change locale name handling to use ASCII-only
lower and upper-case conversions?

Many thanks to Tom Lane and Joe Conway.

I've got to get some sleep :-)
Regards,
Nic.


From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-01 10:33:19
Message-ID: 20021201022334.C37277-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


On 30 Nov 2002, Neil Conway wrote:

> On Sat, 2002-11-30 at 12:47, Stephan Szabo wrote:
> > check constraints with subselects.
>
> Have we decided how this would even work? Last I heard, Tom still had
> some major reservations about the practicality of implementing these --
> for example, would you re-evaluate all constraints that SELECT from a
> table when the table changes?

You'd have to either do it in all cases or come up with something that was
smart enough to limit the cases to some extent based on the expression. I
doubt that it'd perform terribly well, especially at first. I can't see
any justification for doing it as insert/update on main table only since
by my reading of the spec the constraint is logically checked at the end
of each statement (or transaction) even if we would normally not do so in
practice when we know the constraint shouldn't be violated.

Of course this was in the general set of, if I had months and months and
nothing else to do (like work) then I'd want to look at it because I think
it'd be useful.


From: Florian Weimer <Weimer(at)CERT(dot)Uni-Stuttgart(dot)DE>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-01 12:50:25
Message-ID: 877ketzywe.fsf@Login.CERT.Uni-Stuttgart.DE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

"Matthew T. O'Connor" <matthew(at)zeut(dot)net> writes:

> pg_dump, our upgrade process is painful enough having to do a dump,
> reload. I think we should be able to guarantee (or at least let
> much closer to it) that the process works in all cases.

I would already be happy if pg_dump backed up my databases correctly,
so that I dont have to reorder SQL statements manually in the dump
before psql can execute it.

--
Florian Weimer Weimer(at)CERT(dot)Uni-Stuttgart(dot)DE
University of Stuttgart http://CERT.Uni-Stuttgart.DE/people/fw/
RUS-CERT fax +49-711-685-5898


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Neil Conway <neilc(at)samurai(dot)com>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-01 16:24:18
Message-ID: 18457.1038759858@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> writes:
> On 30 Nov 2002, Neil Conway wrote:
>> Have we decided how this would even work? Last I heard, Tom still had
>> some major reservations about the practicality of implementing these --
>> for example, would you re-evaluate all constraints that SELECT from a
>> table when the table changes?

> You'd have to either do it in all cases or come up with something that was
> smart enough to limit the cases to some extent based on the expression. I
> doubt that it'd perform terribly well, especially at first.

Note that you can get the "stupid" semantics (run the subselect only
when the constrained table changes) today: just hide the subselect in
a user-defined function that's called from the constraint expression.
Or put the whole check in a trigger instead of using a constraint.

I don't think we should bother with direct support of subselects in
constraints unless we can come up with an implementation that is
significantly better than what you can accomplish with these
workarounds.

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr>
Cc: "Joe Conway" <mail(at)joeconway(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-01 17:38:06
Message-ID: 25344.1038764286@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

"Nicolai Tufar" <ntufar(at)apb(dot)com(dot)tr> writes:
> From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>> Ohhh ...
>>
>> Nicolai, are you running with a client encoding different from server
>> encoding?

> Got it!

Okay, the problem is a double free of memory in COPY OUT. I've applied
the following patch for 7.3.1. (A better fix would be for COPY OUT to
run in a local memory context that it could reset every so often, like
once per row, and then we could remove these risky retail pfree's entirely.
I plan to do that instead in development sources.)

regards, tom lane

*** src/backend/commands/copy.c.orig Fri Oct 18 20:25:36 2002
--- src/backend/commands/copy.c Sun Dec 1 12:28:24 2002
***************
*** 1470,1478 ****
char *string;
char c;
char delimc = delim[0];
-
bool same_encoding;
! char *string_start;
int mblen;
int i;

--- 1470,1477 ----
char *string;
char c;
char delimc = delim[0];
bool same_encoding;
! char *string_start = NULL;
int mblen;
int i;

***************
*** 1481,1492 ****
{
string = (char *) pg_server_to_client((unsigned char *) server_string,
strlen(server_string));
! string_start = string;
}
else
{
string = server_string;
- string_start = NULL;
}

for (; (c = *string) != '\0'; string += mblen)
--- 1480,1491 ----
{
string = (char *) pg_server_to_client((unsigned char *) server_string,
strlen(server_string));
! if (string != server_string)
! string_start = string;
}
else
{
string = server_string;
}

for (; (c = *string) != '\0'; string += mblen)


From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-01 17:53:55
Message-ID: 20021201095023.D41355-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Sun, 1 Dec 2002, Tom Lane wrote:

> Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> writes:
> > On 30 Nov 2002, Neil Conway wrote:
> >> Have we decided how this would even work? Last I heard, Tom still had
> >> some major reservations about the practicality of implementing these --
> >> for example, would you re-evaluate all constraints that SELECT from a
> >> table when the table changes?
>
> > You'd have to either do it in all cases or come up with something that was
> > smart enough to limit the cases to some extent based on the expression. I
> > doubt that it'd perform terribly well, especially at first.
>
> Note that you can get the "stupid" semantics (run the subselect only
> when the constrained table changes) today: just hide the subselect in
> a user-defined function that's called from the constraint expression.
> Or put the whole check in a trigger instead of using a constraint.
>
> I don't think we should bother with direct support of subselects in
> constraints unless we can come up with an implementation that is
> significantly better than what you can accomplish with these
> workarounds.

Well, the problem is that user defined triggers trying to do the real
semantics for update/insert on the "other" tables of the constraint seem
to me like they'll have the same issues as foreign keys do currently,
either you'll be forced to write something too strong and deadlock alot,
or you'll write something too weak and end up with constraint violations
with concurrent transactions unless you basically write a very low level C
function to do it for you. I guess this, since in general, the non-action
foreign keys really are just check constraints with a subselect
effectively.


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 18:44:06
Message-ID: 200212011844.gB1Ii7b14487@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Tom Lane wrote:
> If the parser treated PUBLIC as an actual keyword, you'd not be having
> this problem, because keywords are case-folded on an ASCII-only basis
> (which is consistent with the SQL99 spec, amazingly enough).
>
> We put in the above hack after someone complained that PUBLIC didn't use
> to be a reserved word ... but considering that SQL92 clearly lists it as
> a reserved word, there's not a lot of ground for that complaint to stand
> on.
>
> I'd prefer shifting PUBLIC back to the true-keyword category over any
> of the other workarounds you've suggested ...

PUBLIC doesn't seem like a very common column name --- seems safe to
make it reserved. We made 'value' reserved in 7.3, and that was a much
more common one.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 18:49:30
Message-ID: 27169.1038768570@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> PUBLIC doesn't seem like a very common column name --- seems safe to
> make it reserved. We made 'value' reserved in 7.3, and that was a much
> more common one.

I'm still quite unhappy about 'value', and would like to look into
making it unreserved again. This business does show that there are some
pitfalls in that, though :-(

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 18:51:26
Message-ID: 27206.1038768686@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> We made 'value' reserved in 7.3, and that was a much
> more common one.

BTW, you mean "current" not "7.3". That patch has still got some
serious problems anyway:

7.3:

regression=# select value;
ERROR: Attribute "value" not found

HEAD:

regression=# select value;
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.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 18:52:58
Message-ID: 200212011852.gB1Iqw023554@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > We made 'value' reserved in 7.3, and that was a much
> > more common one.
>
> BTW, you mean "current" not "7.3". That patch has still got some
> serious problems anyway:

Yes, I realized later it was current. I was fixing the dbdpg regression
tests, and git bitten by that, and forgot I was using current and not
7.3.

>
> 7.3:
>
> regression=# select value;
> ERROR: Attribute "value" not found
>
> HEAD:
>
> regression=# select value;
> 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.

Yow!

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: David Wheeler <david(at)wheeler(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 18:54:15
Message-ID: 49D4448A-055E-11D7-8D38-0003931A964A@wheeler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Sunday, December 1, 2002, at 10:49 AM, Tom Lane wrote:

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>> PUBLIC doesn't seem like a very common column name --- seems safe to
>> make it reserved. We made 'value' reserved in 7.3, and that was a
>> much
>> more common one.
>
> I'm still quite unhappy about 'value', and would like to look into
> making it unreserved again. This business does show that there are
> some
> pitfalls in that, though :-(

Actually, I don't think it's reserved in 7.3, only in the 7.4
development sources. Otherwise, Bricolage would fail hard, and it
doesn't. So there's some time to play with this issue, I think.

David

--
David Wheeler AIM: dwTheory
david(at)wheeler(dot)net ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory(at)jabber(dot)org


From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 19:04:21
Message-ID: 1038769460.72409.197.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> > regression=# select value;
> > ERROR: Attribute "value" not found
> >
> > HEAD:
> >
> > regression=# select value;
> > 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.
>
> Yow!

I believe these are fixed in the patch I sent in last week.

--
Rod Taylor <rbt(at)rbt(dot)ca>


From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hard-coded PUBLIC in pg_dump
Date: 2002-12-01 19:04:22
Message-ID: 1038769460.72409.198.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> > regression=# select value;
> > ERROR: Attribute "value" not found
> >
> > HEAD:
> >
> > regression=# select value;
> > 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.
>
> Yow!

I believe these are fixed in the patch I sent in last week.

--
Rod Taylor <rbt(at)rbt(dot)ca>


From: Joe Conway <mail(at)joeconway(dot)com>
To: David Wheeler <david(at)wheeler(dot)net>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 03:36:45
Message-ID: 3DEAD54D.5080303@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

David Wheeler wrote:
> My understanding is that the nul character is legal in a byte sequence,
> but if it's not properly escaped, it'll be parsed as the end of the
> statement. Unfortunately, I think that it's a very tough problem to solve.

No question wrt '\0' bytes -- they would have to be escaped when casting from
bytea to text.

The harder issue is that there are apparently many other multiple byte
sequences that, while valid in an ASCII encoding, are not valid in one or more
multibyte encodings. See this thread:

http://archives.postgresql.org/pgsql-hackers/2002-04/msg00236.php

This is why currently all "non printable characters" are escaped (which I
think is all bytes > 127). Text on the other hand is already known to be valid
for a particular encoding, so it doesn't need escaping.

I'm not sure what happens when the backend encoding and client encoding don't
match -- I'd guess there is some probability of invalid byte sequences in that
case too.

Joe


From: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: 7.4 Wishlist
Date: 2002-12-02 10:54:10
Message-ID: 15851.15314.71586.8035@kelvin.csl.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Christopher Kings-Lynne writes:
> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?

Well judging by the hoards on Slashdot, it would appear that
replication is the hot enhancement...

Slashdot | PostgreSQL 7.3 Released
http://developers.slashdot.org/article.pl?sid=02/11/30/1815200

Lee.


From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 11:26:12
Message-ID: 20021202112611.GC2340@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Fri, Nov 29, 2002 at 10:51:26AM -0800, Christopher Kings-Lynne wrote:
> Hi guys,
>
> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?

This is interesting discussion..

my wish:

* error codes. It's very interesting that nobody other wants it...

Karel

--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/


From: Prasanna Phadke <pmp_pg(at)yahoo(dot)co(dot)in>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 13:00:34
Message-ID: 20021202130034.66118.qmail@web8206.mail.in.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


How about giving OLAP (Dimension / Measure) functionality to PG.

Catch all the cricket action. Download Yahoo! Score tracker


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: David Wheeler <david(at)wheeler(dot)net>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 18:09:46
Message-ID: 200212021809.gB2I9k711367@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Joe Conway wrote:
> David Wheeler wrote:
> > My understanding is that the nul character is legal in a byte sequence,
> > but if it's not properly escaped, it'll be parsed as the end of the
> > statement. Unfortunately, I think that it's a very tough problem to solve.
>
> No question wrt '\0' bytes -- they would have to be escaped when casting from
> bytea to text.
>
> The harder issue is that there are apparently many other multiple byte
> sequences that, while valid in an ASCII encoding, are not valid in one or more
> multibyte encodings. See this thread:
>
> http://archives.postgresql.org/pgsql-hackers/2002-04/msg00236.php
>
> This is why currently all "non printable characters" are escaped (which I
> think is all bytes > 127). Text on the other hand is already known to be valid
> for a particular encoding, so it doesn't need escaping.
>
> I'm not sure what happens when the backend encoding and client encoding don't
> match -- I'd guess there is some probability of invalid byte sequences in that
> case too.

I think there is some idea of changing the frontend/backend protocol to
prevent the need for escaping > \127 characters. I believe it is
currently only required when the frontend/backend protocol have
different encodings.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 19:46:39
Message-ID: 05a801c29a3b$88272550$f80c0a0a@mnd
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Mysql is planning on making this work:

SELECT id, @a:=COUNT(*), SUM(sum_col)/@a FROM table_name GROUP BY id.

Do we have anything like it (After a discussion with Tom i figure no).
User variables is nice, especially in these kind of queries.

Nice would be to be able to use them as in C (almost everywhere):

SELECT id, @x FROM table_name t where (@x := date_part('days'. now() -
f.created)) > 100;

As Tom said in earlier mail, it might not be that big of a win in this
case, but if uses expensive functions, it will.

Magnus


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 20:25:34
Message-ID: 015101c29a40$f9ec42b0$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> Mysql is planning on making this work:
>
> SELECT id, @a:=COUNT(*), SUM(sum_col)/@a FROM table_name GROUP BY id.
>
> Do we have anything like it (After a discussion with Tom i figure no).
> User variables is nice, especially in these kind of queries.

Well of course they have to make that work - they don't have subselects :P

Chris


From: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 20:34:20
Message-ID: 063201c29a42$316532f0$f80c0a0a@mnd
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> wrote:
>> Mysql is planning on making this work:
>>
>> SELECT id, @a:=COUNT(*), SUM(sum_col)/@a FROM table_name GROUP BY
>> id.
>>
>> Do we have anything like it (After a discussion with Tom i figure
>> no). User variables is nice, especially in these kind of queries.
>
> Well of course they have to make that work - they don't have
> subselects :P
>
> Chris

Yeah, but there is a point about running count(*) one time too many.
Say if i would like to get a prettyprinting query like this:

SELECT id, @a:=COUNT(*), sum_col::text||'/'@a::text FROM table_name;

That would be DAMN expensive doing with a subselect:

SELECT id, sum_col||'/'||(select COUNT(*) from tabe_name) FROM
table_name;

I know this example suck eggs, but you get the point where it hurts,
right?

Magnus - sorry for the dupe, chris


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 20:48:38
Message-ID: 016a01c29a44$308a7870$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> Yeah, but there is a point about running count(*) one time too many.
> Say if i would like to get a prettyprinting query like this:
>
> SELECT id, @a:=COUNT(*), sum_col::text||'/'@a::text FROM table_name;
>
> That would be DAMN expensive doing with a subselect:
>
> SELECT id, sum_col||'/'||(select COUNT(*) from tabe_name) FROM
> table_name;
>
> I know this example suck eggs, but you get the point where it hurts,
> right?

Are you sure that postgres evaluates that subselect more than once? It
looks to me like it returns a constant result for every row and hence it
will be evaluated once per statement, not once per row. I'm no expert tho.
Can someone answer this?

And if the subselect changes for each row (ie. it's a correlated subquery)
then you cannot use the variable anyway.

It seems to me that if postgres doesn't consider count(*) as a constant then
perhaps it should be taught to? Should be safe shouldn't it? I guess if a
function in your select statemnt is inserting a row then there's trouble.
But if there is, then the sum/count(*) is nonsensical anyway.

Chris


From: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
To: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-02 21:02:30
Message-ID: 3DEBCA66.3060405@intransa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Something is funny about this pfree()....here is a similar crash on a 7.2.3

(gdb)
#0 0x00420874 in heap_freetuple ()
#1 0x004a8390 in acquire_sample_rows ()
#2 0x004a75c8 in analyze_rel ()
#3 0x0049f690 in vacuum ()
#4 0x005585d8 in ProcessUtility ()
#5 0x00553c78 in pg_exec_query_string ()
#6 0x00555850 in PostgresMain ()
#7 0x00524660 in DoBackend ()
#8 0x00523d08 in BackendStartup ()
#9 0x00521c18 in ServerLoop ()
#10 0x005211c8 in PostmasterMain ()
#11 0x004df3d8 in main ()
#12 0x2ae34928 in __libc_start_main () from /lib/libc.so.6
(gdb)

Nicolai Tufar wrote:

>Help!
>Backend crashes on any COPY command I issue:
>PostgreSQL is 7.3 release, is compiled from sources.
>The message I get is:
>
>apb=# COPY maras2.mrk_yyn (bsvr_no, yyn_tur, yyn_no, yyn_syf, yyn_trh) TO
>stdout;
>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.
>!#
>
>
>The output of strace on backend is following:
>
># strace -p 18883
>recv(7, "QCOPY maras2.mrk_yyn (bsvr_no, y"..., 8192, 0) = 77
>gettimeofday({1038713111, 629131}, NULL) = 0
>_llseek(11, 0, [0], SEEK_SET) = 0
>read(11, "\0\0\0\0\20\0\0\0\1\0\0\0\24\0\360\37\360\37\1 b1\5\0\1"..., 8192)
>= 8192
>read(11, "\0\0\0\0x#\375\"\20\0\0\0008\0h\35\360\37\1 \370\235\220"...,
>8192) = 8192
>_llseek(12, 0, [0], SEEK_SET) = 0
>read(12, "\0\0\0\0\0#\375\"\20\0\0\0008\0(at)\34\0 \1 \200\237\0\1\0"..., 8192)
>= 8192
>_llseek(21, 40960, [40960], SEEK_SET) = 0
>read(21, "\0\0\0\0\4\251\3#\20\0\0\0004\4p\17\360\37\1 \340\237 "..., 8192)
>= 8192
>_llseek(22, 106496, [106496], SEEK_SET) = 0
>read(22, "\0\0\0\0(\326\377\"\20\0\0\0\10\1\200\1\0 \1 \200\237\0"..., 8192)
>= 8192
>read(17, "\0\0\0\0\20\0\0\0\1\0\0\0\360\0\20\1\0 \1 p\237 \1\340"..., 8192)
>= 8192
>open("/data/pgsql/base/2015749/2015757", O_RDWR|O_LARGEFILE) = 39
>_llseek(39, 0, [20037632], SEEK_END) = 0
>_llseek(39, 0, [0], SEEK_SET) = 0
>read(39, "\0\0\0\0\270\7\4#\20\0\0\0\300\1\350\1\0 \1 \270\237\216"...,
>8192) = 8192
>--- SIGSEGV (Segmentation fault) ---
>+++ killed by SIGSEGV +++
>#
>
>I have recompiled postgres with debug information enabled, run gdb, attached
>to backend process
>and caught SIGSEGV as following:
>
>(gdb) continue
>Continuing.
>
>Program received signal SIGSEGV, Segmentation fault.
>0x081697bf in pfree (pointer=0x828a7b0) at mcxt.c:480
>480 (*header->context->methods->free_p) (header->context,
>pointer);
>(gdb)
>
>
>The output of bt is:
>
>(gdb) bt
>#0 0x081697bf in pfree (pointer=0x828a7b0) at mcxt.c:480
>#1 0x080b37be in CopyTo (rel=0x402be088, attnumlist=0x828a3f8, binary=0
>'\0', oids=0 '\0',
> fp=0x0, delim=0x81c2a57 "\t", null_print=0x81b2c22 "\\N") at copy.c:671
>#2 0x080b32f6 in DoCopy (stmt=0x827b398) at copy.c:491
>#3 0x08118a6a in pg_exec_query_string (query_string=0x827af48, dest=Remote,
> parse_context=0x8245378) at postgres.c:789
>#4 0x08119b89 in PostgresMain (argc=4, argv=0xbfffd2a0, username=0x8240a81
>"postgres")
> at postgres.c:2016
>#5 0x08101d7c in DoBackend (port=0x8240950) at postmaster.c:2293
>#6 0x081016c2 in BackendStartup (port=0x8240950) at postmaster.c:1915
>#7 0x08100875 in ServerLoop () at postmaster.c:1000
>#8 0x08100326 in PostmasterMain (argc=1, argv=0x82270c0) at
>postmaster.c:779
>#9 0x080debab in main (argc=1, argv=0xbfffdc34) at main.c:210
>#10 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6
>(gdb)
>
>
>
>Thanks in advance,
>Nic
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>


From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 21:40:49
Message-ID: 20021202133242.A57292-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


On Mon, 2 Dec 2002, Magnus Naeslund(f) wrote:

> Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> wrote:
> >> Mysql is planning on making this work:
> >>
> >> SELECT id, @a:=COUNT(*), SUM(sum_col)/@a FROM table_name GROUP BY
> >> id.
> >>
> >> Do we have anything like it (After a discussion with Tom i figure
> >> no). User variables is nice, especially in these kind of queries.
> >
> > Well of course they have to make that work - they don't have
> > subselects :P
> >
> > Chris
>
> Yeah, but there is a point about running count(*) one time too many.
> Say if i would like to get a prettyprinting query like this:
>
> SELECT id, @a:=COUNT(*), sum_col::text||'/'@a::text FROM table_name;
>
> That would be DAMN expensive doing with a subselect:
>
> SELECT id, sum_col||'/'||(select COUNT(*) from tabe_name) FROM
> table_name;
>
> I know this example suck eggs, but you get the point where it hurts,
> right?

If you use a scalar subquery, yes, but I think a subselect in from would
help, maybe something like (if you want the total count)

select table_name.id, sum(sum_col)||'/'||t2.count from table_name, (select
count(*) as count from table_name) as t2 group by table_name.id,t2.count;

or (if you want each count the counter per group) either

select id, sum(sum_col)||'/'||count(*) from table_name
group by id;

or

select table_name.id, sum(sum_col)||'/'||t2.count from table_name,
(select id, count(*) as count from table_name group by id) as t2 where
table_name.id=t2.id group by table_name.id,t2.count;


From: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 22:18:13
Message-ID: 06a801c29a50$b4675fd0$f80c0a0a@mnd
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> wrote:
> Are you sure that postgres evaluates that subselect more than once?
> It looks to me like it returns a constant result for every row and
> hence it will be evaluated once per statement, not once per row. I'm
> no expert tho. Can someone answer this?
>
> And if the subselect changes for each row (ie. it's a correlated
> subquery) then you cannot use the variable anyway.
>
> It seems to me that if postgres doesn't consider count(*) as a
> constant then perhaps it should be taught to? Should be safe
> shouldn't it? I guess if a function in your select statemnt is
> inserting a row then there's trouble. But if there is, then the
> sum/count(*) is nonsensical anyway.
>
> Chris
>

It looks like it (7.2.x):

# time psql genline -c "select id from xxxx" > /dev/null
real 0m0.694s
user 0m0.147s
sys 0m0.025s
# time psql genline -c "select id,id||'/'||(select count(*) from xxxx)
as x from xxxx" > /dev/null

real 0m2.202s
user 0m0.263s
sys 0m0.040s

# time psql genline -c "select id,(select count(*) from bildsekvens) as
x from xxxx" > /dev/null

real 0m1.479s
user 0m0.254s
sys 0m0.047s

They were taken from a busy system, but i ran the several times showing
about the same result.

Magnus


From: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
To: "Stephan Szabo" <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 22:22:30
Message-ID: 06d201c29a51$4d98c040$f80c0a0a@mnd
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> wrote:
>
> If you use a scalar subquery, yes, but I think a subselect in from
> would help, maybe something like (if you want the total count)
>
> select table_name.id, sum(sum_col)||'/'||t2.count from table_name,
> (select count(*) as count from table_name) as t2 group by
> table_name.id,t2.count;
>
> or (if you want each count the counter per group) either
>
> select id, sum(sum_col)||'/'||count(*) from table_name
> group by id;
>
> or
>
> select table_name.id, sum(sum_col)||'/'||t2.count from table_name,
> (select id, count(*) as count from table_name group by id) as t2 where
> table_name.id=t2.id group by table_name.id,t2.count;
>

Give it up already, i was MAKING A POINT, not trying to make an
optimized count(*) thing :)
There are other examples that you cannot get around, that will be
evaluated more than once when a local "user variable" would make it not
need to.

Magnus


From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 22:51:20
Message-ID: 20021202144827.I58766-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Mon, 2 Dec 2002, Magnus Naeslund(f) wrote:

> Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> wrote:
> >
> > If you use a scalar subquery, yes, but I think a subselect in from
> > would help, maybe something like (if you want the total count)
> >
> > select table_name.id, sum(sum_col)||'/'||t2.count from table_name,
> > (select count(*) as count from table_name) as t2 group by
> > table_name.id,t2.count;
> >
> > or (if you want each count the counter per group) either
> >
> > select id, sum(sum_col)||'/'||count(*) from table_name
> > group by id;
> >
> > or
> >
> > select table_name.id, sum(sum_col)||'/'||t2.count from table_name,
> > (select id, count(*) as count from table_name group by id) as t2 where
> > table_name.id=t2.id group by table_name.id,t2.count;
> >
>
> Give it up already, i was MAKING A POINT, not trying to make an
> optimized count(*) thing :)
> There are other examples that you cannot get around, that will be
> evaluated more than once when a local "user variable" would make it not
> need to.

For most cases sticking an expression in a subselect in from works to not
re-evaluate it (unless it's correlated in which case I don't think local
variables help). It might not be as optimal in all cases, but probably is
sufficient in most cases.


From: Hannu Krosing <hannu(at)tm(dot)ee>
To: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 23:29:24
Message-ID: 1038871764.5193.3.camel@rh72.home.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Magnus Naeslund(f) kirjutas T, 03.12.2002 kell 03:18:
> It looks like it (7.2.x):
>
> # time psql genline -c "select id from xxxx" > /dev/null
> real 0m0.694s
> user 0m0.147s
> sys 0m0.025s
> # time psql genline -c "select id,id||'/'||(select count(*) from xxxx)
> as x from xxxx" > /dev/null
>
> real 0m2.202s
> user 0m0.263s
> sys 0m0.040s
>
> # time psql genline -c "select id,(select count(*) from bildsekvens) as
> x from xxxx" > /dev/null
>
> real 0m1.479s
> user 0m0.254s
> sys 0m0.047s

what is the time for

select id,x
from xxxx,
(select count(*) as x from bildsekvens) c ;

> They were taken from a busy system, but i ran the several times showing
> about the same result.
>
> Magnus
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Hannu Krosing <hannu(at)tm(dot)ee>


From: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
To: "Hannu Krosing" <hannu(at)tm(dot)ee>
Cc: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-02 23:39:23
Message-ID: 078d01c29a5c$0b72b210$f80c0a0a@mnd
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Hannu Krosing <hannu(at)tm(dot)ee> wrote:
> Magnus Naeslund(f) kirjutas T, 03.12.2002 kell 03:18:
>> It looks like it (7.2.x):
>>
>> # time psql genline -c "select id from xxxx" > /dev/null
>> real 0m0.694s
>> user 0m0.147s
>> sys 0m0.025s
>> # time psql genline -c "select id,id||'/'||(select count(*) from
>> xxxx) as x from xxxx" > /dev/null
>>
>> real 0m2.202s
>> user 0m0.263s
>> sys 0m0.040s
>>
>> # time psql genline -c "select id,(select count(*) from bildsekvens)
>> as x from xxxx" > /dev/null
>>
>> real 0m1.479s
>> user 0m0.254s
>> sys 0m0.047s
>
> what is the time for
>
> select id,x
> from xxxx,
> (select count(*) as x from bildsekvens) c ;
>
>
>

time psql genline -c "select id,x from xxxx, (select count(*) as x from
xxxx) c ;" > /dev/null

real 0m1.354s
user 0m0.268s
sys 0m0.028s

The xxxx and the other table is the same table, sorry i screwed up in
the last cut'n'paste operation.
As i said it's a loaded system, the figures vary a little bit between
runs.

Magnus


From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 00:10:56
Message-ID: Pine.LNX.4.21.0212031053520.31113-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

I want to see:

i) proper resource management a-la Oracle. This would allow a DBA to
limited the amount of time any given user spends in the parser, planner or
executor. It would be limited with a more sophisticated user system,
including things like CREATE USER PROFILE ...

ii) Auditing. Who accessed what, how, when and for how long with the
ability to store queries, planner stats, executor stats and what ever else
we can tie to a query. Very useful for debugging and security. You can get
this from the logs but it is non trivial to perform adhoc reporting and
statistical analysis. Why not store it.. in a database? :-)

iii) SQL99 error code

iv) Updatable and insertable-into views (per SQL99). Perhaps a two stage
implementation: i) rules ii) have the planner/executor handle it, instead
of the rewriter. The latter will take more coding, and might touch too
much of the code, considering the other significant changes planned for
7.4.

v) Better PL/PgSQL parser and memory handling

vi) A larger number of case studies on the advocacy site, with a larger
degree of financial and ROI analysis, all that jazz

vii) Collections of information about migrating from other significant
platforms: oracle, db2, sybase, interbase, SQL server -- a very popular
request on irc.openprojects.net

viii) General advocacy, particularly in pushing mainstream IT media
coverage, conferences and university usage -- both for teaching SQL and
for teach database engineering concepts for senior undergrads.

I've no idea how much time I can put into these, but they're on my TODO
list.

Gavin


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Gavin Sherry" <swm(at)linuxworld(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 00:50:20
Message-ID: 026f01c29a65$f4ebe570$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> i) proper resource management a-la Oracle. This would allow a DBA to
> limited the amount of time any given user spends in the parser, planner or
> executor. It would be limited with a more sophisticated user system,
> including things like CREATE USER PROFILE ...

Hehehe - yeah this would be neat. Would be somewhat better than MySQL's
MAX_QUERIES_PER_HOUR setting :P

> vii) Collections of information about migrating from other significant
> platforms: oracle, db2, sybase, interbase, SQL server -- a very popular
> request on irc.openprojects.net

There's lots of good information on this on techdocs.postgresql.org. BTW,
what happened to the PostgreSQL portal site that someone was working on?
It'd be very interested in taking that on...

> viii) General advocacy, particularly in pushing mainstream IT media
> coverage, conferences and university usage -- both for teaching SQL and
> for teach database engineering concepts for senior undergrads.

Definitely. How about a resource for college/uni professors on how to use
PostgreSQL in their courses?

Chris


From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 01:28:40
Message-ID: Pine.LNX.4.21.0212031220340.7065-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Mon, 2 Dec 2002, Christopher Kings-Lynne wrote:

> > viii) General advocacy, particularly in pushing mainstream IT media
> > coverage, conferences and university usage -- both for teaching SQL and
> > for teach database engineering concepts for senior undergrads.
>
> Definitely. How about a resource for college/uni professors on how to use
> PostgreSQL in their courses?

I might get together with some of the lecturers I've worked with in
Sydney to give such a document some weight. I must say, the problem is not
a technical one though. I've given talks to 3rd and 4th year students
about PostgreSQL -- technical, conceptual, political talks... you name
it. Out of 200 odd students, only about 5-10 actually seem interested. Its
terrible.

Why aren't they interested? They think that if they study Oracle
(instead) for 6 months they'll walk straight into a job with an extremely
high salary. Its a myth, but I cannot shake that perception.

In fact, things got very heated when two universities in Sydney moved
their SQL courses from Oracle and Sybase to PostgreSQL. Enrollments will
be down next year for the courses and Australian universities are heavily
geared toward bums on seats not facilitation of education.

Gavin


From: Mike Mascari <mascarm(at)mascari(dot)com>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 01:51:33
Message-ID: 3DEC0E25.1050003@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Gavin Sherry wrote:
> I want to see:
>
> i) proper resource management a-la Oracle. This would allow a DBA to
> limited the amount of time any given user spends in the parser, planner or
> executor. It would be limited with a more sophisticated user system,
> including things like CREATE USER PROFILE ...

Amen:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=3DB99C0A.70900%40mascari.com&rnum=1&prev=/groups%3Fq%3DCREATE%2BPROFILE%2BMike%2BMascari%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8

To avoid unnecessary cycles being spent on loading the profile
after session authorization, we could have a GUC as was
suggested to turn the feature on or off. This mirrors Oracle,
where you have to set RESOURCE_LIMIT in your init[SID].ora file
before PROFILEs are enforced. Some people like sticking
everything in postgresql.conf though, including resource limits.
I'm not sure how remote administration is supposed to work under
such a scenario though...

Mike Mascari
mascarm(at)mascari(dot)com


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Gavin Sherry" <swm(at)linuxworld(dot)com(dot)au>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 02:16:19
Message-ID: 02c001c29a71$f773d260$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> I might get together with some of the lecturers I've worked with in
> Sydney to give such a document some weight. I must say, the problem is not
> a technical one though. I've given talks to 3rd and 4th year students
> about PostgreSQL -- technical, conceptual, political talks... you name
> it. Out of 200 odd students, only about 5-10 actually seem interested. Its
> terrible.

I've given a talk in the 2002 honours lecture series at UWA about Postgres
and some of the things it can do. All of those guys were interested.
Especially since the deptartment does a lot of work in genetic algoriithms.

Tell me when you start working on a document - I'm happy to help. Since I'm
only just out of Uni, I'd like to write a set of possible assignments and
learning outcomes and how you can use postgres to support them.

My girlfriend is a PhD student at UWA CS dept :) plus I won the honours
scholarship there a year or two back, so I can get interest from the dept,
including the databases lecturer. Might help for another point of view and
feedback.

> Why aren't they interested? They think that if they study Oracle
> (instead) for 6 months they'll walk straight into a job with an extremely
> high salary. Its a myth, but I cannot shake that perception.

That's tragic. Teaching kids to admin oracle is something you do in Tafe,
or an Oracle course, not a university. Anyway, what kind of course teaches
you about how to admin oracle as opposed to teaching you about ACID
properties, MVCC, distributed transactions and partitioning? Most of which
can be demonstrated with Postgres. We learnt about relational model,
algebra and calculus well before learning about SQL!

Hell, my Uni (UWA) actually uses MS Access for crying out loud! We learn
heaps of theory for 'real' databases (as above), but then our semester
project is to implement in MS Access a bunch of tables and queries for a UN
aid mission, for example. Not once do you have to use SQL - you just use
the query builder. How lame!

I have friends who have worked with people who've gone thru the oracle
course. They say it's frustrating because they only understand what they've
been told to understand and have a lack of knowledge about basic, database
principles.

> In fact, things got very heated when two universities in Sydney moved
> their SQL courses from Oracle and Sybase to PostgreSQL. Enrollments will
> be down next year for the courses and Australian universities are heavily
> geared toward bums on seats not facilitation of education.

Universities are supposed to have a tradition of open source support. Just
imagine if the professors could not only teach about how to do SQL, but ALSO
teach kids how a parser and executor and rewriter work by looking at the
actual source code!

Imagine those kids who go on to do honours, masters and PHD's in database
theory, indexing or whatever who could end up contributing to Postgres? ;)

What a sell! (For a real uni, that is ;) )

Chris


From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: PostgreSQL in Universities (Was: Re: 7.4 Wishlist)
Date: 2002-12-03 02:40:13
Message-ID: Pine.LNX.4.21.0212031321510.13371-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Mon, 2 Dec 2002, Christopher Kings-Lynne wrote:

> I've given a talk in the 2002 honours lecture series at UWA about Postgres
> and some of the things it can do. All of those guys were interested.
> Especially since the deptartment does a lot of work in genetic algoriithms.

Excellent. Can you put that talk online somewhere?

> Tell me when you start working on a document - I'm happy to help. Since I'm
> only just out of Uni, I'd like to write a set of possible assignments and
> learning outcomes and how you can use postgres to support them.
>
> My girlfriend is a PhD student at UWA CS dept :) plus I won the honours
> scholarship there a year or two back, so I can get interest from the dept,
> including the databases lecturer. Might help for another point of view and
> feedback.

Excellent. Are there any other people involved in PostgreSQL and
universities or educational institutions? If so we could put something
together about experiences for the advocacy Web site.

> That's tragic. Teaching kids to admin oracle is something you do in Tafe,
> or an Oracle course, not a university. Anyway, what kind of course teaches
> you about how to admin oracle as opposed to teaching you about ACID
> properties, MVCC, distributed transactions and partitioning? Most of which
> can be demonstrated with Postgres. We learnt about relational model,
> algebra and calculus well before learning about SQL!

Your interest in this is clearly the same as mine: Universities
(should) teach concept not product. I'm disgusted that this is not the
case.

If other people are interested we could work on this in January when I am
over your way, as discussed in private email.

Gavin


From: Justin Clift <justin(at)postgresql(dot)org>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL in Universities (Was: Re: 7.4 Wishlist)
Date: 2002-12-03 03:41:27
Message-ID: 3DEC27E7.9080908@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Gavin Sherry wrote:
> On Mon, 2 Dec 2002, Christopher Kings-Lynne wrote:
>
>
>>I've given a talk in the 2002 honours lecture series at UWA about Postgres
>>and some of the things it can do. All of those guys were interested.
>>Especially since the deptartment does a lot of work in genetic algoriithms.
>
>
> Excellent. Can you put that talk online somewhere?
>
>
>>Tell me when you start working on a document - I'm happy to help. Since I'm
>>only just out of Uni, I'd like to write a set of possible assignments and
>>learning outcomes and how you can use postgres to support them.
>>
>>My girlfriend is a PhD student at UWA CS dept :) plus I won the honours
>>scholarship there a year or two back, so I can get interest from the dept,
>>including the databases lecturer. Might help for another point of view and
>>feedback.
>
>
> Excellent. Are there any other people involved in PostgreSQL and
> universities or educational institutions? If so we could put something
> together about experiences for the advocacy Web site.

Is this the kind of thing that the Techdocs Guides area would be good
for? (http://techdocs.postgresql.org/guides)

:-)

Regards and best wishes,

Justin Clift

<snip>
>
> Gavin
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
Cc: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 05:01:06
Message-ID: 200212030501.gB3516i17728@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Magnus Naeslund(f) wrote:
> > select id, sum(sum_col)||'/'||count(*) from table_name
> > group by id;
> >
> > or
> >
> > select table_name.id, sum(sum_col)||'/'||t2.count from table_name,
> > (select id, count(*) as count from table_name group by id) as t2 where
> > table_name.id=t2.id group by table_name.id,t2.count;
> >
>
> Give it up already, i was MAKING A POINT, not trying to make an
> optimized count(*) thing :)
> There are other examples that you cannot get around, that will be
> evaluated more than once when a local "user variable" would make it not
> need to.

Here's an even slimmer query that makes a var:

test=> select var1.* from (select 1) as var1;
?column?
----------
1
(1 row)

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
Cc: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-03 05:02:53
Message-ID: 200212030502.gB352rO17879@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


Yes, we found a double pfree in 7.3. There will be a fix in 7.3.1.

---------------------------------------------------------------------------

Medi Montaseri wrote:
> Something is funny about this pfree()....here is a similar crash on a 7.2.3
>
> (gdb)
> #0 0x00420874 in heap_freetuple ()
> #1 0x004a8390 in acquire_sample_rows ()
> #2 0x004a75c8 in analyze_rel ()
> #3 0x0049f690 in vacuum ()
> #4 0x005585d8 in ProcessUtility ()
> #5 0x00553c78 in pg_exec_query_string ()
> #6 0x00555850 in PostgresMain ()
> #7 0x00524660 in DoBackend ()
> #8 0x00523d08 in BackendStartup ()
> #9 0x00521c18 in ServerLoop ()
> #10 0x005211c8 in PostmasterMain ()
> #11 0x004df3d8 in main ()
> #12 0x2ae34928 in __libc_start_main () from /lib/libc.so.6
> (gdb)
>
>
>
> Nicolai Tufar wrote:
>
> >Help!
> >Backend crashes on any COPY command I issue:
> >PostgreSQL is 7.3 release, is compiled from sources.
> >The message I get is:
> >
> >apb=# COPY maras2.mrk_yyn (bsvr_no, yyn_tur, yyn_no, yyn_syf, yyn_trh) TO
> >stdout;
> >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.
> >!#
> >
> >
> >The output of strace on backend is following:
> >
> ># strace -p 18883
> >recv(7, "QCOPY maras2.mrk_yyn (bsvr_no, y"..., 8192, 0) = 77
> >gettimeofday({1038713111, 629131}, NULL) = 0
> >_llseek(11, 0, [0], SEEK_SET) = 0
> >read(11, "\0\0\0\0\20\0\0\0\1\0\0\0\24\0\360\37\360\37\1 b1\5\0\1"..., 8192)
> >= 8192
> >read(11, "\0\0\0\0x#\375\"\20\0\0\0008\0h\35\360\37\1 \370\235\220"...,
> >8192) = 8192
> >_llseek(12, 0, [0], SEEK_SET) = 0
> >read(12, "\0\0\0\0\0#\375\"\20\0\0\0008\0(at)\34\0 \1 \200\237\0\1\0"..., 8192)
> >= 8192
> >_llseek(21, 40960, [40960], SEEK_SET) = 0
> >read(21, "\0\0\0\0\4\251\3#\20\0\0\0004\4p\17\360\37\1 \340\237 "..., 8192)
> >= 8192
> >_llseek(22, 106496, [106496], SEEK_SET) = 0
> >read(22, "\0\0\0\0(\326\377\"\20\0\0\0\10\1\200\1\0 \1 \200\237\0"..., 8192)
> >= 8192
> >read(17, "\0\0\0\0\20\0\0\0\1\0\0\0\360\0\20\1\0 \1 p\237 \1\340"..., 8192)
> >= 8192
> >open("/data/pgsql/base/2015749/2015757", O_RDWR|O_LARGEFILE) = 39
> >_llseek(39, 0, [20037632], SEEK_END) = 0
> >_llseek(39, 0, [0], SEEK_SET) = 0
> >read(39, "\0\0\0\0\270\7\4#\20\0\0\0\300\1\350\1\0 \1 \270\237\216"...,
> >8192) = 8192
> >--- SIGSEGV (Segmentation fault) ---
> >+++ killed by SIGSEGV +++
> >#
> >
> >I have recompiled postgres with debug information enabled, run gdb, attached
> >to backend process
> >and caught SIGSEGV as following:
> >
> >(gdb) continue
> >Continuing.
> >
> >Program received signal SIGSEGV, Segmentation fault.
> >0x081697bf in pfree (pointer=0x828a7b0) at mcxt.c:480
> >480 (*header->context->methods->free_p) (header->context,
> >pointer);
> >(gdb)
> >
> >
> >The output of bt is:
> >
> >(gdb) bt
> >#0 0x081697bf in pfree (pointer=0x828a7b0) at mcxt.c:480
> >#1 0x080b37be in CopyTo (rel=0x402be088, attnumlist=0x828a3f8, binary=0
> >'\0', oids=0 '\0',
> > fp=0x0, delim=0x81c2a57 "\t", null_print=0x81b2c22 "\\N") at copy.c:671
> >#2 0x080b32f6 in DoCopy (stmt=0x827b398) at copy.c:491
> >#3 0x08118a6a in pg_exec_query_string (query_string=0x827af48, dest=Remote,
> > parse_context=0x8245378) at postgres.c:789
> >#4 0x08119b89 in PostgresMain (argc=4, argv=0xbfffd2a0, username=0x8240a81
> >"postgres")
> > at postgres.c:2016
> >#5 0x08101d7c in DoBackend (port=0x8240950) at postmaster.c:2293
> >#6 0x081016c2 in BackendStartup (port=0x8240950) at postmaster.c:1915
> >#7 0x08100875 in ServerLoop () at postmaster.c:1000
> >#8 0x08100326 in PostmasterMain (argc=1, argv=0x82270c0) at
> >postmaster.c:779
> >#9 0x080debab in main (argc=1, argv=0xbfffdc34) at main.c:210
> >#10 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6
> >(gdb)
> >
> >
> >
> >Thanks in advance,
> >Nic
> >
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
> >
> >
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 05:14:13
Message-ID: 0a1a01c29a8a$d1da6370$f80c0a0a@mnd
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> Magnus Naeslund(f) wrote:
>>> select id, sum(sum_col)||'/'||count(*) from table_name
>>> group by id;
>>>
>>> or
>>>
>>> select table_name.id, sum(sum_col)||'/'||t2.count from table_name,
>>> (select id, count(*) as count from table_name group by id) as t2
>>> where table_name.id=t2.id group by table_name.id,t2.count;
>>>
>>
>> Give it up already, i was MAKING A POINT, not trying to make an
>> optimized count(*) thing :)
>> There are other examples that you cannot get around, that will be
>> evaluated more than once when a local "user variable" would make it
>> not need to.
>
> Here's an even slimmer query that makes a var:
>
> test=> select var1.* from (select 1) as var1;
> ?column?
> ----------
> 1
> (1 row)

Good!
Now convert this query so that it only evaluates the date_part thing
ONCE:

select t.id, date_part('days',now()-t.stamp) from table_name t where
date_part('days',now()-t.stamp) > 20;

I hope you all are kidding me in not seeing the real issue i'm trying to
show here.

Cheers
Magnus


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 05:20:17
Message-ID: 03de01c29a8b$aac36920$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> Good!
> Now convert this query so that it only evaluates the date_part thing
> ONCE:
>
> select t.id, date_part('days',now()-t.stamp) from table_name t where
> date_part('days',now()-t.stamp) > 20;

Yes, it's a bit of a bugger that one.

> I hope you all are kidding me in not seeing the real issue i'm trying to
> show here.

I see, yes. I guess the MySQL idea is to make it explicit to the parser
which parts of the expression are constant and equivalent.

Still, if the parser was smart enough, it could handle the above example
automatically. However, I think it would be an O(n^2) problem to solve -
matching all subexpressions against all other subexpressions to find the
ones that match...so the MySQL idea is a valid one.

One trick that many people don't know is that you can do it fast in the
GROUP BY clause, just not the WHERE clause:

select t.id, date_part('days',now()-t.stamp) from table_name t group by 2;

Which is something I just discovered recently.

Chris


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 05:27:03
Message-ID: 200212030527.gB35R4o22434@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Magnus Naeslund(f) wrote:
> Good!
> Now convert this query so that it only evaluates the date_part thing
> ONCE:
>
> select t.id, date_part('days',now()-t.stamp) from table_name t where
> date_part('days',now()-t.stamp) > 20;
>
> I hope you all are kidding me in not seeing the real issue i'm trying to
> show here.
>
> Cheers
> Magnus
>
>
>

Does this work?

SELECT t.id, x.date_part
FROM table_name t, (select date_part('days',now()-t.stamp)) as x
WHERE x.date_part > 20;

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 05:28:39
Message-ID: 20021202212110.X64892-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


On Tue, 3 Dec 2002, Magnus Naeslund(f) wrote:

> Now convert this query so that it only evaluates the date_part thing
> ONCE:

That's not a good idea as long as t.stamp varies from row to row. ;)
Perhaps once per row, maybe... :)

> select t.id, date_part('days',now()-t.stamp) from table_name t where
> date_part('days',now()-t.stamp) > 20;

Potentially I think something like this would do it:
select t.id, t.foo from (select id, date_part('days', now()-stamp)
as foo from table_name except select null, null) as t where foo>20;

It's not really an optimization given the required except, but if there
was some way to tell the system not to push clauses down into a subselect
you wouldn't even need that.


From: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
To: "Stephan Szabo" <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 05:31:52
Message-ID: 0a3501c29a8d$48c261c0$f80c0a0a@mnd
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> wrote:
> On Tue, 3 Dec 2002, Magnus Naeslund(f) wrote:
>
>> Now convert this query so that it only evaluates the date_part thing
>> ONCE:
>
> That's not a good idea as long as t.stamp varies from row to row. ;)
> Perhaps once per row, maybe... :)
>

I give up


From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 05:32:49
Message-ID: 20021202212905.R64892-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


On Tue, 3 Dec 2002, Bruce Momjian wrote:

> Magnus Naeslund(f) wrote:
> > Good!
> > Now convert this query so that it only evaluates the date_part thing
> > ONCE:
> >
> > select t.id, date_part('days',now()-t.stamp) from table_name t where
> > date_part('days',now()-t.stamp) > 20;
> >
> > I hope you all are kidding me in not seeing the real issue i'm trying to
> > show here.
>
> Does this work?
>
> SELECT t.id, x.date_part
> FROM table_name t, (select date_part('days',now()-t.stamp)) as x
> WHERE x.date_part > 20;

No, because the values in x are correlated to the particular row in
table_name, so I think you have to make it one big subselect in from. In
addition the optimizer is "smart" enough to push the condition down in
most cases which I think will force the function to be called twice unless
you trigger one of its cases that prevent it from doing so. That's an
optimizer hint I'd like (don't push conditions into this subquery,
really...). :)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>, Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-03 06:52:57
Message-ID: 20830.1038898377@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Yes, we found a double pfree in 7.3. There will be a fix in 7.3.1.

The double pfree was in COPY, though. This looks to be a different
issue.

>> (gdb)
>> #0 0x00420874 in heap_freetuple ()
>> #1 0x004a8390 in acquire_sample_rows ()
>> #2 0x004a75c8 in analyze_rel ()
>> #3 0x0049f690 in vacuum ()
>> #4 0x005585d8 in ProcessUtility ()
>> #5 0x00553c78 in pg_exec_query_string ()
>> #6 0x00555850 in PostgresMain ()

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 06:57:59
Message-ID: 20868.1038898679@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

"Magnus Naeslund(f)" <mag(at)fbab(dot)net> writes:
> Mysql is planning on making this work:
> SELECT id, @a:=COUNT(*), SUM(sum_col)/@a FROM table_name GROUP BY id.

We're supposed to spend our time emulating nonstandard features that
don't even exist yet? I think I have better things to do ...

regards, tom lane


From: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>
To: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 09:20:23
Message-ID: Pine.LNX.4.44.0212031008540.9578-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Tue, 3 Dec 2002, Magnus Naeslund(f) wrote:

> Now convert this query so that it only evaluates the date_part thing
> ONCE:
>
> select t.id, date_part('days',now()-t.stamp) from table_name t where
> date_part('days',now()-t.stamp) > 20;

Something like this could work:

select *
from (select t.id, date_part('days',now()-t.stamp) AS d
from table_name t) AS t1
where t1.d > 20;

That aside I also would like some sort of local names. Something like the
let construct used in many functional languages (not exaclty what you want
above, but still):

let t1 = select * from foo;
t2 = select * from bar;
in select * from t1 natural join t2;

But even though I would like to give name to subexpressions like above, I
still think postgresql should stick to standards as close as possible.

--
/Dennis


From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 09:45:41
Message-ID: 20021203094541.GC12458@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Mon, Dec 02, 2002 at 12:48:38PM -0800, Christopher Kings-Lynne wrote:
> But if there is, then the sum/count(*) is nonsensical anyway.

You must to use it in SERIALIZABLE transaction isolation.

Karel

--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/


From: Jan Hartmann <jhart(at)frw(dot)uva(dot)nl>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL in Universities (Was: Re: 7.4 Wishlist)
Date: 2002-12-03 09:58:45
Message-ID: 3DEC8055.4010403@frw.uva.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

I'm certainly interested! I am working here on Geographical Information
Systems with PostgreSQL/PostGIS with the Minnesota MapServer, with a lot
of regular database work thrown in. PostgreSQL has great potential for
teaching databases and SQL, and when the native Windows port is ready,
it will also be ideal for smaller, individual teaching projects (e.g. at
home).

Jan Hartmann
Department of Geography
University of Amsterdam
jhart(at)frw(dot)uva(dot)nl

Gavin Sherry wrote:
> On Mon, 2 Dec 2002, Christopher Kings-Lynne wrote:
>
>
>>I've given a talk in the 2002 honours lecture series at UWA about Postgres
>>and some of the things it can do. All of those guys were interested.
>>Especially since the deptartment does a lot of work in genetic algoriithms.
>
>
> Excellent. Can you put that talk online somewhere?
>
>
>>Tell me when you start working on a document - I'm happy to help. Since I'm
>>only just out of Uni, I'd like to write a set of possible assignments and
>>learning outcomes and how you can use postgres to support them.
>>
>>My girlfriend is a PhD student at UWA CS dept :) plus I won the honours
>>scholarship there a year or two back, so I can get interest from the dept,
>>including the databases lecturer. Might help for another point of view and
>>feedback.
>
>
> Excellent. Are there any other people involved in PostgreSQL and
> universities or educational institutions? If so we could put something
> together about experiences for the advocacy Web site.
>
>
>>That's tragic. Teaching kids to admin oracle is something you do in Tafe,
>>or an Oracle course, not a university. Anyway, what kind of course teaches
>>you about how to admin oracle as opposed to teaching you about ACID
>>properties, MVCC, distributed transactions and partitioning? Most of which
>>can be demonstrated with Postgres. We learnt about relational model,
>>algebra and calculus well before learning about SQL!
>
>
> Your interest in this is clearly the same as mine: Universities
> (should) teach concept not product. I'm disgusted that this is not the
> case.
>
> If other people are interested we could work on this in January when I am
> over your way, as discussed in private email.
>
> Gavin
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>


From: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 10:05:42
Message-ID: Pine.LNX.4.44.0212031103210.9578-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On 3 Dec 2002, Hannu Krosing wrote:

> the standard way of doing it would be SQL99's WITH :

Great! I havn't looked too much at sql99 yet so I've missed this. It's
exactly what I want. Now I know what I will use in the future (when it's
all implemented).

--
/Dennis


From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>
Cc: "Magnus Naeslund(f)" <mag(at)fbab(dot)net>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 11:46:09
Message-ID: 1038915968.17102.32.camel@huli
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Tue, 2002-12-03 at 09:20, Dennis Björklund wrote:
> On Tue, 3 Dec 2002, Magnus Naeslund(f) wrote:
>
> > Now convert this query so that it only evaluates the date_part thing
> > ONCE:
> >
> > select t.id, date_part('days',now()-t.stamp) from table_name t where
> > date_part('days',now()-t.stamp) > 20;
>
> Something like this could work:
>
> select *
> from (select t.id, date_part('days',now()-t.stamp) AS d
> from table_name t) AS t1
> where t1.d > 20;
>
> That aside I also would like some sort of local names. Something like the
> let construct used in many functional languages (not exaclty what you want
> above, but still):
>
> let t1 = select * from foo;
> t2 = select * from bar;
> in select * from t1 natural join t2;
>
> But even though I would like to give name to subexpressions like above, I
> still think postgresql should stick to standards as close as possible.

the standard way of doing it would be SQL99's WITH :

with t1 as (select * from foo)
t2 as (select * from bar)
select * from t1 natural join t2;

you can even use preceeding queries

with t1 as (select a,b from foo)
t1less as (select a,b from t1 where a < 0)
t1zero as (select a,b from t1 where a = 0)
select * from t1zero, t1less, where t1zero.b = t1less.a;

Having working WITH clause is also a prerequisite to implementing SQL99
recursive queries (where each query in WITH clause sees all other
queries in the WITH clause)

I sent a patch to this list recently that implements the above syntax,
but I currently dont have knowledge (nor time to aquire it), so if
someone else does not do it it will have to wait until January.

OTOH, I think that turning my parsetree to a plan would be quite easy
for someone familiar with turning parestrees into plans ;)

I offer to check if it works in current (and make it work again if it
does not) if someone would be willing to hold my hand in implementation
parsetree-->plan part ;).

I think that for non-recursive queries this is all that needs to be
done, i.e. the plan would not care if the subqueries were from FROM,
from WITH or from separately defined views.

--
Hannu Krosing <hannu(at)tm(dot)ee>


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>, "Magnus Naeslund(f)" <mag(at)fbab(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 16:00:47
Message-ID: 200212031600.gB3G0lU01223@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


Is WITH a TODO item?

---------------------------------------------------------------------------

Hannu Krosing wrote:
> On Tue, 2002-12-03 at 09:20, Dennis Bj?rklund wrote:
> > On Tue, 3 Dec 2002, Magnus Naeslund(f) wrote:
> >
> > > Now convert this query so that it only evaluates the date_part thing
> > > ONCE:
> > >
> > > select t.id, date_part('days',now()-t.stamp) from table_name t where
> > > date_part('days',now()-t.stamp) > 20;
> >
> > Something like this could work:
> >
> > select *
> > from (select t.id, date_part('days',now()-t.stamp) AS d
> > from table_name t) AS t1
> > where t1.d > 20;
> >
> > That aside I also would like some sort of local names. Something like the
> > let construct used in many functional languages (not exaclty what you want
> > above, but still):
> >
> > let t1 = select * from foo;
> > t2 = select * from bar;
> > in select * from t1 natural join t2;
> >
> > But even though I would like to give name to subexpressions like above, I
> > still think postgresql should stick to standards as close as possible.
>
> the standard way of doing it would be SQL99's WITH :
>
> with t1 as (select * from foo)
> t2 as (select * from bar)
> select * from t1 natural join t2;
>
> you can even use preceeding queries
>
> with t1 as (select a,b from foo)
> t1less as (select a,b from t1 where a < 0)
> t1zero as (select a,b from t1 where a = 0)
> select * from t1zero, t1less, where t1zero.b = t1less.a;
>
> Having working WITH clause is also a prerequisite to implementing SQL99
> recursive queries (where each query in WITH clause sees all other
> queries in the WITH clause)
>
> I sent a patch to this list recently that implements the above syntax,
> but I currently dont have knowledge (nor time to aquire it), so if
> someone else does not do it it will have to wait until January.
>
> OTOH, I think that turning my parsetree to a plan would be quite easy
> for someone familiar with turning parestrees into plans ;)
>
> I offer to check if it works in current (and make it work again if it
> does not) if someone would be willing to hold my hand in implementation
> parsetree-->plan part ;).
>
> I think that for non-recursive queries this is all that needs to be
> done, i.e. the plan would not care if the subqueries were from FROM,
> from WITH or from separately defined views.
>
> --
> Hannu Krosing <hannu(at)tm(dot)ee>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>, Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-03 16:03:33
Message-ID: 200212031603.gB3G3XJ02131@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


Ewe, yea.

---------------------------------------------------------------------------

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Yes, we found a double pfree in 7.3. There will be a fix in 7.3.1.
>
> The double pfree was in COPY, though. This looks to be a different
> issue.
>
> >> (gdb)
> >> #0 0x00420874 in heap_freetuple ()
> >> #1 0x004a8390 in acquire_sample_rows ()
> >> #2 0x004a75c8 in analyze_rel ()
> >> #3 0x0049f690 in vacuum ()
> >> #4 0x005585d8 in ProcessUtility ()
> >> #5 0x00553c78 in pg_exec_query_string ()
> >> #6 0x00555850 in PostgresMain ()
>
> regards, tom lane
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>, "Magnus Naeslund(f)" <mag(at)fbab(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 17:38:44
Message-ID: 200212031738.gB3Hcij13716@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


TODO updated. Thanks for the clarification.

---------------------------------------------------------------------------

Hannu Krosing wrote:
> On Tue, 2002-12-03 at 16:00, Bruce Momjian wrote:
> > Is WITH a TODO item?
>
> It is disguised as
>
> Exotic Features
> ===============
>
> * Add sql3 recursive unions
>
> Which was added at my request in dark times, possibly when PostgreSQL
> was called postgres95 ;)
>
> This should be changed to two items
>
> * Add SQL99 WITH clause to SELECT
>
> * Add SQL99 WITH RECURSIVE to SELECT
>
>
> > ---------------------------------------------------------------------------
> >
> > Hannu Krosing wrote:
> > > On Tue, 2002-12-03 at 09:20, Dennis Bj?rklund wrote:
> > > > On Tue, 3 Dec 2002, Magnus Naeslund(f) wrote:
> > > >
> > > > > Now convert this query so that it only evaluates the date_part thing
> > > > > ONCE:
> > > > >
> > > > > select t.id, date_part('days',now()-t.stamp) from table_name t where
> > > > > date_part('days',now()-t.stamp) > 20;
> > > >
> > > > Something like this could work:
> > > >
> > > > select *
> > > > from (select t.id, date_part('days',now()-t.stamp) AS d
> > > > from table_name t) AS t1
> > > > where t1.d > 20;
> > > >
> > > > That aside I also would like some sort of local names. Something like the
> > > > let construct used in many functional languages (not exaclty what you want
> > > > above, but still):
> > > >
> > > > let t1 = select * from foo;
> > > > t2 = select * from bar;
> > > > in select * from t1 natural join t2;
> > > >
> > > > But even though I would like to give name to subexpressions like above, I
> > > > still think postgresql should stick to standards as close as possible.
> > >
> > > the standard way of doing it would be SQL99's WITH :
> > >
> > > with t1 as (select * from foo)
> > > t2 as (select * from bar)
> > > select * from t1 natural join t2;
> > >
> > > you can even use preceeding queries
> > >
> > > with t1 as (select a,b from foo)
> > > t1less as (select a,b from t1 where a < 0)
> > > t1zero as (select a,b from t1 where a = 0)
> > > select * from t1zero, t1less, where t1zero.b = t1less.a;
> > >
> > > Having working WITH clause is also a prerequisite to implementing SQL99
> > > recursive queries (where each query in WITH clause sees all other
> > > queries in the WITH clause)
> > >
> > > I sent a patch to this list recently that implements the above syntax,
> > > but I currently dont have knowledge (nor time to aquire it), so if
> > > someone else does not do it it will have to wait until January.
> > >
> > > OTOH, I think that turning my parsetree to a plan would be quite easy
> > > for someone familiar with turning parestrees into plans ;)
> > >
> > > I offer to check if it works in current (and make it work again if it
> > > does not) if someone would be willing to hold my hand in implementation
> > > parsetree-->plan part ;).
> > >
> > > I think that for non-recursive queries this is all that needs to be
> > > done, i.e. the plan would not care if the subqueries were from FROM,
> > > from WITH or from separately defined views.
> > >
> > > --
> > > Hannu Krosing <hannu(at)tm(dot)ee>
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 3: if posting/reading through Usenet, please send an appropriate
> > > subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> > > message can get through to the mailing list cleanly
> > >
> --
> Hannu Krosing <hannu(at)tm(dot)ee>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>, "Magnus Naeslund(f)" <mag(at)fbab(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 19:06:57
Message-ID: 1038942416.17102.64.camel@huli
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Tue, 2002-12-03 at 16:00, Bruce Momjian wrote:
> Is WITH a TODO item?

It is disguised as

Exotic Features
===============

* Add sql3 recursive unions

Which was added at my request in dark times, possibly when PostgreSQL
was called postgres95 ;)

This should be changed to two items

* Add SQL99 WITH clause to SELECT

* Add SQL99 WITH RECURSIVE to SELECT

> ---------------------------------------------------------------------------
>
> Hannu Krosing wrote:
> > On Tue, 2002-12-03 at 09:20, Dennis Bj?rklund wrote:
> > > On Tue, 3 Dec 2002, Magnus Naeslund(f) wrote:
> > >
> > > > Now convert this query so that it only evaluates the date_part thing
> > > > ONCE:
> > > >
> > > > select t.id, date_part('days',now()-t.stamp) from table_name t where
> > > > date_part('days',now()-t.stamp) > 20;
> > >
> > > Something like this could work:
> > >
> > > select *
> > > from (select t.id, date_part('days',now()-t.stamp) AS d
> > > from table_name t) AS t1
> > > where t1.d > 20;
> > >
> > > That aside I also would like some sort of local names. Something like the
> > > let construct used in many functional languages (not exaclty what you want
> > > above, but still):
> > >
> > > let t1 = select * from foo;
> > > t2 = select * from bar;
> > > in select * from t1 natural join t2;
> > >
> > > But even though I would like to give name to subexpressions like above, I
> > > still think postgresql should stick to standards as close as possible.
> >
> > the standard way of doing it would be SQL99's WITH :
> >
> > with t1 as (select * from foo)
> > t2 as (select * from bar)
> > select * from t1 natural join t2;
> >
> > you can even use preceeding queries
> >
> > with t1 as (select a,b from foo)
> > t1less as (select a,b from t1 where a < 0)
> > t1zero as (select a,b from t1 where a = 0)
> > select * from t1zero, t1less, where t1zero.b = t1less.a;
> >
> > Having working WITH clause is also a prerequisite to implementing SQL99
> > recursive queries (where each query in WITH clause sees all other
> > queries in the WITH clause)
> >
> > I sent a patch to this list recently that implements the above syntax,
> > but I currently dont have knowledge (nor time to aquire it), so if
> > someone else does not do it it will have to wait until January.
> >
> > OTOH, I think that turning my parsetree to a plan would be quite easy
> > for someone familiar with turning parestrees into plans ;)
> >
> > I offer to check if it works in current (and make it work again if it
> > does not) if someone would be willing to hold my hand in implementation
> > parsetree-->plan part ;).
> >
> > I think that for non-recursive queries this is all that needs to be
> > done, i.e. the plan would not care if the subqueries were from FROM,
> > from WITH or from separately defined views.
> >
> > --
> > Hannu Krosing <hannu(at)tm(dot)ee>
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> > message can get through to the mailing list cleanly
> >
--
Hannu Krosing <hannu(at)tm(dot)ee>


From: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
To: Justin Clift <justin(at)postgresql(dot)org>
Cc: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL in Universities (Was: Re: 7.4 Wishlist)
Date: 2002-12-03 19:13:56
Message-ID: 20021203151304.M36076-100000@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Tue, 3 Dec 2002, Justin Clift wrote:

> > Excellent. Are there any other people involved in PostgreSQL and
> > universities or educational institutions? If so we could put something
> > together about experiences for the advocacy Web site.
>
> Is this the kind of thing that the Techdocs Guides area would be good
> for? (http://techdocs.postgresql.org/guides)

Seems that any discussions about "experiences" belongs on Advocacy, no?


From: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-03 19:36:36
Message-ID: 3DED07C4.4000602@intransa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Can I have a patch and would it work against 7.2.3.....

Thanks
Bruce Momjian wrote:

>Yes, we found a double pfree in 7.3. There will be a fix in 7.3.1.
>
>---------------------------------------------------------------------------
>
>Medi Montaseri wrote:
>
>
>>Something is funny about this pfree()....here is a similar crash on a 7.2.3
>>
>>(gdb)
>>#0 0x00420874 in heap_freetuple ()
>>#1 0x004a8390 in acquire_sample_rows ()
>>#2 0x004a75c8 in analyze_rel ()
>>#3 0x0049f690 in vacuum ()
>>#4 0x005585d8 in ProcessUtility ()
>>#5 0x00553c78 in pg_exec_query_string ()
>>#6 0x00555850 in PostgresMain ()
>>#7 0x00524660 in DoBackend ()
>>#8 0x00523d08 in BackendStartup ()
>>#9 0x00521c18 in ServerLoop ()
>>#10 0x005211c8 in PostmasterMain ()
>>#11 0x004df3d8 in main ()
>>#12 0x2ae34928 in __libc_start_main () from /lib/libc.so.6
>>(gdb)
>>
>>
>>
>>Nicolai Tufar wrote:
>>
>>
>>
>>>Help!
>>>Backend crashes on any COPY command I issue:
>>>PostgreSQL is 7.3 release, is compiled from sources.
>>>The message I get is:
>>>
>>>apb=# COPY maras2.mrk_yyn (bsvr_no, yyn_tur, yyn_no, yyn_syf, yyn_trh) TO
>>>stdout;
>>>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.
>>>!#
>>>
>>>
>>>The output of strace on backend is following:
>>>
>>># strace -p 18883
>>>recv(7, "QCOPY maras2.mrk_yyn (bsvr_no, y"..., 8192, 0) = 77
>>>gettimeofday({1038713111, 629131}, NULL) = 0
>>>_llseek(11, 0, [0], SEEK_SET) = 0
>>>read(11, "\0\0\0\0\20\0\0\0\1\0\0\0\24\0\360\37\360\37\1 b1\5\0\1"..., 8192)
>>>= 8192
>>>read(11, "\0\0\0\0x#\375\"\20\0\0\0008\0h\35\360\37\1 \370\235\220"...,
>>>8192) = 8192
>>>_llseek(12, 0, [0], SEEK_SET) = 0
>>>read(12, "\0\0\0\0\0#\375\"\20\0\0\0008\0(at)\34\0 \1 \200\237\0\1\0"..., 8192)
>>>= 8192
>>>_llseek(21, 40960, [40960], SEEK_SET) = 0
>>>read(21, "\0\0\0\0\4\251\3#\20\0\0\0004\4p\17\360\37\1 \340\237 "..., 8192)
>>>= 8192
>>>_llseek(22, 106496, [106496], SEEK_SET) = 0
>>>read(22, "\0\0\0\0(\326\377\"\20\0\0\0\10\1\200\1\0 \1 \200\237\0"..., 8192)
>>>= 8192
>>>read(17, "\0\0\0\0\20\0\0\0\1\0\0\0\360\0\20\1\0 \1 p\237 \1\340"..., 8192)
>>>= 8192
>>>open("/data/pgsql/base/2015749/2015757", O_RDWR|O_LARGEFILE) = 39
>>>_llseek(39, 0, [20037632], SEEK_END) = 0
>>>_llseek(39, 0, [0], SEEK_SET) = 0
>>>read(39, "\0\0\0\0\270\7\4#\20\0\0\0\300\1\350\1\0 \1 \270\237\216"...,
>>>8192) = 8192
>>>--- SIGSEGV (Segmentation fault) ---
>>>+++ killed by SIGSEGV +++
>>>#
>>>
>>>I have recompiled postgres with debug information enabled, run gdb, attached
>>>to backend process
>>>and caught SIGSEGV as following:
>>>
>>>(gdb) continue
>>>Continuing.
>>>
>>>Program received signal SIGSEGV, Segmentation fault.
>>>0x081697bf in pfree (pointer=0x828a7b0) at mcxt.c:480
>>>480 (*header->context->methods->free_p) (header->context,
>>>pointer);
>>>(gdb)
>>>
>>>
>>>The output of bt is:
>>>
>>>(gdb) bt
>>>#0 0x081697bf in pfree (pointer=0x828a7b0) at mcxt.c:480
>>>#1 0x080b37be in CopyTo (rel=0x402be088, attnumlist=0x828a3f8, binary=0
>>>'\0', oids=0 '\0',
>>> fp=0x0, delim=0x81c2a57 "\t", null_print=0x81b2c22 "\\N") at copy.c:671
>>>#2 0x080b32f6 in DoCopy (stmt=0x827b398) at copy.c:491
>>>#3 0x08118a6a in pg_exec_query_string (query_string=0x827af48, dest=Remote,
>>> parse_context=0x8245378) at postgres.c:789
>>>#4 0x08119b89 in PostgresMain (argc=4, argv=0xbfffd2a0, username=0x8240a81
>>>"postgres")
>>> at postgres.c:2016
>>>#5 0x08101d7c in DoBackend (port=0x8240950) at postmaster.c:2293
>>>#6 0x081016c2 in BackendStartup (port=0x8240950) at postmaster.c:1915
>>>#7 0x08100875 in ServerLoop () at postmaster.c:1000
>>>#8 0x08100326 in PostmasterMain (argc=1, argv=0x82270c0) at
>>>postmaster.c:779
>>>#9 0x080debab in main (argc=1, argv=0xbfffdc34) at main.c:210
>>>#10 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6
>>>(gdb)
>>>
>>>
>>>
>>>Thanks in advance,
>>>Nic
>>>
>>>
>>>---------------------------(end of broadcast)---------------------------
>>>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>>>
>>>
>>>
>>>
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 5: Have you checked our extensive FAQ?
>>
>>http://www.postgresql.org/users-lounge/docs/faq.html
>>
>>
>>
>
>
>


From: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-03 19:42:23
Message-ID: 3DED091F.70405@intransa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

FYI, I'm experiencing this with Async Queries (Async Purge and Aysnc
Vacuum).

Tom Lane wrote:

>Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>
>
>>Yes, we found a double pfree in 7.3. There will be a fix in 7.3.1.
>>
>>
>
>The double pfree was in COPY, though. This looks to be a different
>issue.
>
>
>
>>>(gdb)
>>>#0 0x00420874 in heap_freetuple ()
>>>#1 0x004a8390 in acquire_sample_rows ()
>>>#2 0x004a75c8 in analyze_rel ()
>>>#3 0x0049f690 in vacuum ()
>>>#4 0x005585d8 in ProcessUtility ()
>>>#5 0x00553c78 in pg_exec_query_string ()
>>>#6 0x00555850 in PostgresMain ()
>>>
>>>
>
> regards, tom lane
>
>


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-03 19:51:23
Message-ID: 200212031951.gB3JpN128757@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


I was wrong. We found a COPY bug in 7.3 that will be fixed in 7.3.1.
Would you compile with symbols, -g, and send a new backtrace?

---------------------------------------------------------------------------

Medi Montaseri wrote:
> FYI, I'm experiencing this with Async Queries (Async Purge and Aysnc
> Vacuum).
>
> Tom Lane wrote:
>
> >Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> >
> >
> >>Yes, we found a double pfree in 7.3. There will be a fix in 7.3.1.
> >>
> >>
> >
> >The double pfree was in COPY, though. This looks to be a different
> >issue.
> >
> >
> >
> >>>(gdb)
> >>>#0 0x00420874 in heap_freetuple ()
> >>>#1 0x004a8390 in acquire_sample_rows ()
> >>>#2 0x004a75c8 in analyze_rel ()
> >>>#3 0x0049f690 in vacuum ()
> >>>#4 0x005585d8 in ProcessUtility ()
> >>>#5 0x00553c78 in pg_exec_query_string ()
> >>>#6 0x00555850 in PostgresMain ()
> >>>
> >>>
> >
> > regards, tom lane
> >
> >
>
>
>
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Vince Vielhaber <vev(at)michvhf(dot)com>
To: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: Justin Clift <justin(at)postgresql(dot)org>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL in Universities (Was: Re: 7.4 Wishlist)
Date: 2002-12-03 20:08:50
Message-ID: Pine.BSF.4.44.0212031507410.34317-100000@paprika.michvhf.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Tue, 3 Dec 2002, Marc G. Fournier wrote:

> On Tue, 3 Dec 2002, Justin Clift wrote:
>
> > > Excellent. Are there any other people involved in PostgreSQL and
> > > universities or educational institutions? If so we could put something
> > > together about experiences for the advocacy Web site.
> >
> > Is this the kind of thing that the Techdocs Guides area would be good
> > for? (http://techdocs.postgresql.org/guides)
>
> Seems that any discussions about "experiences" belongs on Advocacy, no?

Where have you been? The lines of distinction between all of the lists
have gotten so blurred it hardly makes a difference.

Vince.
--
http://www.meanstreamradio.com http://www.unknown-artists.com
Internet radio: It's not file sharing, it's just radio.


From: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
To: Vince Vielhaber <vev(at)michvhf(dot)com>
Cc: Justin Clift <justin(at)postgresql(dot)org>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL in Universities (Was: Re: 7.4 Wishlist)
Date: 2002-12-03 20:24:41
Message-ID: 20021203162325.M36076-100000@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Tue, 3 Dec 2002, Vince Vielhaber wrote:

> On Tue, 3 Dec 2002, Marc G. Fournier wrote:
>
> > On Tue, 3 Dec 2002, Justin Clift wrote:
> >
> > > > Excellent. Are there any other people involved in PostgreSQL and
> > > > universities or educational institutions? If so we could put something
> > > > together about experiences for the advocacy Web site.
> > >
> > > Is this the kind of thing that the Techdocs Guides area would be good
> > > for? (http://techdocs.postgresql.org/guides)
> >
> > Seems that any discussions about "experiences" belongs on Advocacy, no?
>
> Where have you been? The lines of distinction between all of the lists
> have gotten so blurred it hardly makes a difference.

Actually, there are lines, Justin just occasionally appears to 'blur' them
until I get a chance to refresh them ... eh Justin?:)


From: Kevin Brown <kevin(at)sysexperts(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 20:49:58
Message-ID: 20021203204958.GA31342@filer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Al Sutton wrote:
> Point to Point and Broadcast replication
> ----------------------------------------
> With point to point you specify multiple endpoints, with broadcast you can
> specify a subnet address and the updates are broadcast over that subnet.
>
> The difference being that point to point works well for cross network
> replication, or where you have a few replicants. I have multiple database
> servers which could have a deadicated class C network that they are all on,
> by broadcasting updates you can cutdown the amount of traffic on that net by
> a factor of n minus 1 (where n is the number of servers involved).

Yech. Now you can't use TCP anymore, so the underlying replication
code has to handle all the issues that TCP deals with transparently,
like error checking, retransmits, data windows, etc. I don't think
it's wise to assume that your transport layer is 100% reliable.

Further, this doesn't even address the problem of bringing up a leaf
server that's been down a while. It can be significantly out of date
relative to the other servers on the subnet.

I suspect you'll be better off implementing a replication protocol
that has the leaf nodes keeping each other up to date, to minimize the
traffic coming from the next level up. Then you can use TCP for the
connections but minimize the traffic generated by any given node.

> Ability to use raw partitions
> ----------------------------
>
> I've not seen an install of PostgreSQL yet that didn't put the database
> files onto a filesystem, so I'm assuming it's the only way of doing it. By
> using the filesystem the files are at the mercy of filesystem handler code
> as to where they end up on the disk, and thus the speed of access will
> always have some dependancy on the speed of the filesystem.
>
> With a raw partition it would be possible to use two devices (e.g. /dev/hde
> and /dev/hdg on an eight channel ide linux box), and PostgreSQL could then
> ensure the WALs were located on one the disk with the entries running
> sequentally, and that the database files were located on the other disk in
> the most appropriate location (e.g. index data starting near the center of
> the disk, and user table data starting near the outside).

Yeah, but now you have to worry about optimizing placement of blocks,
optimizing writes, etc. These are things the OS should worry about,
not the database server.

If you're really that concerned about these issues, store the WAL on
one (empty) filesystem and the tables on another (empty and separate)
filesystem. With any reasonable filesystem you'll get reasonably
close to optimal performance, especially if the filesystem code is
capable of analyzing the write patterns and adapting itself
accordingly.

In short, I'd much rather spend the effort improving the filesystem
(where everyone can benefit) than improving PostgreSQL (where only
PostgreSQL users can benefit) for this item.

The one good reason for making it possible to use raw partitions is to
make it possible to use the PostgreSQL engine as a filesystem! :-)

> Win32 Port
> ------------
> I've explained the reasons before. Apart from that it's always useful to
> open PostgreSQL up to a larger audience.

Agreed.

- Kevin Brown


From: "Dan Langille" <dan(at)langille(dot)org>
To: Vince Vielhaber <vev(at)michvhf(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL in Universities (Was: Re: 7.4 Wishlist)
Date: 2002-12-03 20:51:18
Message-ID: 3DECD2F6.21530.FD176B52@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On 3 Dec 2002 at 15:08, Vince Vielhaber wrote:

> Where have you been? The lines of distinction between all of the
> lists have gotten so blurred it hardly makes a difference.

So consider this a wake up call.
--
Dan Langille : http://www.langille.org/


From: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
To: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL in Universities (Was: Re: 7.4 Wishlist)
Date: 2002-12-03 21:16:50
Message-ID: 3DED1F42.5050506@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Hi ...

I just wanted to admit that an important collegue in Vienna already uses
PostgreSQL instead of Oracle which makes me really proud :).

We have done a training course this year and they use PostgreSQL instead
of free Oracle
I am happy that Austrian students are tortured with the things I have
taught this year *g*..

Hans

--
*Cybertec Geschwinde u Schoenig*
Ludo-Hartmannplatz 1/14, A-1160 Vienna, Austria
Tel: +43/1/913 68 09; +43/664/233 90 75
www.postgresql.at <http://www.postgresql.at>, cluster.postgresql.at
<http://cluster.postgresql.at>, www.cybertec.at
<http://www.cybertec.at>, kernel.cybertec.at <http://kernel.cybertec.at>


From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Kevin Brown <kevin(at)sysexperts(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 21:30:13
Message-ID: 1038951012.33734.38.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


> The one good reason for making it possible to use raw partitions is to
> make it possible to use the PostgreSQL engine as a filesystem! :-)

Hmm.. Something just doesn't seem right about that thought ;)

CREATE DATABASE filesystem;
\c filesystem
CREATE EXPORT /mnt AS NFS;
\q

mount_nfs -o port=5432 localhost:/mnt /mnt
ls /mnt/pg_class

--
Rod Taylor <rbt(at)rbt(dot)ca>

PGP Key: http://www.rbt.ca/rbtpub.asc


From: Justin Clift <justin(at)postgresql(dot)org>
To: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL in Universities (Was: Re: 7.4 Wishlist)
Date: 2002-12-03 23:09:04
Message-ID: 3DED3990.2060607@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Marc G. Fournier wrote:
> On Tue, 3 Dec 2002, Justin Clift wrote:
>
>
>>>Excellent. Are there any other people involved in PostgreSQL and
>>>universities or educational institutions? If so we could put something
>>>together about experiences for the advocacy Web site.
>>
>>Is this the kind of thing that the Techdocs Guides area would be good
>>for? (http://techdocs.postgresql.org/guides)
>
>
> Seems that any discussions about "experiences" belongs on Advocacy, no?

Good point.

Have put a *really basic* Zwiki framework at:

http://advocacy.postgresql.org/documents

It's the same collaborative software used for the PostgreSQL Guides
section, but without the look+feel added.

If you want to start editing stuff right away, then feel free to use it.
If you'd like it to look better first though, then it'll be a few days...

:-)

Regards and best wishes,

Justin Clift

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: David Wheeler <david(at)wheeler(dot)net>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-03 23:15:31
Message-ID: Pine.LNX.4.44.0212022040230.12428-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Joe Conway writes:

> That is one thing I'd like to take a look at. I think the problem is that
> certain byte-sequence/multibyte-encoding combinations are illegal, so it's not
> as simple an issue as it might first appear.

The bytea type really shouldn't come even close to having to care about
this.

Actually, if you want to improve the ugly bytea literal syntax, implement
the standard BLOB type.

--
Peter Eisentraut peter_e(at)gmx(dot)net


From: Justin Clift <justin(at)postgresql(dot)org>
To: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: Vince Vielhaber <vev(at)michvhf(dot)com>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL in Universities (Was: Re: 7.4 Wishlist)
Date: 2002-12-03 23:17:40
Message-ID: 3DED3B94.10101@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Marc G. Fournier wrote:
<snip>
> Actually, there are lines, Justin just occasionally appears to 'blur' them
> until I get a chance to refresh them ... eh Justin?:)

[innocent whistle]

+ Justin


From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Justin Clift" <justin(at)postgresql(dot)org>, "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: "Gavin Sherry" <swm(at)linuxworld(dot)com(dot)au>, "Advocacy" <pgsql-advocacy(at)postgresql(dot)org>
Subject: Zwiki (moved from -hackers)
Date: 2002-12-04 00:06:16
Message-ID: 011801c29b28$f8e835c0$6500a8c0@internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> Have put a *really basic* Zwiki framework at:
>
> http://advocacy.postgresql.org/documents
>
> It's the same collaborative software used for the PostgreSQL Guides
> section, but without the look+feel added.
>
> If you want to start editing stuff right away, then feel free to use it.

How do you actually edit something or create something - I can't find any
way of doing that.

Chris


From: Justin Clift <justin(at)postgresql(dot)org>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, Advocacy <pgsql-advocacy(at)postgresql(dot)org>
Subject: Re: Zwiki (moved from -hackers)
Date: 2002-12-04 02:01:53
Message-ID: 3DED6211.7040106@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Christopher Kings-Lynne wrote:
<snip>
> How do you actually edit something or create something - I can't find any
> way of doing that.

Oops...

There definitely needs to be a lot more intro stuff on there along the
lines of "how do I use this?"... :-/

You create a new document by going to the "intended URL".

i.e.

http://techdocs.postgresql.org/guides/SomeURL

or:

http://advocacy.postgresql.org/documents/ADifferentURL

For both of these, as there isn't really anything there, it will offer
you the option of creating a new document there. It does that instead
of the standard 404 Webserver error.

That's generally the easiest way of creating a new document.

So, as a test you might want to try out:

http://techdocs.postgresql.org/guides/ChrisesDocs

or similar.

:-)

Regards and best wishes,

Justin Clift

> Chris
>

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi


From: Manuel Cabido <manny(at)tinago(dot)msuiit(dot)edu(dot)ph>
To: hs(at)cybertec(dot)at
Cc: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL in Universities (Was: Re: 7.4 Wishlist)
Date: 2002-12-04 04:18:13
Message-ID: Pine.LNX.4.44.0212041211320.11785-100000@tinago.msuiit.edu.ph
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Hi:

We at the Department of Information Technology of the Mindanao State
University-Iligan Institute of Technology (MSU-IIT) in Iligan City,
Philippines had been using PostgreSQL since 1998 in teaching courses in
Databases, SQL, and as a support tool in teaching Software Engineering and
Web Application Development. We are even utilizing it as our database
backend in all applications we developed in-house like Payroll, Student
Enrollment, Financial Applications, etc. At the rate PostgreSQL is
performing, we are not for any reason tempted to migrate to another
database for the next ten years.

THANKS TO THE POSTGRESQL DEVELOPMENT TEAM.

We Salute YOU!

PROF. MANUEL C. CABIDO
Chair
Department of Information Technology
MSU-IIT
Iligan City 9200
Philippines


From: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault in 7.3
Date: 2002-12-04 09:01:23
Message-ID: 200212041001.23300.ftm.van.vugt@foxi.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

I encountered a reproducable backend crash in the following situation:

- while running a conversion tool written in TrollTech's Qt that uses libpq

- apart from the tool, only one inactive psql-client is connected to the same
database (for extra monitoring)

- during the conversion session this tool creates a number of temporary tables

The backend crashes when at the end of the conversion a 'vacuum full analyse'
is started, more specifically it dies upon doing work on one of these
temporary tables....

Obviously, no problem is encountered when vacuuming *after* the tool has
finished.

Is this known behaviour?

Otherwise, I'd be glad to assist with a backtrace.

Regards,

Frank.


From: "Al Sutton" <al(at)alsutton(dot)com>
To: "Kevin Brown" <kevin(at)sysexperts(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Cc: <pgreplication-general(at)gborg(dot)postgresql(dot)org>
Subject: Broadcast replication (Was Re: 7.4 Wishlist)
Date: 2002-12-04 09:47:16
Message-ID: 017601c29b7a$21db49d0$0100a8c0@cloud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers


----- Original Message -----
From: "Kevin Brown" <kevin(at)sysexperts(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Sent: Tuesday, December 03, 2002 8:49 PM
Subject: [mail] Re: [HACKERS] 7.4 Wishlist

> Al Sutton wrote:
> > Point to Point and Broadcast replication
> > ----------------------------------------
> > With point to point you specify multiple endpoints, with broadcast you
can
> > specify a subnet address and the updates are broadcast over that subnet.
> >
> > The difference being that point to point works well for cross network
> > replication, or where you have a few replicants. I have multiple
database
> > servers which could have a deadicated class C network that they are all
on,
> > by broadcasting updates you can cutdown the amount of traffic on that
net by
> > a factor of n minus 1 (where n is the number of servers involved).
>
> Yech. Now you can't use TCP anymore, so the underlying replication
> code has to handle all the issues that TCP deals with transparently,
> like error checking, retransmits, data windows, etc. I don't think
> it's wise to assume that your transport layer is 100% reliable.
>
> Further, this doesn't even address the problem of bringing up a leaf
> server that's been down a while. It can be significantly out of date
> relative to the other servers on the subnet.
>
> I suspect you'll be better off implementing a replication protocol
> that has the leaf nodes keeping each other up to date, to minimize the
> traffic coming from the next level up. Then you can use TCP for the
> connections but minimize the traffic generated by any given node.
>

I wasn't saying that ALL replication traffic must be broadcast, if a
specific server needs a refresh when it comes then point to point is fine
because only one machine needs the data, and thus broadcasting it to all
would load machines with data they didn't need.

The aim of using broadcast is to cut down the ongoing traffic, say, for
example, I have a cluster of ten database servers I can connect them onto a
dedicated LAN shared only by database servers and I would see 10% of the
traffic I would get if I were using point to point (this is assuming that
the addition of error checking, retransmits, etc. to the broadcast protocol
adds a similiar overhead per packet as TCP point to point).

If others wish to know more about this I can prepare an overview for how I
see it working.

[Other points snipped]


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault in 7.3
Date: 2002-12-04 14:09:46
Message-ID: 13737.1039010986@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl> writes:
> Is this known behaviour?

Nope.

> Otherwise, I'd be glad to assist with a backtrace.

Please.

regards, tom lane


From: Kevin Brown <kevin(at)sysexperts(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-04 21:57:31
Message-ID: 20021204215730.GB31342@filer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> wrote:
> Hi guys,
>
> Just out of interest, if someone was going to pay you to hack on Postgres
> for 6 months, what would you like to code for 7.4?

Well, on top of the oft-requested replication support and savepoint
support, I'd like to see UPDATE, er, updated to be able to make use of
cursors.

I'd also like to see (if this is even possible) a transaction
isolation mode that would make it possible for multiple concurrent
updates to the same row to happen without blocking each other (I
imagine one way to make this possible would be for the last
transaction to commit to be the one that "wins". Each transaction
that commits gets its updates written so that other transactions that
begin after they commit will see them, of course). Neither "read
committed" nor "serialized" modes offer this. Don't know if it's
possible, but it would be nice (such that a transaction sees the
database as if it has it all to itself and doesn't block on
updates)...

- Kevin


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Kevin Brown <kevin(at)sysexperts(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-05 06:21:12
Message-ID: 200212050621.gB56LCJ29961@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Kevin Brown wrote:
> Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> wrote:
> > Hi guys,
> >
> > Just out of interest, if someone was going to pay you to hack on Postgres
> > for 6 months, what would you like to code for 7.4?
>
> Well, on top of the oft-requested replication support and savepoint
> support, I'd like to see UPDATE, er, updated to be able to make use of
> cursors.

I think this could be easily done by using the tid of the cursor row for
the update, assuming there is a clear tid for the SELECT. Jan has
talked about doing that.

> I'd also like to see (if this is even possible) a transaction
> isolation mode that would make it possible for multiple concurrent
> updates to the same row to happen without blocking each other (I
> imagine one way to make this possible would be for the last
> transaction to commit to be the one that "wins". Each transaction
> that commits gets its updates written so that other transactions that
> begin after they commit will see them, of course). Neither "read
> committed" nor "serialized" modes offer this. Don't know if it's
> possible, but it would be nice (such that a transaction sees the
> database as if it has it all to itself and doesn't block on
> updates)...

How would you do the update if you don't know of the transaction commits
or aborts?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault in 7.3 while vacuuming
Date: 2002-12-05 12:16:18
Message-ID: 200212051316.18848.ftm.van.vugt@foxi.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

> Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl> writes:
> > Is this known behaviour?
>
TL> Nope.
>
> > Otherwise, I'd be glad to assist with a backtrace.
>
TL> Please.

** PostgreSQL v7.3 configured with:
./configure --prefix=/usr/src/postgresql_debug/pgsql --enable-debug
--with-openssl --with-perl --with-python --with-tcl --with-pgport=5433

** while using a client written in TrollTech's QT v3.1 that creates a number
of temporary tables, uses a number lot of 'copy' statements and at the end
tries to 'vacuum full analyse' the database

** the backend crashes.... ;(

** last information received by the frontend:
INFO: --Relation pg_temp_2.t_article_details--
Warning: QSqlDatabaseManager unable to open database: FATAL: The database
system is in recovery mode

** backend's log:
LOG: query: update stock_pick set amount = case when pallet_amount >
amount_stock then amount_stock else pallet_amount end from
t_stock where stock_pick.article_id = t_stock.id
LOG: recycled transaction log file 0000000000000017
LOG: query: update t_stock set amount_stock = case when pallet_amount >
amount_stock then 0 else amount_stock - pallet_amount end where
exists (select 1 from stock_pick where article_id = t_stock.id)
LOG: query: insert into stock_bulk select 5, id, amount_stock, 0, 1, false,
null from t_stock
LOG: query: SELECT 1 FROM ONLY "public"."location" x WHERE "id" = $1 FOR
UPDATE OF x
LOG: query: SELECT 1 FROM ONLY "public"."article" x WHERE "id" = $1 FOR
UPDATE OF x
LOG: query: SELECT 1 FROM ONLY "public"."pallet_type" x WHERE "id" = $1 FOR
UPDATE OF x
LOG: query: truncate table t_stock
LOG: query: drop table aux_country, aux_language, aux_purchaser,
aux_salesperson, aux_valuta, aux_address
LOG: query: drop index temp01, temp02, temp03
LOG: query: vacuum full verbose analyse
LOG: recycled transaction log file 000000000000001A
LOG: recycled transaction log file 0000000000000018
LOG: recycled transaction log file 0000000000000019
LOG: server process (pid 32663) was terminated by signal 11
LOG: terminating any other active server processes
WARNING: Message from PostgreSQL backend:
The Postmaster has informed me that some other backend
died abnormally and possibly corrupted shared memory.
I have rolled back the current transaction and am
going to terminate your database system connection and exit.
Please reconnect to the database system and repeat your query.
LOG: connection received: host=192.168.0.79 port=33762
FATAL: The database system is in recovery mode
LOG: all server processes terminated; reinitializing shared memory and
semaphores
LOG: database system was interrupted at 2002-12-05 12:22:50 CET
LOG: checkpoint record is at 0/1DAEA234
LOG: redo record is at 0/1D8D2C10; undo record is at 0/0; shutdown FALSE
LOG: next transaction id: 5145; next oid: 451153
LOG: database system was not properly shut down; automatic recovery in
progress
LOG: redo starts at 0/1D8D2C10
LOG: ReadRecord: record with zero length at 0/1DB74550
LOG: redo done at 0/1DB7452C
LOG: recycled transaction log file 000000000000001B
LOG: recycled transaction log file 000000000000001C
LOG: database system is ready

** backtrace of the coredump:
#0 _mdfd_getrelnfd (reln=0x0) at md.c:854
854 fd = RelationGetFile(reln);
(gdb) bt
#0 _mdfd_getrelnfd (reln=0x0) at md.c:854
#1 0x8123a0f in _mdfd_getseg (reln=0x0, blkno=13) at md.c:878
#2 0x812349d in mdwrite (reln=0x0, blocknum=13, buffer=0x848dde8 "") at
md.c:461
#3 0x8123e31 in smgrwrite (which=0, reln=0x0, blocknum=13, buffer=0x848dde8
"") at smgr.c:328
#4 0x811be2a in LocalBufferAlloc (reln=0x413979d0, blockNum=0,
foundPtr=0xbfffebb7 "¿Ìëÿ¿(at)§\021\bÐy9A") at localbuf.c:100
#5 0x811a7c2 in ReadBufferInternal (reln=0x413979d0, blockNum=0,
bufferLockHeld=0 '\000') at bufmgr.c:144
#6 0x811a740 in ReadBuffer (reln=0x413979d0, blockNum=0) at bufmgr.c:112
#7 0x80d7d19 in scan_heap (vacrelstats=0x8389430, onerel=0x413979d0,
vacuum_pages=0xbfffed50, fraged_pages=0xbfffed40) at vacuum.c:1069
#8 0x80d7a79 in full_vacuum_rel (onerel=0x413979d0, vacstmt=0x8313858) at
vacuum.c:910
#9 0x80d799e in vacuum_rel (relid=374498, vacstmt=0x8313858,
expected_relkind=114 'r') at vacuum.c:827
#10 0x80d73a3 in vacuum (vacstmt=0x8313858) at vacuum.c:290
#11 0x8126ff6 in ProcessUtility (parsetree=0x8313858, dest=Remote,
completionTag=0xbfffee30 "") at utility.c:713
#12 0x8124dcc in pg_exec_query_string (query_string=0x8313688, dest=Remote,
parse_context=0x82ddb70) at postgres.c:789
#13 0x8125df7 in PostgresMain (argc=4, argv=0xbffff058, username=0x82d4a81
"postgres") at postgres.c:2016
#14 0x810eab9 in DoBackend (port=0x82d4950) at postmaster.c:2293
#15 0x810e467 in BackendStartup (port=0x82d4950) at postmaster.c:1915
#16 0x810d7d4 in ServerLoop () at postmaster.c:1018
#17 0x810d331 in PostmasterMain (argc=4, argv=0x82bce00) at postmaster.c:779
#18 0x80ee909 in main (argc=4, argv=0xbffff974) at main.c:210
#19 0x400d4577 in __libc_start_main () from /lib/libc.so.6
(gdb)

If you need more details on machine/tables/etc. just let me know.
-> the backend doesn't crash if the vacuum is done through psql AFTER the
clients work is done (and the temporary tables are automatically destroyed)

Regards,

Frank.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault in 7.3 while vacuuming
Date: 2002-12-05 14:33:28
Message-ID: 25261.1039098808@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl> writes:
> ** while using a client written in TrollTech's QT v3.1 that creates a number
> of temporary tables, uses a number lot of 'copy' statements and at the end
> tries to 'vacuum full analyse' the database

Drat --- looks like the local buffer manager code has gotten out of sync
with the relcache code. In particular I note the following in localbuf.c

Relation bufrel = RelationNodeCacheGetRelation(bufHdr->tag.rnode);

/*
* The relcache is not supposed to throw away temp rels, so this
* should always succeed.
*/
Assert(bufrel != NULL);

which was true at the time it was written, but is so no longer :-(

Will fix.

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault in 7.3 while vacuuming
Date: 2002-12-05 22:51:48
Message-ID: 5620.1039128708@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

I said:
> Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl> writes:
>> ** while using a client written in TrollTech's QT v3.1 that creates a number
>> of temporary tables, uses a number lot of 'copy' statements and at the end
>> tries to 'vacuum full analyse' the database

> Drat --- looks like the local buffer manager code has gotten out of sync
> with the relcache code.

Here is the fix if you need to patch this locally.

regards, tom lane

*** src/backend/storage/buffer/localbuf.c.orig Wed Sep 4 16:31:25 2002
--- src/backend/storage/buffer/localbuf.c Thu Dec 5 17:48:10 2002
***************
*** 90,108 ****
{
Relation bufrel = RelationNodeCacheGetRelation(bufHdr->tag.rnode);

- /*
- * The relcache is not supposed to throw away temp rels, so this
- * should always succeed.
- */
- Assert(bufrel != NULL);
-
/* flush this page */
! smgrwrite(DEFAULT_SMGR, bufrel, bufHdr->tag.blockNum,
! (char *) MAKE_PTR(bufHdr->data));
! LocalBufferFlushCount++;

! /* drop refcount incremented by RelationNodeCacheGetRelation */
! RelationDecrementReferenceCount(bufrel);
}

/*
--- 90,113 ----
{
Relation bufrel = RelationNodeCacheGetRelation(bufHdr->tag.rnode);

/* flush this page */
! if (bufrel == (Relation) NULL)
! {
! smgrblindwrt(DEFAULT_SMGR,
! bufHdr->tag.rnode,
! bufHdr->tag.blockNum,
! (char *) MAKE_PTR(bufHdr->data));
! }
! else
! {
! smgrwrite(DEFAULT_SMGR, bufrel,
! bufHdr->tag.blockNum,
! (char *) MAKE_PTR(bufHdr->data));
! /* drop refcount incremented by RelationNodeCacheGetRelation */
! RelationDecrementReferenceCount(bufrel);
! }

! LocalBufferFlushCount++;
}

/*


From: Kevin Brown <kevin(at)sysexperts(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-06 10:10:28
Message-ID: 20021206101028.GD31342@filer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Bruce Momjian wrote:
> Kevin Brown wrote:
> > I'd also like to see (if this is even possible) a transaction
> > isolation mode that would make it possible for multiple concurrent
> > updates to the same row to happen without blocking each other (I
> > imagine one way to make this possible would be for the last
> > transaction to commit to be the one that "wins". Each transaction
> > that commits gets its updates written so that other transactions that
> > begin after they commit will see them, of course). Neither "read
> > committed" nor "serialized" modes offer this. Don't know if it's
> > possible, but it would be nice (such that a transaction sees the
> > database as if it has it all to itself and doesn't block on
> > updates)...
>
> How would you do the update if you don't know of the transaction commits
> or aborts?

Maybe I should explain what I'm thinking a little further.

What I'm proposing is a transaction isolation model where each
transaction thinks that it's the only one making changes to the
database. That assumption obviously fails *outside* of a transaction,
but inside a transaction it should be possible to maintain the
illusion.

We already get this with serialized transaction isolation mode, with
one caveat: when an update conflicts with that of another transaction
that committed while the transaction of interest is in progress, the
transaction of interest gets rolled back immediately with a
serialization error.

What I'm proposing is to extend the illusion to updates. A
transaction running in this new isolation mode (call it "full
isolation" or something) never sees updates that other committed
transactions perform, whether they would conflict or not. The view
the running transaction sees of the database is a snapshot in time, as
it were, plus any updates the transaction itself has made.

Now, there are a couple of approaches we can take at transaction
commit that I can think of right now:

1. If there were any serialization errors, abort the transaction at
commit time. This allows transactions to safely make changes to their
local view of the database without compromising serialization. This
probably wouldn't yield any benefits over the serializable isolation
level except that it would make it possible to perform experiments
on a database that currently can't be performed (since serializable
isolation aborts the transaction at the first serialization
error). Applications would be easier to write since there would
be only one point during a transaction that the application would
have to check for unexpected errors: the commit.

2. We commit the changed rows. Updates only happen to rows that
exist at commit time. Rows which the transaction deleted and which
still exist at commit time are deleted. Referential integrity
rules are enforced, of course, so it's possible for the database to
retain some of its sanity even in the face of this model. But the
overall state of the database will probably be unpredictable (in
this scenario, the last concurrent transaction to commit "wins",
more or less).

3. We do something more sophisticated than 1 or 2. Perhaps something
analogous to the branch merge functions that CVS and other concurrent
version control systems can perform, where multiple branches are
finally merged into a single unified source snapshot. I have no idea
how this would work for real, or if it's even possible (I believe
CVS requires manual intervention to resolve branch conflicts during
a merge, an option that would obviously not be available to us).

How useful would it be? Beats me. Like I said, you could perform
some "what if" games with a database this way that you currently
can't, but I don't know how useful that would be. On thinking about
it a bit, it seems option 1 would be the most useful and perhaps the
most sensible.

Of course, perhaps the whole thing is just another stupid idea...


From: Kevin Brown <kevin(at)sysexperts(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-06 11:16:34
Message-ID: 20021206111634.GE31342@filer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Tom Lane wrote:
> "Magnus Naeslund(f)" <mag(at)fbab(dot)net> writes:
> > Mysql is planning on making this work:
> > SELECT id, @a:=COUNT(*), SUM(sum_col)/@a FROM table_name GROUP BY id.
>
> We're supposed to spend our time emulating nonstandard features that
> don't even exist yet? I think I have better things to do ...

MySQL doesn't have it, but I believe MS SQL does (and thus Sybase
probably does as well).

I agree with others that variables would be quite handy, especially if
they persist between statements (and they might be even handier if
they persist between transactions).

That's not to say that you don't have better things to work on,
though. :-)

--
Kevin Brown kevin(at)sysexperts(dot)com
This is your .signature virus: < begin 644 .signature (9V]T8VAA(0K0z end >
This is your .signature virus on drugs: <>
Any questions?


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Kevin Brown <kevin(at)sysexperts(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-06 15:50:25
Message-ID: 200212061550.gB6FoPO27926@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Kevin Brown wrote:
> How useful would it be? Beats me. Like I said, you could perform
> some "what if" games with a database this way that you currently
> can't, but I don't know how useful that would be. On thinking about
> it a bit, it seems option 1 would be the most useful and perhaps the
> most sensible.
>
>
> Of course, perhaps the whole thing is just another stupid idea...

We would need to have some people who want this first. We don't add
stuff of questionable value because then the feature set becomes
confusing to end users.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: "Stephen L(dot)" <jleelim(at)hotmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 Wishlist
Date: 2002-12-10 15:36:12
Message-ID: SQnJ9.4690$L97.27324635@news.primus.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Hi, if I may add to the wishlist for 7.4 in order of importance. Some items
may have been mentioned or disputed already but I think they are quite
important:

1. Avoid needing REINDEX after large insert/deletes or make REINDEX not use
exclusive lock on table.
2. Automate VACUUM in background and make database more
interactive/responsive during long VACUUMs
3. Replication
4. Point-in-time recovery
5. Maintain automatic clustering (CLUSTER) even after subsequent
insert/updates.
6. Compression between client/server interface like in MySQL

Thanks,

Stephen
jleelim(at)hotmail.com


From: Greg Copeland <greg(at)CopelandConsulting(dot)Net>
To: "Stephen L(dot)" <jleelim(at)hotmail(dot)com>
Cc: PostgresSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.4 Wishlist
Date: 2002-12-10 16:56:32
Message-ID: 1039539392.4593.7.camel@mouse.copelandconsulting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Tue, 2002-12-10 at 09:36, Stephen L. wrote:
> 6. Compression between client/server interface like in MySQL
>

Mammoth is supposed to be donating their compression efforts back to
this project, or so I've been told. I'm not exactly sure of their
time-line as I've slept since my last conversation with them. The
initial feedback that I've gotten back from them on this subject is that
the compression has been working wonderfully for them with excellent
results. IIRC, in their last official release, they announced their
compression implementation. So, I'd think that it would be available
for 7.4 of 7.5 time frame.

--
Greg Copeland <greg(at)copelandconsulting(dot)net>
Copeland Computer Consulting


From: "Al Sutton" <al(at)alsutton(dot)com>
To: "Greg Copeland" <greg(at)CopelandConsulting(dot)Net>, "Stephen L(dot)" <jleelim(at)hotmail(dot)com>
Cc: "PostgresSQL Hackers Mailing List" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [mail] Re: 7.4 Wishlist
Date: 2002-12-10 17:25:30
Message-ID: 001f01c2a071$243580f0$0100a8c0@cloud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Would it be possible to make compression an optional thing, with the default
being off?

I'm in a position that many others may be in where the link between my app
server and my database server isn't the bottleneck, and thus any time spent
by the CPU performing compression and decompression tasks is CPU time that
is in effect wasted.

If a database is handling numerous small queries/updates and the
request/response packets are compressed individually, then the overhead of
compression and decompression may result in slower performance compared to
leaving the request/response packets uncompressed.

Al.

----- Original Message -----
From: "Greg Copeland" <greg(at)CopelandConsulting(dot)Net>
To: "Stephen L." <jleelim(at)hotmail(dot)com>
Cc: "PostgresSQL Hackers Mailing List" <pgsql-hackers(at)postgresql(dot)org>
Sent: Tuesday, December 10, 2002 4:56 PM
Subject: [mail] Re: [HACKERS] 7.4 Wishlist

> On Tue, 2002-12-10 at 09:36, Stephen L. wrote:
> > 6. Compression between client/server interface like in MySQL
> >
>
> Mammoth is supposed to be donating their compression efforts back to
> this project, or so I've been told. I'm not exactly sure of their
> time-line as I've slept since my last conversation with them. The
> initial feedback that I've gotten back from them on this subject is that
> the compression has been working wonderfully for them with excellent
> results. IIRC, in their last official release, they announced their
> compression implementation. So, I'd think that it would be available
> for 7.4 of 7.5 time frame.
>
>
> --
> Greg Copeland <greg(at)copelandconsulting(dot)net>
> Copeland Computer Consulting
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


From: Greg Copeland <greg(at)CopelandConsulting(dot)Net>
To: Al Sutton <al(at)alsutton(dot)com>
Cc: "Stephen L(dot)" <jleelim(at)hotmail(dot)com>, PostgresSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Subject: Re: [mail] Re: 7.4 Wishlist
Date: 2002-12-10 19:19:42
Message-ID: 1039547981.4593.37.camel@mouse.copelandconsulting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Tue, 2002-12-10 at 11:25, Al Sutton wrote:
> Would it be possible to make compression an optional thing, with the default
> being off?
>

I'm not sure. You'd have to ask Command Prompt (Mammoth) or wait to see
what appears. What I originally had envisioned was a per database and
user permission model which would better control use. Since compression
can be rather costly for some use cases, I also envisioned it being
negotiated where only the user/database combo with permission would be
able to turn it on. I do recall that compression negotiation is part of
the Mammoth implementation but I don't know if it's a simple capability
negotiation or part of a larger scheme.

The reason I originally imagined a user/database type approach is
because I would think only a subset of a typical installation would be
needing compression. As such, this would help prevent users from
arbitrarily chewing up database CPU compressing data because:
o datasets are uncompressable or poorly compresses
o environment cpu is at a premium
o is in a bandwidth rich environment

> I'm in a position that many others may be in where the link between my app
> server and my database server isn't the bottleneck, and thus any time spent
> by the CPU performing compression and decompression tasks is CPU time that
> is in effect wasted.

Agreed. This is why I'd *guess* that Mammoth's implementation does not
force compression.

>
> If a database is handling numerous small queries/updates and the
> request/response packets are compressed individually, then the overhead of
> compression and decompression may result in slower performance compared to
> leaving the request/response packets uncompressed.

Again, this is where I'm gray on their exact implementation. It's
possible they implemented a compressed stream even though I'm hoping
they implemented a per packet compression scheme (because adaptive
compression becomes much more capable and powerful; in both
algorithmically and logistical use). An example of this would be to
avoid any compression on trivially sized result sets. Again, this is
another area where I can imagine some tunable parameters.

Just to be on the safe side, I'm cc'ing Josh Drake at Command Prompt
(Mammoth) to see what they can offer up on it. Hope you guys don't
mind.

Greg

> ----- Original Message -----
> From: "Greg Copeland" <greg(at)CopelandConsulting(dot)Net>
> To: "Stephen L." <jleelim(at)hotmail(dot)com>
> Cc: "PostgresSQL Hackers Mailing List" <pgsql-hackers(at)postgresql(dot)org>
> Sent: Tuesday, December 10, 2002 4:56 PM
> Subject: [mail] Re: [HACKERS] 7.4 Wishlist
>
>
> > On Tue, 2002-12-10 at 09:36, Stephen L. wrote:
> > > 6. Compression between client/server interface like in MySQL
> > >
> >
> > Mammoth is supposed to be donating their compression efforts back to
> > this project, or so I've been told. I'm not exactly sure of their
> > time-line as I've slept since my last conversation with them. The
> > initial feedback that I've gotten back from them on this subject is that
> > the compression has been working wonderfully for them with excellent
> > results. IIRC, in their last official release, they announced their
> > compression implementation. So, I'd think that it would be available
> > for 7.4 of 7.5 time frame.
> >
> >
> > --
> > Greg Copeland <greg(at)copelandconsulting(dot)net>
> > Copeland Computer Consulting
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster
> >
--
Greg Copeland <greg(at)copelandconsulting(dot)net>
Copeland Computer Consulting


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Greg Copeland <greg(at)CopelandConsulting(dot)Net>
Cc: Al Sutton <al(at)alsutton(dot)com>, "Stephen L(dot)" <jleelim(at)hotmail(dot)com>, PostgresSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Subject: Re: [mail] Re: 7.4 Wishlist
Date: 2002-12-10 19:38:41
Message-ID: 200212101938.gBAJcff22106@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Greg Copeland wrote:
> On Tue, 2002-12-10 at 11:25, Al Sutton wrote:
> > Would it be possible to make compression an optional thing, with the default
> > being off?
> >
>
> I'm not sure. You'd have to ask Command Prompt (Mammoth) or wait to see
> what appears. What I originally had envisioned was a per database and
> user permission model which would better control use. Since compression
> can be rather costly for some use cases, I also envisioned it being
> negotiated where only the user/database combo with permission would be
> able to turn it on. I do recall that compression negotiation is part of
> the Mammoth implementation but I don't know if it's a simple capability
> negotiation or part of a larger scheme.

I haven't heard anything about them contributing it. Doesn't mean it
will not happen, just that I haven't heard it.

I am not excited about per-db/user compression because of the added
complexity of setting it up, and even set up, I can see cases where some
queries would want it, and others not. I can see using GUC to control
this. If you enable it and the client doesn't support it, it is a
no-op. We have per-db and per-user settings, so GUC would allow such
control if you wish.

Ideally, it would be a tri-valued parameter, that is ON, OFF, or AUTO,
meaning it would determine if there was value in the compression and do
it only when it would help.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Greg Copeland <greg(at)CopelandConsulting(dot)Net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Al Sutton <al(at)alsutton(dot)com>, "Stephen L(dot)" <jleelim(at)hotmail(dot)com>, PostgresSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Subject: Re: [mail] Re: 7.4 Wishlist
Date: 2002-12-10 20:06:23
Message-ID: 1039550782.4594.56.camel@mouse.copelandconsulting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Tue, 2002-12-10 at 13:38, Bruce Momjian wrote:

> I haven't heard anything about them contributing it. Doesn't mean it
> will not happen, just that I haven't heard it.
>

This was in non-mailing list emails that I was told this by Joshua Drake
at Command Prompt. Of course, that doesn't have to mean it will be
donated for sure but nonetheless, I was told it will be.

Here's a quote from one of the emails. I don't think I'll be too far
out of line posting this. On August 9, 2002, Joshua Drake said, "One we
plan on releasing this code to the developers after 7.3 comes out. We
want to be good members of the community but we have to keep a slight
commercial edge (wait to you see what we are going to do to vacuum)."

Obviously, I don't think that was official speak, so I'm not holding
them to the fire, nonetheless, that's what was said. Additional follow
ups did seem to imply that they were very serious about this and REALLY
want to play nice as good shared source citizens.

> I am not excited about per-db/user compression because of the added
> complexity of setting it up, and even set up, I can see cases where some
> queries would want it, and others not. I can see using GUC to control
> this. If you enable it and the client doesn't support it, it is a
> no-op. We have per-db and per-user settings, so GUC would allow such
> control if you wish.
>

I never thought beyond the need for what form an actual implementation
of this aspect would look like. The reason for such a concept would be
to simply limit the number of users that can be granted compression. If
you have a large user base all using compression or even a small user
base where very large result sets are common, I can imagine your
database server becoming CPU bound. The database/user thinking was an
effort to allow the DBA to better manage the CPU effect.

> Ideally, it would be a tri-valued parameter, that is ON, OFF, or AUTO,
> meaning it would determine if there was value in the compression and do
> it only when it would help.

Yes, that makes sense and was something I had originally envisioned.
Simply stated, some installations may never want compression while
others may want it for every connection. Beyond that, I believe there
needs to be something of a happy medium where a DBA can better control
who and what is taking his CPU away (e.g. only that one remote location
being fed via ISDN). If GUC can fully satisfy, I certainly won't argue
against it.

--
Greg Copeland <greg(at)copelandconsulting(dot)net>
Copeland Computer Consulting


From: Kyle <kaf(at)nwlink(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Greg Copeland <greg(at)CopelandConsulting(dot)Net>, Al Sutton <al(at)alsutton(dot)com>, "Stephen L(dot)" <jleelim(at)hotmail(dot)com>, PostgresSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Subject: Re: [mail] Re: 7.4 Wishlist
Date: 2002-12-11 00:45:51
Message-ID: 15862.35519.40159.333800@doppelbock.patentinvestor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Without getting into too many details, why not send toast data to
non-local clients? Seems that would be the big win. The data is
already compressed, so the server wouldn't pay cpu time to recompress
anything. And since toast data is relatively large anyway, it's the
stuff you'd want to compress before putting it on the wire anyway.

If this is remotely possible let me know, I might be interested in
taking a look at it.

-Kyle

Bruce Momjian wrote:
>
> I am not excited about per-db/user compression because of the added
> complexity of setting it up, and even set up, I can see cases where some
> queries would want it, and others not. I can see using GUC to control
> this. If you enable it and the client doesn't support it, it is a
> no-op. We have per-db and per-user settings, so GUC would allow such
> control if you wish.
>
> Ideally, it would be a tri-valued parameter, that is ON, OFF, or AUTO,
> meaning it would determine if there was value in the compression and do
> it only when it would help.


From: Greg Copeland <greg(at)CopelandConsulting(dot)Net>
To: Kyle <kaf(at)nwlink(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Al Sutton <al(at)alsutton(dot)com>, "Stephen L(dot)" <jleelim(at)hotmail(dot)com>, PostgresSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Subject: Re: [mail] Re: 7.4 Wishlist
Date: 2002-12-11 01:15:54
Message-ID: 1039569354.4594.96.camel@mouse.copelandconsulting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

This has been brought up a couple of times now. Feel free to search the
old archives for more information. IIRC, it would of made the
implementation more problematic, or so I think it was said.

When I originally brought the topic (compression) up, it was not well
received. As such, it may of been thought that additional effort on
such an implementation would not be worth the return on a feature which
most seemingly didn't see any purpose in supporting in the first place.
You need to keep in mind that many simply advocated using a compressing
ssh tunnel.

Seems views may of changed some since then so it may be worth
revisiting. Admittedly, I have no idea what would be required to move
the toast data all the way through like that. Any idea? Implementing a
compression stream (which seems like what was done for Mammoth) or even
packet level compression were both something that I could comfortably
put my arms around in a timely manner. Moving toast data around wasn't.

Greg

On Tue, 2002-12-10 at 18:45, Kyle wrote:
> Without getting into too many details, why not send toast data to
> non-local clients? Seems that would be the big win. The data is
> already compressed, so the server wouldn't pay cpu time to recompress
> anything. And since toast data is relatively large anyway, it's the
> stuff you'd want to compress before putting it on the wire anyway.
>
> If this is remotely possible let me know, I might be interested in
> taking a look at it.
>
> -Kyle
>
> Bruce Momjian wrote:
> >
> > I am not excited about per-db/user compression because of the added
> > complexity of setting it up, and even set up, I can see cases where some
> > queries would want it, and others not. I can see using GUC to control
> > this. If you enable it and the client doesn't support it, it is a
> > no-op. We have per-db and per-user settings, so GUC would allow such
> > control if you wish.
> >
> > Ideally, it would be a tri-valued parameter, that is ON, OFF, or AUTO,
> > meaning it would determine if there was value in the compression and do
> > it only when it would help.

--
Greg Copeland <greg(at)copelandconsulting(dot)net>
Copeland Computer Consulting


From: "Al Sutton" <al(at)alsutton(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Greg Copeland" <greg(at)CopelandConsulting(dot)Net>, "Stephen L(dot)" <jleelim(at)hotmail(dot)com>, "PostgresSQL Hackers Mailing List" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [mail] Re: 7.4 Wishlist
Date: 2002-12-11 07:16:10
Message-ID: 00aa01c2a0e5$786e1370$0100a8c0@cloud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-general pgsql-hackers

I'd like to show/register interest.

I can see it being very useful when combined with replication for situations
where the replicatiant databases are geographically seperated (i.e. Disaster
Recover sites or systems maintaining replicants in order to reduce the
distance from user to app to database). The bandwidth cost savings from
compressing the replication information would be immensly useful.

Al.

----- Original Message -----
From: "Joshua D. Drake" <jd(at)commandprompt(dot)com>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Greg Copeland" <greg(at)CopelandConsulting(dot)Net>; "Al Sutton"
<al(at)alsutton(dot)com>; "Stephen L." <jleelim(at)hotmail(dot)com>; "PostgresSQL Hackers
Mailing List" <pgsql-hackers(at)postgresql(dot)org>
Sent: Tuesday, December 10, 2002 8:04 PM
Subject: Re: [mail] Re: [HACKERS] 7.4 Wishlist

> Hello,
>
> We would probably be open to contributing it if there was interest.
> There wasn't interest initially.
>
> Sincerely,
>
> Joshua Drake
>
>
> Bruce Momjian wrote:
> > Greg Copeland wrote:
> >
> >>On Tue, 2002-12-10 at 11:25, Al Sutton wrote:
> >>
> >>>Would it be possible to make compression an optional thing, with the
default
> >>>being off?
> >>>
> >>
> >>I'm not sure. You'd have to ask Command Prompt (Mammoth) or wait to see
> >>what appears. What I originally had envisioned was a per database and
> >>user permission model which would better control use. Since compression
> >>can be rather costly for some use cases, I also envisioned it being
> >>negotiated where only the user/database combo with permission would be
> >>able to turn it on. I do recall that compression negotiation is part of
> >>the Mammoth implementation but I don't know if it's a simple capability
> >>negotiation or part of a larger scheme.
> >
> >
> > I haven't heard anything about them contributing it. Doesn't mean it
> > will not happen, just that I haven't heard it.
> >
> > I am not excited about per-db/user compression because of the added
> > complexity of setting it up, and even set up, I can see cases where some
> > queries would want it, and others not. I can see using GUC to control
> > this. If you enable it and the client doesn't support it, it is a
> > no-op. We have per-db and per-user settings, so GUC would allow such
> > control if you wish.
> >
> > Ideally, it would be a tri-valued parameter, that is ON, OFF, or AUTO,
> > meaning it would determine if there was value in the compression and do
> > it only when it would help.
> >
>
> --
> <COMPANY>CommandPrompt - http://www.commandprompt.com </COMPANY>
> <CONTACT> <PHONE>+1.503.222-2783</PHONE> </CONTACT>
>
>