[HACKERS] SSL certificate info on SQL level and HSM support for libpq

2006-05-18 Thread Victor B. Wagner
Hi,

I've project where I need to log information about database user, based
on hardware security tokens. These tokens are supported by OpenSSL.

So, I need two modification in the PostgreSQL core

1. Access to SSL certificate information on SQL level.
  It seems that this can be done using INTERNAL functions only, because
  I cannot see how loadable module would get access to MyProcPort global
  variable.

2. Ability to use openssl OpenSSL hardware support modules (engines) in
  libpq.

I suppose that I'm not only person in the world who need this
functionality, so I'm asking here in hope that I would be able to made
patch, acceptable into PostgreSQL 8.2.

First problem
-

I've already tried to write internal function which just returns peer_dn 
field from the Port structure.
Unfortunately, it doesn't solve my problem because PostgreSQL uses
function X509_NAME_oneline to fill this field.

This function is marked deprecated in OpenSSL 0.9.8b docs for good
reason - it doesn't support non-ASCII characters in certificate subject
fields - it escapes them to something unreadable. And in my case
(potential customer base is in Russia) everything in certificate subject
except country code would be non-ASCII.

Moreover, certificate subject is not guaranteed to be unique. Only
combination of certificate issuer and serial number is guaranteed.

So, I need more complicated API which access peer field of Port
structure directly.

I propose following API:


function ssl_on() returns bool; - true if current session is established
 via SSL connection
function ssl_client_authenticated() returns bool; - true if client
certificate was provided
These functions should be defined even if PostgreSQL is compiled without
SSL support and always return false in this case.

function ssl_cert_subject(VARCHAR fieldname) returns VARCHAR;
- returns field of certificate subject, converted into database
  encoding. I think it is safe to assume that database can
  represent characters used in it's user's names.
  
  fieldname would be something like 'commonName' or
  'emailAddress' and looked up using OpenSSL object names API.
function ssl_cert_issuer(VARCHAR fieldname) returns VARCHAR;
 - does the same for certificate issuer.

function ssl_cert_serial() returns NUMERIC;
 - returns certificate serial number. NUMERIC type is used here
   instead of int4 or int8 because certificate serial numbers
   can be really BIG.

These functions return NULL if ssl_client_authenticated() returns false.

Function to return certificate extensions such as subjectAltName or
extendedKeyUsage may also be useful, but I don't need it right now, so I
don't promise to write it. It has additional complication that these
extensions are typically multivalued, so function have to return array
of values.

My questions here:
-

1. Am I correct that these function have to be INTERNAL? Or it is
possible to get access to MyProcPort variable (on Windows platform too)
from dynamically loadable object?

2. I can make OpenSSL to return UTF-8 string for certificate name
fields. How to convert them into current database encoding. Where to
look up information of PostgreSQL backend encoding conversion functions
and how to determine database encoding from C function short of
connecting to SPI manager and issue SQL query?

3. Almost same question about arbitrary precession integer values.
Where to look up C functions to convert decimal/hexadecimal/binary
string representing integer of 128 bits or so into Postgres NUMERIC
type.

4. Is it good idea to use (ANSI standard) VARCHAR arguments or return
values? I see that PostgreSQL specific TEXT type is used more often by
internal PostgreSQL functions.

5. Is there some coding-style guidelines? I'm planning to submit this
patch to pgsql-patches next week, and I want to make it as easily
acceptable as possible.


Second problem
--

First of all, application which uses loadable OpenSSL engines have to
read openssl configuration file (or have its own configuration file) to
configure engine properly. This is one-line patch - just add call to 
OPENSSL_config(NULL) before SSL_library_init() and config (either
compiled-in default or specified by OPENSSL_CONF configuration variable) 
would be read and engine loaded and initialized.

Second, there should be some way to specify that private key shouldn't
be loaded from the engine (it might not be actually loaded - most
hardware security modules wouldn't give away private keys, but OpenSSL
would know how to deal with it), not from the file.

I'm planning to use yet another environment variable 

PGSSLKEY=engine_name:key_id

along same lines as PGCLIENTENCODING and OPENSSL_CONF variables are used.
engi

Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Thomas Hallgren

Christopher Kings-Lynne wrote:
If you want to get users to swtich to your software from your 
competitors, you have to eliminate barriers, and a big one for any 
database is getting locked into a specific one.  People aren't going 
to take the time to try switching to postgresql if they can't easily 
make it back to thier former database. It's one of the reasons why 
PostgreSQL's standards compliance is so important; if you want to 
swtich to a new database, your best bet is to give PostgreSQL a shot, 
because even if you don't like it, we're not going to try and trap you 
into our software with bunches of non-standard knobs. Low barrier to 
exit == low barrier to entry. 


Another reason why a tool to export from pgsql to mysql is just as 
important as the vice versa...


If that's really true, then let's create a bidirectional compatibility layer as a joint 
venture with people from the MySQL camp. Should be a win-win situation. I somehow doubt that 
is the case. Important yes. But "just as important"? No way.


We would loose big time on the export side since the vendor lock-in aspect is seriously out 
balanced by current levels of standards compliance. On the other hand, we'd win by order of 
magnitude on the import side. I bet the MySQL people would be utterly uninterested in such a 
venture. I think that if anything should be done, we should concentrate on import and let 
the MySQL people worry about going the other way. Once it becomes "just as imporant", they will.


Regards,
Thomas Hallgren



---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] Toward A Positive Marketing Approach.

2006-05-18 Thread Greg Stark
Michael Dean <[EMAIL PROTECTED]> writes:

> Greetings Guys
> 
> As a newbie person moving away from my technical background to marketing, I
> think a refreshed course for pg is needed!  So far I have read all 5000 or so
> of this month's emails and want to make a few remarks IMHO:
> 
> 1.  We should treat all marketing efforts by hackers/programmers as social
> bugs.  Get some marketing pros (debuggers) in on this, or the popularity of
> postgresql will continue to pale in the real world.

And this is a problem why? You seem to have mistaken this as some sort of
commercial project that needs to return a profit or some sort of evangelical
movement. It is neither. The contributors get the benefit of a good database
which for whatever varied reasons satisfies their needs.

> 8. Stop mentioning mysql in every breath.  It serves them, not pg.  After all,
> mysql must be better, or why would these folks at pg be so specifically,
> vociferously and universally concerned! talk only about pg, make comparisons 
> to
> the whole field of db's, don't single anyone out!

I do agree with this point (though not the rationale). 

Bashing mysql (or Oracle) doesn't really accomplish much to improve Postgres
or help Postgres users. There is some room for "let's avoid the mistakes
others have made" or "learn from what others have done well", but there's an
awful lot of contentless "mysql sucks" threads too. Personally I have "mysql"
killfiled in these lists.

-- 
greg


---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Thomas Hallgren

Chris Browne wrote:

[EMAIL PROTECTED] ("Marc G. Fournier") writes:

To give someone a running chance at migrating it to PostgreSQL, a
'MySQL compatibility module' would allow them to just plug the
existing DB in, and then work at improving sections of the code over
time ...

Hell, if done well, the module should be able to dump appropriately
'clean' PgSQL schemas ... as in your example elow about the domains ...


You can't have that because you essentially need to throw out four
aspects of fairly vital "data validation" functionality:

1.  Dates cease to be validatable.

2.  NULL and 0 and '' are all roughly equivalent, even though they
aren't.

3.  Foreign key constraints have to be ignored.

4.  You have to fabricate a locale offering a case-insensitive sort
order.

I suppose #4 isn't "vital data validation"...

But after you "gut" the PostgreSQL-based system of those four aspects
of data integrity, I'm not sure there's any remaining benefit to
having PostgreSQL in play...


Assuming the objective with a transition would be to improve on things, an alternative 
approach could be to offer a three step migration path:


1. A dump/restore utility that dumps a MySQL database and restores it into a PostgreSQL 
database. This utility must have plugin capabilities where logic can be added that deals 
with cases #1, #2, and #3 above. It might be as simple as just logging incorrect records to 
a file and skip them. A pre-defined set of generic plugins could be supplied that did just 
that. A user would have the chance to replace them with customized plugins to cover for 
special cases in his own app. Perl or PHP would probably be good candidates for plugin language.


2. Provide an add-on to the PostgreSQL parser that would make it accept MySQL syntax. The 
database would still run untainted underneath so from this point on, no more invalid dates 
or foreign keys can be entered. Some other add-ons are needed as well to cater for some sane 
but non-standard MySQL behavior that PostgreSQL is lacking.


3. A good user guide that helps the user to, over time, move away from the non standard 
MySQL specific expressions. The objective being to at some point skip the MySQL syntax layer 
altogether.


Regards,
Thomas Hallgren

(dead serious this time)


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Jim C. Nasby
On Thu, May 18, 2006 at 04:55:17PM -0400, Tom Lane wrote:
> "Jim C. Nasby" <[EMAIL PROTECTED]> writes:
> > Actually, I guess the amount of memory used for zlib's lookback buffer
> > (or whatever they call it) could be pretty substantial, and I'm not sure
> > if there would be a way to combine that across all tapes.
> 
> But there's only one active write tape at a time.  My recollection of
> zlib is that compression is memory-hungry but decompression not so much,
> so it seems like this shouldn't be a huge deal.

It seems more appropriate to discuss results here, rather than on
-patches...

http://jim.nasby.net/misc/compress_sort.txt is preliminary results.
I've run into a slight problem in that even at a compression level of
-3, zlib is cutting the on-disk size of sorts by 25x. So my pgbench sort
test with scale=150 that was producing a 2G on-disk sort is now
producing a 80M sort, which obviously fits in memory. And cuts sort
times by more than half.

So, if nothing else, it looks like compression is definately a win if it
means you can now fit the sort within the disk cache. While that doesn't
sound like something very worthwhile, it essentially extends work_mem
from a fraction of memory to up to ~25x memory.

I'm currently loading up a pgbench database with a scaling factor of
15000; hopefully I'll have results from that testing in the morning.
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


[HACKERS] TupleDesc refcounting, again

2006-05-18 Thread Tom Lane
Those of you with long memories may recall a discussion back in January
about reference-counting TupleDescs retrieved by lookup_rowtype_tupdesc().
I didn't like the patch Neil Conway developed for this, so I'm on the
hook to find a better answer before 8.2 comes out.  I haven't forgotten
... but I was reminded of it while looking at the performance issue
pointed out by Marc Orgassa here:
http://archives.postgresql.org/pgsql-novice/2006-05/msg00153.php

If oprofile is to be trusted, Marc's second example spends something
close to forty percent of its runtime in CreateTupleDescCopy()
operations (including the subsidiary memcpy() calls).  Yikes.
A reference-counting mechanism would have to be cheaper than that.

So I'll try to bubble this issue up to the top of the to-do queue
again...

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] text_position worst case runtime

2006-05-18 Thread Mark Dilger
Tom Lane wrote:
> Mark Dilger <[EMAIL PROTECTED]> writes:
> 
>>The function
>>  static int32 text_position(text *t1, text *t2, int matchnum)
>>defined in src/backend/utils/adt/varlena.c uses repeated calls to
>>strncmp (or pg_wchar_strncmp) to find the location of the pattern in
>>the text.  The worst case runtime for such an approach is O(n*m) where
>>n and m are the lengths of the pattern and text.  The best case would
>>be O(n), I guess, because it only takes n comparisons to find the
>>pattern at the very start of the text.  I'm not sure how to determine
>>the average case runtime, because it depends what your data looks like
>>on average.
> 
> 
> I would think that the worst-case times would be fairly improbable.
> I'm disinclined to push something as complicated as Boyer-Moore matching
> into this function without considerable evidence that it's a performance
> bottleneck for real applications.

A common approach in biological data applications is to store nucleic and amino
acid sequences as text in a relational database.  The smaller alphabet sizes and
the tendency for redundancy in these sequences increases the likelihood of a
performance problem.  I have solved this problem by writing my own data types
with their own functions for sequence comparison and alignment, and I used
boyer-moore for some of that work.  Whether the same technique should be used
for the text and varchar types was unclear to me, hence the question.

> The question that comes to mind for me is why we're not using simple
> strncmp in all cases in that code.  The conversion to pg_wchar format
> looks expensive and unnecessary ...

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Mark Kirkwood

Christopher Kings-Lynne wrote:

And MySQL is much closer to being a competitor now than they were in
4.1. And feature-wise they'll probably equal PostgreSQL in the next
release. Will the features be anywhere near as robust or well thought
out? No. But in a heck of a lot of companies that doesn't matter.


Don't forget that they got nested transactions and PITR both before us. 
 They will also shortly have really nice partitioning before us...


...don't underestimate their development speed.



Second that. In addition they have (early) in-memory multi-node 
clustering and Jim Starkey is writing them a new transactional storage 
engine to replace the probably-soon-to-be-license-hampered Innodb...


Cheers

Mark

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Christopher Kings-Lynne
If you want to get users to swtich to your software from your competitors, you 
have to eliminate barriers, and a big one for any database is getting locked 
into a specific one.  People aren't going to take the time to try switching 
to postgresql if they can't easily make it back to thier former database. 
It's one of the reasons why PostgreSQL's standards compliance is so 
important; if you want to swtich to a new database, your best bet is to give 
PostgreSQL a shot, because even if you don't like it, we're not going to try 
and trap you into our software with bunches of non-standard knobs. Low 
barrier to exit == low barrier to entry. 


Another reason why a tool to export from pgsql to mysql is just as 
important as the vice versa...


Chris



---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Christopher Kings-Lynne
We also need better support for non C locales in tsearch.  As I was porting 
mysql's sakila sample database I was reminded just how painful it is when you 
initdb in a non-supported locale (which is probably the default on the 
majority of distros out there)



In 8.2 tsearch2 supports utf8...


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Christopher Kings-Lynne

And MySQL is much closer to being a competitor now than they were in
4.1. And feature-wise they'll probably equal PostgreSQL in the next
release. Will the features be anywhere near as robust or well thought
out? No. But in a heck of a lot of companies that doesn't matter.


Don't forget that they got nested transactions and PITR both before us. 
 They will also shortly have really nice partitioning before us...


...don't underestimate their development speed.


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [HACKERS] text_position worst case runtime

2006-05-18 Thread Tom Lane
Mark Dilger <[EMAIL PROTECTED]> writes:
> The function
>   static int32 text_position(text *t1, text *t2, int matchnum)
> defined in src/backend/utils/adt/varlena.c uses repeated calls to
> strncmp (or pg_wchar_strncmp) to find the location of the pattern in
> the text.  The worst case runtime for such an approach is O(n*m) where
> n and m are the lengths of the pattern and text.  The best case would
> be O(n), I guess, because it only takes n comparisons to find the
> pattern at the very start of the text.  I'm not sure how to determine
> the average case runtime, because it depends what your data looks like
> on average.

I would think that the worst-case times would be fairly improbable.
I'm disinclined to push something as complicated as Boyer-Moore matching
into this function without considerable evidence that it's a performance
bottleneck for real applications.

The question that comes to mind for me is why we're not using simple
strncmp in all cases in that code.  The conversion to pg_wchar format
looks expensive and unnecessary ...

regards, tom lane

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] PL/pgSQL 'i = i + 1' Syntax

2006-05-18 Thread Mark Dilger
Douglas McNaught wrote:
> Mark Dilger <[EMAIL PROTECTED]> writes:
> 
> 
>>Tom Lane wrote:
>>
>>>No it isn't.  The plpgsql scanner treats := and = as *the same token*.
>>>They can be interchanged freely.  This has nothing to do with the case
>>>of modifying a loop variable in particular.
>>
>>I disagree.  If the scanner treated them the same, then
>>
>>  if i := 1 then ...
>>
>>would work, but it doesn't.  The := is rejected in a conditional.  Try the
>>following code if you don't believe me:
> 
> 
> That's because (AIUI) all expressions to be evaluated are handed off
> to the SQL parser (why re-implement all that logic and have subtle and
> annoying differences?)  plpgsql only handles the statements, loops, etc.
> So it doesn't care about the difference but SQL does...

Ok, ten out of ten for technical accuracy; the error occurs at a lower level.
But that really doesn't matter, does it?  If the syntax results in an error,
then the argument that '=' and ':=' are interchangeable is wrong.

As a coder, if you notice that using ':=' within a conditional fails, wouldn't
you think that implied that ':=' is for assignment and '=' is for comparison?

mark

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] PL/pgSQL 'i = i + 1' Syntax

2006-05-18 Thread Douglas McNaught
Mark Dilger <[EMAIL PROTECTED]> writes:

> Tom Lane wrote:
>> No it isn't.  The plpgsql scanner treats := and = as *the same token*.
>> They can be interchanged freely.  This has nothing to do with the case
>> of modifying a loop variable in particular.
>
> I disagree.  If the scanner treated them the same, then
>
>   if i := 1 then ...
>
> would work, but it doesn't.  The := is rejected in a conditional.  Try the
> following code if you don't believe me:

That's because (AIUI) all expressions to be evaluated are handed off
to the SQL parser (why re-implement all that logic and have subtle and
annoying differences?)  plpgsql only handles the statements, loops, etc.
So it doesn't care about the difference but SQL does...

Not that I claim that makes sense.  :)

-Doug

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


[HACKERS] New feature proposal

2006-05-18 Thread Marc Munro
Veil http://pgfoundry.org/projects/veil is currently not a very good
Postgres citizen.  It steals what little shared memory it needs from
postgres' shared memory using ShmemAlloc().

For Postgres 8.2 I would like Veil to be a better citizen and use only
what shared memory has been reserved for postgres add-ins.

So, I would like to propose:
1) that a new shared memory area for add-ins be created
2) that it should be accessible only to add-ins specifically requesting
its use
3) that the size of this add-in memory be controlled through a new GUC
setting

If this proposal is acceptable, I'd like some suggestions for naming the
GUC.  If not we will be stuck with add_in_shmem, specified in Kbytes.

My expectation is that this would be a very small change and one that I
am probably competent to make myself, with a little review from my
friends.

__
Marc




signature.asc
Description: This is a digitally signed message part


Re: [HACKERS] PL/pgSQL 'i = i + 1' Syntax

2006-05-18 Thread Andreas Seltenreich
Mark Dilger schrob:

> Tom Lane wrote:
>> No it isn't.  The plpgsql scanner treats := and = as *the same token*.
>> They can be interchanged freely.  This has nothing to do with the case
>> of modifying a loop variable in particular.
>
> I disagree.  If the scanner treated them the same, then
>
>   if i := 1 then ...
>
> would work, but it doesn't.  The := is rejected in a conditional.  Try the
> following code if you don't believe me:

You're confusing the PL/pgSQL scanner with the SQL
scanner. Expressions in PL/pgSQL are handed down to the SQL parser.

regards,
andreas

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Robert Treat
On Thursday 18 May 2006 12:38, Josh Berkus wrote:
> Personally, I'd go after MSSQL before I bothered with MySQL.   Sure, let's
> make *migration* easier for those who wake up and smell the BS, but
> migration can (and probably should) be one-way.
>

If you want to get users to swtich to your software from your competitors, you 
have to eliminate barriers, and a big one for any database is getting locked 
into a specific one.  People aren't going to take the time to try switching 
to postgresql if they can't easily make it back to thier former database. 
It's one of the reasons why PostgreSQL's standards compliance is so 
important; if you want to swtich to a new database, your best bet is to give 
PostgreSQL a shot, because even if you don't like it, we're not going to try 
and trap you into our software with bunches of non-standard knobs. Low 
barrier to exit == low barrier to entry. 

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

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] PL/pgSQL 'i = i + 1' Syntax

2006-05-18 Thread Mark Dilger
Tom Lane wrote:
> Josh Berkus  writes:
> 
>>>True, but there were clear benefits from doing so.  Disallowing "="
>>>assignment in plpgsql wouldn't buy anything, just break programs.
> 
> 
>>But it's already disallowed in most places.
> 
> 
> No it isn't.  The plpgsql scanner treats := and = as *the same token*.
> They can be interchanged freely.  This has nothing to do with the case
> of modifying a loop variable in particular.

I disagree.  If the scanner treated them the same, then

  if i := 1 then ...

would work, but it doesn't.  The := is rejected in a conditional.  Try the
following code if you don't believe me:

CREATE OR REPLACE FUNCTION foo () RETURNS INTEGER AS $$
DECLARE
i integer;
BEGIN
i := 1;
if i := 1 then
return 1;
end if;
return 0;
END;
$$ LANGUAGE plpgsql;

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


[HACKERS] text_position worst case runtime

2006-05-18 Thread Mark Dilger
The function

  static int32 text_position(text *t1, text *t2, int matchnum)

defined in src/backend/utils/adt/varlena.c uses repeated calls to strncmp (or
pg_wchar_strncmp) to find the location of the pattern in the text.  The worst
case runtime for such an approach is O(n*m) where n and m are the lengths of the
pattern and text.  The best case would be O(n), I guess, because it only takes n
comparisons to find the pattern at the very start of the text.  I'm not sure how
to determine the average case runtime, because it depends what your data looks
like on average.

The fastest worst-case algorithmic solutions (boyer-moore and similar) have an
O(n+m) worst-case runtime.

In practice, the current iterative strncmp solution may be faster than the
boyer-moore solution for average data, because the data may not be constructed
in such a way as to trigger worst-case or nearly worst-case run times.  The
current solution also has the advantage of not requiring a palloc of O(n) space
for the pattern preprocessing that boyer-moore requires.

My question is, would the core development team entertain the idea of changing
this function if I supplied the new code?

Thanks,

mark

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Robert Treat
On Thursday 18 May 2006 16:17, Philippe Schmid wrote:
> As a users of both Postgres and MySQL, I would also say, better add
> missing features to Postgres than chasing some specialties that are
> going to vanish anyway in MySQL.
> I miss :
> - a core full-text indexing engine. Tsearch2 is nice, but not
> included. This is a feature often used by PHP/MySQL packages.

We also need better support for non C locales in tsearch.  As I was porting 
mysql's sakila sample database I was reminded just how painful it is when you 
initdb in a non-supported locale (which is probably the default on the 
majority of distros out there)

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

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Dawid Kuroczko

On 5/18/06, Jim C. Nasby <[EMAIL PROTECTED]> wrote:

On Wed, May 17, 2006 at 09:35:34PM -0400, John DeSoi wrote:
>
> On May 17, 2006, at 8:08 PM, Mark Woodward wrote:
>
> >What is the best way to go about creating a "plug and play,"
> >PostgreSQL
> >replacement for MySQL? I think the biggest problem getting PostgreSQL
> >accepted is that so much code is available for MySQL.
>
>
> http://pgfoundry.org/projects/mysqlcompat/

Even better would be coming up with a compatability mode, a la what
EnterpriseDB has done for Oracle.


I don't think we actually want such a mode.  In theory it would be
great, but in practise... Especially from performance standpoint.

I mean, application for MySQL would usually be written as: quick
connect, do a query, disconnect.  No application-level caching, no
connection keep-alive.  First run on a similar hardware would be
a performance disaster. PostgreSQL connection initialisation
will be slower (yes, pgpool, but how much do you want to bet,
the reaction would be: "you said compatibility mode! no mention
of pgpool!"), and no caching would be noticable, to say the least.

I don't want to suggest adding caching to postgresql (I know it
isn't that great).  I want to suggest that MySQL users are used
to it and will be unhappy to part from it.

So, if you want to help people migrate to Postgres, better tell
them how to fix mysqlisms. I mean: "no replace into"? tell them
about create trigger on insert to handle duplicates.  No caching,
tell them about memcached and its advantages.  Tell how to
use pgpool.

Personally, I wish I had better knowledge of PostgreSQL years
back, when one project was started... I didn't know PostgreSQL
then, and well, MySQL outperformed it.  Of course when real
load was given, MyISAM were a performance disaster, but then
there was InnoDB...  And sometimes some developer will select
count(*) on InnoDB, and InnoDB will make a temporary table with
all the data, holding the lock on the table...  And sometimes the
replication will just break, and sometimes you need repair table.
All the usual fun. ;)

While I can talk to the DBAs and tell them about table partitioning,
PITR, MVCC, online backups, etc, etc. then add spice with PL/pgSQL
and other PL/*s the real problem is people are used to MySQL --
-- they know how to handle it, how to support it, what to expect
from it. The bigger the company, the harder it is to convince people
that they should start using something completely new. An important
application with 1 or 2 people who know what to do, when after a major
failure, restart doesn't help. This makes it very hard...

Personally my opinion is that there is no point in pushing PostgreSQL
everywhere -- if there is no siginifcant performance gain, most managers
will refuse it, on the grounds that "if it ain't (too) broke, don't fix it".
The real places to "attack at" are the BIG dbs, the dataware housing
applications.  Places where MySQL is not used, because someones
select count(*) should not kill the database.  Because the queries
take few hours to complete "by design". This should be doable. :)

  Regards,
 Dawid

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [HACKERS] [COMMITTERS] pgsql: Add simplified sparc8 ASM for solaris_sparc.s,

2006-05-18 Thread Bruce Momjian
Tom Lane wrote:
> Bruce Momjian  writes:
> > As far as testing, I think we are going to have to wait for someone who
> > cares about sparcv8 because none of our current Sparc guys are testing
> > on that.
> 
> Yeah, I don't see anyone at all in the buildfarm testing Solaris-on-Sparc
> with the Sun tools.  So all these patches are completely untested, in
> either the cas or ldstub paths.  Ugh.

Yep, "Ugh" is right. I spent months trying to get someone to look at
this, so I think we are better than we were.  We have done our best.

-- 
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDBhttp://www.enterprisedb.com

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

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] [COMMITTERS] pgsql: Add simplified sparc8 ASM for solaris_sparc.s, from Alan Stange.

2006-05-18 Thread Tom Lane
Bruce Momjian  writes:
> As far as testing, I think we are going to have to wait for someone who
> cares about sparcv8 because none of our current Sparc guys are testing
> on that.

Yeah, I don't see anyone at all in the buildfarm testing Solaris-on-Sparc
with the Sun tools.  So all these patches are completely untested, in
either the cas or ldstub paths.  Ugh.

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Thomas Hallgren

Lukas Smith wrote:

.. but spouting outdated FUD is really making you two look foolish.

Wow. On a scale from 1 to 10 measuring seriousness, I'd put my posting on -4. I'd advice you 
to take a step back and get some distance if you consider it "outdated FUD".


Regards,
Thomas Hallgren


---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Philippe Schmid


If we had infinite resources this might make sense. We don't, so it  
doesn't. There is a real cost to producing a compatibility layer,  
and the cost will be those spiffy new features.


Let's get recursive queries, MERGE, and a couple more things and  
they will still be chasing our heels.


As a users of both Postgres and MySQL, I would also say, better add  
missing features to Postgres than chasing some specialties that are  
going to vanish anyway in MySQL.


I miss :
- a core full-text indexing engine. Tsearch2 is nice, but not  
included. This is a feature often used by PHP/MySQL packages.

- per table or column choice of char set/encoding
- better configurations or a tool to give the user some clue how to  
optimize the postgres settings (I know, the pro will know every time,  
but not every MySQL user - potential Postgres convert is a pro, by large


More high end features like these are also very welcomed...
- recursive queries
- better partitioning
- multi-master sync
- the compression thread is also interesting (cf IBM DB2 Viper about  
this)


Till now, the postgres project managed to produce amazing stuff.  
Keeping the project focused will very probably be more difficult as  
more users are converted...


Best regards,
Philippe Schmid


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Chris Browne
[EMAIL PROTECTED] ("Marc G. Fournier") writes:
> To give someone a running chance at migrating it to PostgreSQL, a
> 'MySQL compatibility module' would allow them to just plug the
> existing DB in, and then work at improving sections of the code over
> time ...
>
> Hell, if done well, the module should be able to dump appropriately
> 'clean' PgSQL schemas ... as in your example elow about the domains ...

You can't have that because you essentially need to throw out four
aspects of fairly vital "data validation" functionality:

1.  Dates cease to be validatable.

2.  NULL and 0 and '' are all roughly equivalent, even though they
aren't.

3.  Foreign key constraints have to be ignored.

4.  You have to fabricate a locale offering a case-insensitive sort
order.

I suppose #4 isn't "vital data validation"...

But after you "gut" the PostgreSQL-based system of those four aspects
of data integrity, I'm not sure there's any remaining benefit to
having PostgreSQL in play...
-- 
"cbbrowne","@","cbbrowne.com"
http://cbbrowne.com/info/unix.html
CBS News report on Fort Worth tornado damage:
"Eight major downtown buildings were severely damaged and 1,000 homes
were damaged, with 95 uninhabitable.  Gov. George W. Bush declared
Tarrant County a disaster area.  Federal Emergency Management Agency
workers are expected to arrive sometime next week after required
paperwork is completed."

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes:
> Actually, I guess the amount of memory used for zlib's lookback buffer
> (or whatever they call it) could be pretty substantial, and I'm not sure
> if there would be a way to combine that across all tapes.

But there's only one active write tape at a time.  My recollection of
zlib is that compression is memory-hungry but decompression not so much,
so it seems like this shouldn't be a huge deal.

regards, tom lane

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] [pgsql-advocacy] Toward A Positive Marketing Approach.

2006-05-18 Thread elein
On Thu, May 18, 2006 at 01:32:51PM -0700, Michael Dean wrote:
> Greetings Guys
> 
> As a newbie person moving away from my technical background to 
> marketing, I think a refreshed course for pg is needed!  So far I have 
> read all 5000 or so of this month's emails and want to make a few 
> remarks IMHO:
> 
> 1.  We should treat all marketing efforts by hackers/programmers as 
> social bugs.  Get some marketing pros (debuggers) in on this, or the 
> popularity of postgresql will continue to pale in the real world.

Note that the push for postgresql at any given site is likely to be pushed 
up from the technical staff.  Find us some marketing pros who understand
the postgresql project and we'll let them have at it.

> 
> 2. Reward ISP's who newly support postgresql.  Give them free links, 
> somehow give them free expertise, give them focused help so that 
> offering postgresql to their customers will not end up in disaster as in 
> the past.  Less than 4% of ISP's worldwide support postgrsql. WHY?, if 
> pg is SO GOOD, and SO MUCH BETTER???

Links are free.  Support for PostgreSQL is free via the mailing lists
and IRC.  This free support is better than most call centers.

> 
> 3. Reward existing FOSS projects that make sensible provision to 
> accomodate postgresql in preference to other more "commercial" db's.  
> Free links, mention in newsletter, listing on websites, whatever it 
> takes to start pulling other open source communities behind postgresql.  
> A good example is bitweaver.org, a great integration project, very 
> professional, helpful to small businesses, but needs some promotional help.

This is already happening on the postgresql.org page and in the
PostgreSQL Weekly News.

> 
> 4. Stop being too cheap.  Money Talks!  Offer to PAY premiums to major 
> OSS aps who don't do pg, or don't do it well enough.  Like Compierre, 
> like Drupal.  Ask me if i would contribute $1000 to pg.org if the money 
> (guaranteed) went to get MY chosen favorite programs totally in 
> postgresql, even if forks were necessary?  How many others DON'T 
> contribute because they fail to see a coherent, systematic program of 
> promotion, just more of the same, free linuxworld booths and bof's year 
> after year, no affinity to the commercial realities out there. 

You can already do this.  Kick in money for a developer or consultant
and the program in question can be converted.   

> 
> 5. Make it easy, NOT hard, to come to postgresql.  Provide a 
> decision-tree selection software for ALL databases which is vendor neutral.

Ahh, Stonebraker's 4x4 matrix.

> 
> 6. Offer to assist nerwly popular university based applications around 
> the world, such that they authomatically choose postgresql to base their 
> software on.  A good example, the educators who wrote LAMS, adopted a 
> sensible database approach, but then went solely with mysql.

This is being done with the Google Summer of Code.

> 
> 7. Provide marketing based brochure models licensed in the creative 
> commons which is something more than a mere enumeration of pg features.  
> Something decision makers in companies can sink their teeth into, not 
> the programmers who work for them that do what they are told.  These 
> must speak to TCO and ROI over time.

Feel free to rewrite any brochures we have.  People will be happy
to use them.

> 
> 8. Stop mentioning mysql in every breath.  It serves them, not pg.  
> After all, mysql must be better, or why would these folks at pg be so 
> specifically, vociferously and universally concerned! talk only about 
> pg, make comparisons to the whole field of db's, don't single anyone out!

I actually agree with this.

> 
> I would be willing to bet that a bounty of just $50 would be enough to 
> influence major and minor FOSS projects to give pg major support. 
> 
> Anyway, this is from the heart, I know many persons will be outraged at 
> this upstart coming out and saying these things, but then again, I like 
> to live dangerously and I am not required to attend Java100.
> 
> Michael

Overall, I suggest you come to understand more about how open source
projects, and postgresql, specifically work.  Discuss with others 
*specific* items and how they can be implemented.  Action always speaks
more loudly than words.  For the most part Josh Berkus has been leading 
the marketing effort.  It would behoove you to discuss how you can help 
him in that effort.

Carry on!

Elein 
--
  PostgreSQL Consulting, Support & Training   
--
[EMAIL PROTECTED]Varlena, LLCwww.varlena.com

  office: (510)655-2584Yahoo: AElein
cell: (510)543-6079  AIM: varlenallc
 fax: (510)217-7008Skype: varlenallc

PostgreSQL General Bits   http://www.varlena.com/GeneralBits/
--
I have always depended on the

Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Lukas Kahwe Smith

David Fetter wrote:

On Thu, May 18, 2006 at 09:58:21PM +0200, Lukas Smith wrote:



In what way is this outdated?  Please provide a specific example.


see below ..


You have to understand that MySQL evolves just like PostgreSQL does.


If it were true, I would have to understand it, but the way MySQL
evolves is not even remotely like the way PostgreSQL does.  Here are a
few concrete differences:


Ok, I was not trying to imply that MySQL evolves in the same way .. only 
that it also evolves.



You've made some sweeping allegations here and no specifics.


sweeping allegations?

http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html
SET [GLOBAL|SESSION] sql_mode='ALLOW_INVALID_DATES'

That being said the solution is still lacking. I even filed a bug report 
 over this:

http://bugs.mysql.com/bug.php?id=17998

So I guess you can continue your commentary. Anyways, it was not my 
intention to educate PostgreSQL developers about MySQL, only that it 
would be wise not to make general comments about MySQL if you do not 
follow its development.


regards,
Lukas


---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes:
> Mark Woodward wrote:
>> Again, there is so much code for MySQL, a MySQL emulation layer, MEL for
>> short, could allow plug and play compatibility for open source, and closed
>> source, applications that otherwise would force a PostgreSQL user to hold
>> his or her nose and use MySQL.
>> 
> If we had infinite resources this might make sense. We don't, so it 
> doesn't. There is a real cost to producing a compatibility layer, and 
> the cost will be those spiffy new features.

The real problem is that there's a whole lot of stuff, such as mysql's
weak error checking, that I don't think a "compatibility layer" could
sanely provide.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


[HACKERS] Toward A Positive Marketing Approach.

2006-05-18 Thread Michael Dean

Greetings Guys

As a newbie person moving away from my technical background to 
marketing, I think a refreshed course for pg is needed!  So far I have 
read all 5000 or so of this month's emails and want to make a few 
remarks IMHO:


1.  We should treat all marketing efforts by hackers/programmers as 
social bugs.  Get some marketing pros (debuggers) in on this, or the 
popularity of postgresql will continue to pale in the real world.


2. Reward ISP's who newly support postgresql.  Give them free links, 
somehow give them free expertise, give them focused help so that 
offering postgresql to their customers will not end up in disaster as in 
the past.  Less than 4% of ISP's worldwide support postgrsql. WHY?, if 
pg is SO GOOD, and SO MUCH BETTER???


3. Reward existing FOSS projects that make sensible provision to 
accomodate postgresql in preference to other more "commercial" db's.  
Free links, mention in newsletter, listing on websites, whatever it 
takes to start pulling other open source communities behind postgresql.  
A good example is bitweaver.org, a great integration project, very 
professional, helpful to small businesses, but needs some promotional help.


4. Stop being too cheap.  Money Talks!  Offer to PAY premiums to major 
OSS aps who don't do pg, or don't do it well enough.  Like Compierre, 
like Drupal.  Ask me if i would contribute $1000 to pg.org if the money 
(guaranteed) went to get MY chosen favorite programs totally in 
postgresql, even if forks were necessary?  How many others DON'T 
contribute because they fail to see a coherent, systematic program of 
promotion, just more of the same, free linuxworld booths and bof's year 
after year, no affinity to the commercial realities out there. 

5. Make it easy, NOT hard, to come to postgresql.  Provide a 
decision-tree selection software for ALL databases which is vendor neutral.


6. Offer to assist nerwly popular university based applications around 
the world, such that they authomatically choose postgresql to base their 
software on.  A good example, the educators who wrote LAMS, adopted a 
sensible database approach, but then went solely with mysql.


7. Provide marketing based brochure models licensed in the creative 
commons which is something more than a mere enumeration of pg features.  
Something decision makers in companies can sink their teeth into, not 
the programmers who work for them that do what they are told.  These 
must speak to TCO and ROI over time.


8. Stop mentioning mysql in every breath.  It serves them, not pg.  
After all, mysql must be better, or why would these folks at pg be so 
specifically, vociferously and universally concerned! talk only about 
pg, make comparisons to the whole field of db's, don't single anyone out!


I would be willing to bet that a bounty of just $50 would be enough to 
influence major and minor FOSS projects to give pg major support. 

Anyway, this is from the heart, I know many persons will be outraged at 
this upstart coming out and saying these things, but then again, I like 
to live dangerously and I am not required to attend Java100.


Michael





---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Jim C. Nasby
On Thu, May 18, 2006 at 01:25:34PM -0700, Joshua D. Drake wrote:
> 
> >I do agree that its probably not worth allocating core resources to 
> >this, but spouting outdated FUD is really making you two look foolish.
> 
> And which FUD would this be?

That Feb. 31st is a valid date in MySQL. You can now configure it to
reject that (don't know if that's the default or not).

> >
> >You have to understand that MySQL evolves just like PostgreSQL does. So 
> >you better focus on advertising where PostgreSQL shines instead of 
> >poking fun at something you apparently do not follow.
> 
> Uhmmm, I am not even going to bother responding to this part. It is 
> obvious that *you* don't follow MySQL versus PostgreSQL.
> 
> No offense but the development models and thus evolution thereof are 
> completely different.

You just proved one of my points. It's pretty easy for executives to
understand that trying to store Feb. 31st in their database is probably
a bad idea, but arguments about development models and their impact on
software quality are likely to fall on deaf/befuddled ears.
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Joshua D. Drake



You've made some sweeping allegations here and no specifics.


sweeping allegations?

http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html
SET [GLOBAL|SESSION] sql_mode='ALLOW_INVALID_DATES'


Which can be turned off or on by any mysql user. Not to mention the fact 
that it is even an option.


Joshua D. Drake


follow its development.

regards,
Lukas




--

   === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
   Providing the most comprehensive  PostgreSQL solutions since 1997
 http://www.commandprompt.com/



---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Joshua D. Drake


I do agree that its probably not worth allocating core resources to 
this, but spouting outdated FUD is really making you two look foolish.


And which FUD would this be?



You have to understand that MySQL evolves just like PostgreSQL does. So 
you better focus on advertising where PostgreSQL shines instead of 
poking fun at something you apparently do not follow.


Uhmmm, I am not even going to bother responding to this part. It is 
obvious that *you* don't follow MySQL versus PostgreSQL.


No offense but the development models and thus evolution thereof are 
completely different.


Sincerely,

Joshua D. Drake




regards,
Lukas

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings




--

   === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
   Providing the most comprehensive  PostgreSQL solutions since 1997
 http://www.commandprompt.com/



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread David Fetter
On Thu, May 18, 2006 at 09:58:21PM +0200, Lukas Smith wrote:
> Joshua D. Drake wrote:
> >
> >No we can't, because then we are taking an invalid date, which is
> >potentially valid data (to the user) and modifying it to a valid
> >date that is indeed invalid data.
> >
> >One of the reasons that mysql is just stupid.
> 
> I do agree that its probably not worth allocating core resources to
> this, but spouting outdated FUD is really making you two look
> foolish.

In what way is this outdated?  Please provide a specific example.

> You have to understand that MySQL evolves just like PostgreSQL does.

If it were true, I would have to understand it, but the way MySQL
evolves is not even remotely like the way PostgreSQL does.  Here are a
few concrete differences:

* Community input.  PostgreSQL's code all comes from the community.
  MySQL's all comes from employees of MySQL AB because MySQL AB
  requires that all developers sign over copyrights to MySQL AB.
  Independent developers are not naïf or foolish enough to contribute
  on those terms.

* Standards compliance.  PostgreSQL has bailed on quite a few
  features, and will in the future, in order to comply to SQL
  standards.

* Marketing departments.  PGDG doesn't have one, and if it did, it
  wouldn't have the power to drive features.

> So you better focus on advertising where PostgreSQL shines instead
> of poking fun at something you apparently do not follow.

You've made some sweeping allegations here and no specifics.

Cheers,
D
-- 
David Fetter <[EMAIL PROTECTED]> http://fetter.org/
phone: +1 415 235 3778AIM: dfetter666
  Skype: davidfetter

Remember to vote!

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Jim C. Nasby
On Thu, May 18, 2006 at 08:32:10PM +0200, Martijn van Oosterhout wrote:
> On Thu, May 18, 2006 at 11:22:46AM -0500, Jim C. Nasby wrote:
> > AFAIK logtape currently reads in much less than 256k blocks. Of course
> > if you get lucky you'll read from one tape for some time before
> > switching to another, which should have a sort-of similar effect if the
> > drives aren't very busy with other things.
> 
> Logtape works with BLCKSZ blocks. Whether it's advisable or not, I
> don't know. One thing I'm noticing with this compression-in-logtape is
> that the memory cost per tape increases considerably. Currently we rely
> heavily on the OS to cache for us.
> 
> Lets say we buffer 256KB per tape, and we assume a large sort with many
> tapes, you're going to blow all your work_mem on buffers. If using
> compression uses more memory so that you can't have as many tapes and
> thus need multiple passes, well, we need to test if this is still a
> win.

So you're sticking with 8K blocks on disk, after compression? And then
decompressing blocks as they come in?

Actually, I guess the amount of memory used for zlib's lookback buffer
(or whatever they call it) could be pretty substantial, and I'm not sure
if there would be a way to combine that across all tapes.
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] Question about casts

2006-05-18 Thread Tom Lane
Martijn van Oosterhout  writes:
> Every cast costs space and lookup time.

Actually, we could probably have a net time savings here if the text
cast cases were hard-wired into parse_coerce.c.  The reason is that
about 10% of the default entries in pg_cast are "retail" implementations
of text-to-or-from-foo casts, and we could get rid of all those entries,
not to mention the associated pg_proc entries and underlying code.
That would certainly cut search time in pg_cast enough to pay for a
couple of hard-wired "typoid == TEXTOID" checks.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Michael Paesold

Joshua D. Drake wrote:

Thomas Hallgren wrote:

>
Couldn't we just install something that replaced invalid dates with a 
randomly generated but otherwise correct dates? That way they would 
become completely invisible. No one could even tell that the date was 
invalid to start with.


No we can't, because then we are taking an invalid date, which is 
potentially valid data (to the user) and modifying it to a valid date 
that is indeed invalid data.


I think you should have read a `;-)' after Thomas' suggestion.

;-)

Best Regards,
Michael

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Lukas Smith

Joshua D. Drake wrote:

Thomas Hallgren wrote:

John DeSoi wrote:


Right, you'll definitely need to hack the C source code to force 
PostgreSQL to accept invalid dates ;)


http://sql-info.de/mysql/gotchas.html#1_14

Couldn't we just install something that replaced invalid dates with a 
randomly generated but otherwise correct dates? That way they would 
become completely invisible. No one could even tell that the date was 
invalid to start with.




No we can't, because then we are taking an invalid date, which is 
potentially valid data (to the user) and modifying it to a valid date 
that is indeed invalid data.


One of the reasons that mysql is just stupid.


I do agree that its probably not worth allocating core resources to 
this, but spouting outdated FUD is really making you two look foolish.


You have to understand that MySQL evolves just like PostgreSQL does. So 
you better focus on advertising where PostgreSQL shines instead of 
poking fun at something you apparently do not follow.


regards,
Lukas

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Joshua D. Drake

Thomas Hallgren wrote:

John DeSoi wrote:


Right, you'll definitely need to hack the C source code to force 
PostgreSQL to accept invalid dates ;)


http://sql-info.de/mysql/gotchas.html#1_14

Couldn't we just install something that replaced invalid dates with a 
randomly generated but otherwise correct dates? That way they would 
become completely invisible. No one could even tell that the date was 
invalid to start with.




No we can't, because then we are taking an invalid date, which is 
potentially valid data (to the user) and modifying it to a valid date 
that is indeed invalid data.


One of the reasons that mysql is just stupid.

Joshua D. Drake


Regards,
Thomas Hallgren


---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly




--

   === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
   Providing the most comprehensive  PostgreSQL solutions since 1997
 http://www.commandprompt.com/



---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Jim C. Nasby
On Thu, May 18, 2006 at 02:58:11PM -0400, Mark Woodward wrote:
> > Jim C. Nasby wrote:
> >> On Wed, May 17, 2006 at 09:35:34PM -0400, John DeSoi wrote:
> >>> On May 17, 2006, at 8:08 PM, Mark Woodward wrote:
> >>>
>  What is the best way to go about creating a "plug and play,"
>  PostgreSQL
>  replacement for MySQL? I think the biggest problem getting PostgreSQL
>  accepted is that so much code is available for MySQL.
> >>>
> >>> http://pgfoundry.org/projects/mysqlcompat/
> >>
> >> Even better would be coming up with a compatability mode, a la what
> >> EnterpriseDB has done for Oracle.
> >
> > Good Lord NO. I don't want a bunch of hacked up code *because* MySQL
> > does it this way, running on top of PostgreSQL.
> >
> > I want to run PostgreSQL. If you want to run MySQL, run MySQL. If you
> > want to run Oracle, run Oracle.
> 
> It isn't always about what we want to do, unfortunately, sometimes it has
> to do with external factors outside of our control.
> 
> The reality is that MySQL is widely supported by some very, shall we say,
> "interesting" open source projects and using these products with
> PostgreSQL would be a plus.
> 
> I ask you, try to find some PHP/Open Source projects that support
> PostgreSQL just as well as MySQL? Most don't even support PostgreSQL.

Which means most ISPs don't support PostgreSQL. And most OSS users don't
get exposed to PostgreSQL. Which leads to more OSS that doesn't support
PostgreSQL...
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Andrew Dunstan

Mark Woodward wrote:

Jim C. Nasby wrote:


Maybe a compatability layer isn't worth doing, but I certainly think
it's very much worthwhile for the community to do everything possible to
encourage migration from MySQL. We should be able to lay claim to most
advanced and most popular OSS database.

  

We'll do that by concentrating on spiffy features, not compatibility
layers. I want people to use PostgreSQL because it's the best, not
because it's just like something else.




While I do agree with the ideal, the reality may not be good enough. Even
I, a PostgreSQL user for a decade, have to use MySQL right now because
that is what the client uses.

Again, there is so much code for MySQL, a MySQL emulation layer, MEL for
short, could allow plug and play compatibility for open source, and closed
source, applications that otherwise would force a PostgreSQL user to hold
his or her nose and use MySQL.


  
If we had infinite resources this might make sense. We don't, so it 
doesn't. There is a real cost to producing a compatibility layer, and 
the cost will be those spiffy new features.


Let's get recursive queries, MERGE, and a couple more things and they 
will still be chasing our heels.


cheers

andrew


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Joshua D. Drake


While I do agree with the ideal, the reality may not be good enough. Even
I, a PostgreSQL user for a decade, have to use MySQL right now because
that is what the client uses.


Then you aren't choosing your clients wisely. :)

I am not trying to be rude, but if you don't want to use MySQL, don't. 
We don't and we are testament to the fact that it is indeed possible to 
make a living off of JUST PostgreSQL.


The only time we touch a different database is to MIGRATE from that 
database.


Joshua D. Drake



--

   === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
   Providing the most comprehensive  PostgreSQL solutions since 1997
 http://www.commandprompt.com/



---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Thomas Hallgren

John DeSoi wrote:


Right, you'll definitely need to hack the C source code to force 
PostgreSQL to accept invalid dates ;)


http://sql-info.de/mysql/gotchas.html#1_14

Couldn't we just install something that replaced invalid dates with a randomly generated but 
otherwise correct dates? That way they would become completely invisible. No one could even 
tell that the date was invalid to start with.


Regards,
Thomas Hallgren


---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Mark Woodward
> Jim C. Nasby wrote:
>> Maybe a compatability layer isn't worth doing, but I certainly think
>> it's very much worthwhile for the community to do everything possible to
>> encourage migration from MySQL. We should be able to lay claim to most
>> advanced and most popular OSS database.
>>
>
> We'll do that by concentrating on spiffy features, not compatibility
> layers. I want people to use PostgreSQL because it's the best, not
> because it's just like something else.
>

While I do agree with the ideal, the reality may not be good enough. Even
I, a PostgreSQL user for a decade, have to use MySQL right now because
that is what the client uses.

Again, there is so much code for MySQL, a MySQL emulation layer, MEL for
short, could allow plug and play compatibility for open source, and closed
source, applications that otherwise would force a PostgreSQL user to hold
his or her nose and use MySQL.



---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Mark Woodward
> Jim C. Nasby wrote:
>> On Wed, May 17, 2006 at 09:35:34PM -0400, John DeSoi wrote:
>>> On May 17, 2006, at 8:08 PM, Mark Woodward wrote:
>>>
 What is the best way to go about creating a "plug and play,"
 PostgreSQL
 replacement for MySQL? I think the biggest problem getting PostgreSQL
 accepted is that so much code is available for MySQL.
>>>
>>> http://pgfoundry.org/projects/mysqlcompat/
>>
>> Even better would be coming up with a compatability mode, a la what
>> EnterpriseDB has done for Oracle.
>
> Good Lord NO. I don't want a bunch of hacked up code *because* MySQL
> does it this way, running on top of PostgreSQL.
>
> I want to run PostgreSQL. If you want to run MySQL, run MySQL. If you
> want to run Oracle, run Oracle.

It isn't always about what we want to do, unfortunately, sometimes it has
to do with external factors outside of our control.

The reality is that MySQL is widely supported by some very, shall we say,
"interesting" open source projects and using these products with
PostgreSQL would be a plus.

I ask you, try to find some PHP/Open Source projects that support
PostgreSQL just as well as MySQL? Most don't even support PostgreSQL.

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Andrew Dunstan

Jim C. Nasby wrote:

Maybe a compatability layer isn't worth doing, but I certainly think
it's very much worthwhile for the community to do everything possible to
encourage migration from MySQL. We should be able to lay claim to most
advanced and most popular OSS database.
  


We'll do that by concentrating on spiffy features, not compatibility 
layers. I want people to use PostgreSQL because it's the best, not 
because it's just like something else.


cheers

andrew


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread David Fetter
On Thu, May 18, 2006 at 01:22:55PM -0500, Jim C. Nasby wrote:
> On Thu, May 18, 2006 at 11:09:28AM -0700, David Fetter wrote:
> > postgres=# CREATE TABLE dual();
> > CREATE TABLE
> 
> You forgot to populate it.

Oh, right. :)

postgres=# CREATE TABLE dual AS SELECT 1;
SELECT

Cheers,
D
-- 
David Fetter <[EMAIL PROTECTED]> http://fetter.org/
phone: +1 415 235 3778AIM: dfetter666
  Skype: davidfetter

Remember to vote!

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Stephen Frost
* Joshua D. Drake ([EMAIL PROTECTED]) wrote:
> And to be frank, I don't think we should waste our time on MySQL. It 
> isn't a competitor, it just thinks it is. We should focus on our real 
> competition which is DB2, MSSQL, and Oracle.

One thing which would be kind of nice would be to have a mapping for the
common commands.  A friend of mine did this with a bit of perl so he
could have a single SQL script that could run against both Postgres and
Oracle.  His thought was actually just an aliasing ability in psql so
that you could, for example, alias 'desc' to '\d' and '@' to '\i'.  This
would have also helped me out with some projects for school- the main
issues I ran into were that Oracle required a cascade-drop to include
the keyword 'constraints' (which Postgres correctly forbids) and that 
Oracle uses 'MINUS' instead of 'EXCEPT' (where 'EXCEPT' is the SQL
standard, which Oracle doesn't accept for some reason. :/).

Just some thoughts,

Stephen


signature.asc
Description: Digital signature


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Martijn van Oosterhout
On Thu, May 18, 2006 at 11:22:46AM -0500, Jim C. Nasby wrote:
> AFAIK logtape currently reads in much less than 256k blocks. Of course
> if you get lucky you'll read from one tape for some time before
> switching to another, which should have a sort-of similar effect if the
> drives aren't very busy with other things.

Logtape works with BLCKSZ blocks. Whether it's advisable or not, I
don't know. One thing I'm noticing with this compression-in-logtape is
that the memory cost per tape increases considerably. Currently we rely
heavily on the OS to cache for us.

Lets say we buffer 256KB per tape, and we assume a large sort with many
tapes, you're going to blow all your work_mem on buffers. If using
compression uses more memory so that you can't have as many tapes and
thus need multiple passes, well, we need to test if this is still a
win.

Have a nice day,
-- 
Martijn van Oosterhout  http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to 
> litigate.


signature.asc
Description: Digital signature


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Joshua D. Drake



And MySQL is much closer to being a competitor now than they were in
4.1. And feature-wise they'll probably equal PostgreSQL in the next
release. Will the features be anywhere near as robust or well thought
out? No. But in a heck of a lot of companies that doesn't matter.


Your kidding right? Have you seen their "features"? Look at what their 
stored procedures are actually capable of.


The only thing that MySQL *might* pull off is a really good storage 
backend finally.



Maybe a compatability layer isn't worth doing, but I certainly think
it's very much worthwhile for the community to do everything possible to
encourage migration from MySQL. We should be able to lay claim to most
advanced and most popular OSS database.


Oh absolutely, I agree with you here but in order to do so in the most 
productive manner possible the community would have to be willing to be 
much more aggressive and much more antagnositic that I believe the 
community has the stomach for.


Sincerely,

Joshua D. Drake


--

   === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
   Providing the most comprehensive  PostgreSQL solutions since 1997
 http://www.commandprompt.com/



---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Jim C. Nasby
On Thu, May 18, 2006 at 02:56:12PM -0300, Marc G. Fournier wrote:
> the point isn't whether or not MySQL is a competitor ... the point is that 
> there are *alot* of MySQL based applications out there that are a major 
> PITA to convert (or get converted) all at once ...

More importantly, there's a lot of MySQL *users*, and they get to
influence which database is chosen in many companies. For many years,
FreeBSD was far superior technologically to Linux, but Linux had the
popularity to make it into the enterprise.

And MySQL is much closer to being a competitor now than they were in
4.1. And feature-wise they'll probably equal PostgreSQL in the next
release. Will the features be anywhere near as robust or well thought
out? No. But in a heck of a lot of companies that doesn't matter.

Maybe a compatability layer isn't worth doing, but I certainly think
it's very much worthwhile for the community to do everything possible to
encourage migration from MySQL. We should be able to lay claim to most
advanced and most popular OSS database.
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Jim C. Nasby
On Thu, May 18, 2006 at 11:09:28AM -0700, David Fetter wrote:
> postgres=# CREATE TABLE dual();
> CREATE TABLE

You forgot to populate it.

In reality I think you'd want dual to be a view on SELECT 1; or whatever
the appropriate value is.
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread David Fetter
On Thu, May 18, 2006 at 02:56:12PM -0300, Marc G. Fournier wrote:
> On Thu, 18 May 2006, Joshua D. Drake wrote:
> 
> >I understand the idea but I personally don't like it. I am not really 
> >interested in cross-database compatible code. 9 times out of 10 it is 
> >hacky, slow and lacks a solid supportable model because you are always 
> >taking into account *the other* databases the application supports.
> 
> I don't disagree about the 'hacky, slow and lacks ...' ... but,
> there are alot of MySQL based apps out there that are just *way too
> big* to convert wholesale to PostgreSQL that, in all honesty, are
> better suited to PostgreSQL ...

They're not too big when critical data is in there.  Then it's a
matter of what cost to make this wrong decision and have to fix it.

> To give someone a running chance at migrating it to PostgreSQL, a
> 'MySQL compatibility module' would allow them to just plug the
> existing DB in, and then work at improving sections of the code over
> time ...

You cannot cross a chasm in two steps.  MySQL apps don't generally
lend themselves to incremental improvements because they are so
tightly tied to MySQL's misbehaviors.  It would be silly and dangerous
to give people the misapprehension that this transition can be made
painlessly or at low cost.

Cheers,
D
-- 
David Fetter <[EMAIL PROTECTED]> http://fetter.org/
phone: +1 415 235 3778AIM: dfetter666
  Skype: davidfetter

Remember to vote!

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread David Fetter
On Thu, May 18, 2006 at 10:35:48AM -0700, Joshua D. Drake wrote:

> I understand the idea but I personally don't like it. I am not
> really interested in cross-database compatible code. 9 times out of
> 10 it is hacky, slow and lacks a solid supportable model because you
> are always taking into account *the other* databases the application
> supports.
> 
> And to be frank, I don't think we should waste our time on MySQL. It
> isn't a competitor, it just thinks it is. We should focus on our
> real competition which is DB2, MSSQL, and Oracle.
> 
> If we want to create contrib modules that have types etc... that
> help port from Oracle to PostgreSQL or DB2 to PostgreSQL I am all
> for it.
> 
> The first thing that comes to mind is a set of domains that
> implement Oracle types (names) as PostgreSQL types.
> 
> Here's a start ;)
> 
> postgres=# create domain varchar2 AS text;
> CREATE DOMAIN
> postgres=# create domain clob as text;
> CREATE DOMAIN
> postgres=# create domain blob as bytea;
> CREATE DOMAIN
> postgres=# create domain number as integer;
> CREATE DOMAIN
> postgres=#

postgres=# CREATE TABLE dual();
CREATE TABLE

Cheers,
D
-- 
David Fetter <[EMAIL PROTECTED]> http://fetter.org/
phone: +1 415 235 3778AIM: dfetter666
  Skype: davidfetter

Remember to vote!

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Josh Berkus
Marc,

> To give someone a running chance at migrating it to PostgreSQL, a 'MySQL
> compatibility module' would allow them to just plug the existing DB in,
> and then work at improving sections of the code over time ...

Have you even looked at KL's mysqlcompat?

-- 
--Josh

Josh Berkus
PostgreSQL @ Sun
San Francisco

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Marc G. Fournier

On Thu, 18 May 2006, Joshua D. Drake wrote:

I understand the idea but I personally don't like it. I am not really 
interested in cross-database compatible code. 9 times out of 10 it is 
hacky, slow and lacks a solid supportable model because you are always 
taking into account *the other* databases the application supports.


I don't disagree about the 'hacky, slow and lacks ...' ... but, there are 
alot of MySQL based apps out there that are just *way too big* to convert 
wholesale to PostgreSQL that, in all honesty, are better suited to 
PostgreSQL ...


To give someone a running chance at migrating it to PostgreSQL, a 'MySQL 
compatibility module' would allow them to just plug the existing DB in, 
and then work at improving sections of the code over time ...


Hell, if done well, the module should be able to dump appropriately 
'clean' PgSQL schemas ... as in your example elow about the domains ...


something like:

postgres=# create domain varchar2 AS text;
CREATE DOMAIN
postgres=# create table test ( mytext varchar2 );

should dump out to:

create tabel test ( mytext text );

So, developer would be able to load the MySQL schema and run the 
application, but would also be able to improve the code in the application 
and dump out a PgSQL clean schema so that the next person, in theory, 
wouldn't even need the MySQL module ...


the point isn't whether or not MySQL is a competitor ... the point is that 
there are *alot* of MySQL based applications out there that are a major 
PITA to convert (or get converted) all at once ...



 
Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Bruce Momjian
Tom Lane wrote:
> Bruce Momjian  writes:
> > Uh, TODO already has:
> 
> > o %Add a GUC variable to control the tablespace for temporary 
> > objects
> >   and sort files
> 
> >   It could start with a random tablespace from a supplied list and
> >   cycle through the list.
> 
> > Do we need to add to this?
> 
> The list bit strikes me as lily-gilding, or at least designing features
> well beyond proven need.

I have seen other databases do the round-robin idea, so it is worth
testing.

-- 
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDBhttp://www.enterprisedb.com

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

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Tom Lane
Bruce Momjian  writes:
> Uh, TODO already has:

> o %Add a GUC variable to control the tablespace for temporary objects
>   and sort files

>   It could start with a random tablespace from a supplied list and
>   cycle through the list.

> Do we need to add to this?

The list bit strikes me as lily-gilding, or at least designing features
well beyond proven need.

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] Question about casts

2006-05-18 Thread Tom Lane
Thomas Hallgren <[EMAIL PROTECTED]> writes:
> I would have thought that casting into the 
> string types was something that could be hardwired since the backing 
> functions are mandatory.

This has been proposed before, and seems reasonable to me (as long as
the casts are explicit-only), and I think it's listed in TODO; but
nobody's gotten around to it.

regards, tom lane

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Joshua D. Drake


'k, so you want "pure PostgreSQL" ... but, shouldn't it be possible, 
with all of our CREATE FUNCTION / RULES / etc features to create a 
'translation layer' that could be loaded, like anything else in contrib?


Sure but that isn't what was suggested :)



Hell, even if it gave an initial "in" for MySQL software developers to 
get their code running on PostgreSQL, and then when they come out that 
"do this is slower under PostgreSQL", they could optimize their code 
appropriately?


I understand the idea but I personally don't like it. I am not really 
interested in cross-database compatible code. 9 times out of 10 it is 
hacky, slow and lacks a solid supportable model because you are always 
taking into account *the other* databases the application supports.


And to be frank, I don't think we should waste our time on MySQL. It 
isn't a competitor, it just thinks it is. We should focus on our real 
competition which is DB2, MSSQL, and Oracle.


If we want to create contrib modules that have types etc... that help 
port from Oracle to PostgreSQL or DB2 to PostgreSQL I am all for it.


The first thing that comes to mind is a set of domains that implement 
Oracle types (names) as PostgreSQL types.


Here's a start ;)

postgres=# create domain varchar2 AS text;
CREATE DOMAIN
postgres=# create domain clob as text;
CREATE DOMAIN
postgres=# create domain blob as bytea;
CREATE DOMAIN
postgres=# create domain number as integer;
CREATE DOMAIN
postgres=#



Sincerely,

Joshua D. Drake






--

   === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
   Providing the most comprehensive  PostgreSQL solutions since 1997
 http://www.commandprompt.com/



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Marc G. Fournier

On Thu, 18 May 2006, Joshua D. Drake wrote:


Jim C. Nasby wrote:

On Wed, May 17, 2006 at 09:35:34PM -0400, John DeSoi wrote:

On May 17, 2006, at 8:08 PM, Mark Woodward wrote:


What is the best way to go about creating a "plug and play,"  PostgreSQL
replacement for MySQL? I think the biggest problem getting PostgreSQL
accepted is that so much code is available for MySQL.


http://pgfoundry.org/projects/mysqlcompat/


Even better would be coming up with a compatability mode, a la what
EnterpriseDB has done for Oracle.


Good Lord NO. I don't want a bunch of hacked up code *because* MySQL does it 
this way, running on top of PostgreSQL.


'k, so you want "pure PostgreSQL" ... but, shouldn't it be possible, with 
all of our CREATE FUNCTION / RULES / etc features to create a 'translation 
layer' that could be loaded, like anything else in contrib?


Hell, even if it gave an initial "in" for MySQL software developers to get 
their code running on PostgreSQL, and then when they come out that "do 
this is slower under PostgreSQL", they could optimize their code 
appropriately?



 
Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Alvaro Herrera
Josh Berkus wrote:

> Personally, I'd go after MSSQL before I bothered with MySQL.   Sure, let's 
> make *migration* easier for those who wake up and smell the BS, but migration 
> can (and probably should) be one-way.

Yeah.  Let's write a Transact-SQL PL handler.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Joshua D. Drake

Jim C. Nasby wrote:

On Wed, May 17, 2006 at 09:35:34PM -0400, John DeSoi wrote:

On May 17, 2006, at 8:08 PM, Mark Woodward wrote:

What is the best way to go about creating a "plug and play,"  
PostgreSQL

replacement for MySQL? I think the biggest problem getting PostgreSQL
accepted is that so much code is available for MySQL.


http://pgfoundry.org/projects/mysqlcompat/


Even better would be coming up with a compatability mode, a la what
EnterpriseDB has done for Oracle.


Good Lord NO. I don't want a bunch of hacked up code *because* MySQL 
does it this way, running on top of PostgreSQL.


I want to run PostgreSQL. If you want to run MySQL, run MySQL. If you 
want to run Oracle, run Oracle.


Sincerely,

Joshua D. Drake




--

   === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
   Providing the most comprehensive  PostgreSQL solutions since 1997
 http://www.commandprompt.com/



---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread John DeSoi


On May 18, 2006, at 12:24 PM, Jim C. Nasby wrote:


Even better would be coming up with a compatability mode, a la what
EnterpriseDB has done for Oracle.


Right, you'll definitely need to hack the C source code to force  
PostgreSQL to accept invalid dates ;)


http://sql-info.de/mysql/gotchas.html#1_14



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Josh Berkus
All,

> > >What is the best way to go about creating a "plug and play,"
> > >PostgreSQL
> > >replacement for MySQL? I think the biggest problem getting PostgreSQL
> > >accepted is that so much code is available for MySQL.
> >
> > http://pgfoundry.org/projects/mysqlcompat/
>
> Even better would be coming up with a compatability mode, a la what
> EnterpriseDB has done for Oracle.

Um, no offense, but why?   Do we really *want* to seek out thousands of users 
who won't pay anyone for support, don't care about data integrity, and regard 
the database as an enhanced flat file?Who adore non-standard syntax like 
`db_object_name` and REPLACE INTO?   Who want to just get free downloads and 
not contribute to a project?

Personally, I'd go after MSSQL before I bothered with MySQL.   Sure, let's 
make *migration* easier for those who wake up and smell the BS, but migration 
can (and probably should) be one-way.

If we're talking about other OSS projects, then I think it makes more sense 
for us to help those projects add PostgreSQL support.  And do promote the 
projects that already *do* support us.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Jim C. Nasby
On Wed, May 17, 2006 at 09:35:34PM -0400, John DeSoi wrote:
> 
> On May 17, 2006, at 8:08 PM, Mark Woodward wrote:
> 
> >What is the best way to go about creating a "plug and play,"  
> >PostgreSQL
> >replacement for MySQL? I think the biggest problem getting PostgreSQL
> >accepted is that so much code is available for MySQL.
> 
> 
> http://pgfoundry.org/projects/mysqlcompat/

Even better would be coming up with a compatability mode, a la what
EnterpriseDB has done for Oracle.
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Jim C. Nasby
On Thu, May 18, 2006 at 10:57:16AM +0200, Zeugswetter Andreas DCP SD wrote:
> 
> > 1) Use n sort areas for n tapes making everything purely sequential
> access.
> 
> Some time ago testing I did has shown, that iff the IO block size is
> large enough
> (256k) it does not really matter that much if the blocks are at random
> locations.
> I think that is still true for current model disks.
> 
> So unless we parallelize, it is imho sufficient to see to it that we
> write
> (and read) large enough blocks with single calls. This also has no
> problem in 
> highly concurrent scenarios, where you do not have enough spindles.

AFAIK logtape currently reads in much less than 256k blocks. Of course
if you get lucky you'll read from one tape for some time before
switching to another, which should have a sort-of similar effect if the
drives aren't very busy with other things.
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Jim C. Nasby
On Thu, May 18, 2006 at 11:34:51AM +0100, Simon Riggs wrote:
> On Tue, 2006-05-16 at 15:42 -0500, Jim C. Nasby wrote:
> > On Tue, May 16, 2006 at 12:31:07PM -0500, Jim C. Nasby wrote:
> > > In any case, my curiousity is aroused, so I'm currently benchmarking
> > > pgbench on both a compressed and uncompressed $PGDATA/base. I'll also do
> > > some benchmarks with pg_tmp compressed.
> >  
> > Results: http://jim.nasby.net/bench.log
> > 
> > As expected, compressing $PGDATA/base was a loss. But compressing
> > pgsql_tmp and then doing some disk-based sorts did show an improvement,
> > from 366.1 seconds to 317.3 seconds, an improvement of 13.3%. This is on
> > a Windows XP laptop (Dell Latitude D600) with 512MB, so it's somewhat of
> > a worst-case scenario. On the other hand, XP's compression algorithm
> > appears to be pretty aggressive, as it cut the size of the on-disk sort
> > file from almost 700MB to 82MB. There's probably gains to be had from a
> > different compression algorithm.
> 
> Can you re-run these tests using "SELECT aid FROM accounts ..."
> "SELECT 1 ... " is of course highly compressible.
> 
> I also note that the compressed file fits within memory and may not even
> have been written out at all. That's good, but this sounds like the very
> best case of what we can hope to achieve. We need to test a whole range
> of cases to see if it is generally applicable, or only in certain cases
> - and if so which ones.
> 
> Would you be able to write up some extensive testing of Martijn's patch?
> He's followed through on your idea and written it (on -patches now...)

Yes, I'm working on that. I'd rather test his stuff than XP's
compression anyway.
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] pg_dump and backslash escapes

2006-05-18 Thread Bruce Momjian
Greg Stark wrote:
> Bruce Momjian  writes:
> 
> > Zeugswetter Andreas DCP SD wrote:
> >
> > > I thought the suggested procedure (see migration doc) was to use the 
> > > new pg_dump to dump the older db version, so why backpatch ?
> > 
> > Uh, you can suggest it, but I would guess < 50% do it, and once the old
> > database is gone, there is no way to re-do the dump.
> 
> I thought the plan was to have one version that supported
> standards_conforming_strings but defaulted to false anyways. So this would
> only bite people who were jumping over an entire major release.

Yes, that is true.

-- 
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDBhttp://www.enterprisedb.com

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

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Bruce Momjian

Uh, TODO already has:

o %Add a GUC variable to control the tablespace for temporary objects
  and sort files

  It could start with a random tablespace from a supplied list and
  cycle through the list.

Do we need to add to this?

---

Greg Stark wrote:
> "Jim C. Nasby" <[EMAIL PROTECTED]> writes:
> 
> > Which means we need all the interface bits to be able to tell PostgreSQL
> > where every single temp storage area is. Presumably much of the
> > tablespace mechanism could be used for this, but it's still a bunch of
> > work. And you can't just say "I have 8 spindles", you have to tell
> > PostgreSQL exactly where to put each temporary area (unless you just
> > have it put one on every tablespace you have defined).
> 
> Yes, if you have more than one temporary area you definitely need a way to
> tell Postgres where to put them since obviously they won't be in the postgres
> base directory. But I think that's all Postgres really needs to know.
> 
> One could imagine a more complex version where Postgres has meta information
> about the bandwidth and seek penalty for each sort area separately. Presumably
> also for each table space. But that's a whole lot more complexity than
> Postgres's current cost model.
> 
> 
> > > that it should strive to maximize sequential reads within one temp area 
> > > and
> > > expect switching between temp areas (which represent multiple spindles) 
> > > to be
> > > better than multiplexing multiple tapes within a single temp area (which
> > > represents a single spindle).
> > 
> > Which adds yet more complexity to all the code that uses the temp area.
> > And as others have brought up, you still have to allow for the case when
> > splitting all of this out into multiple files means you end up using
> > substantially more disk space. That further drives up the complexity.
> 
> You also have to consider that it won't always be a benefit to spread the sort
> over multiple sort areas. If there's only one sort going on and you can reach
> a 1:1 ratio between tapes and spindles then I think it would be a huge
> benefit. Effectively boosting the sort speed by random_page_cost.
> 
> But if you don't have as many spindles as your algorithm needs tapes
> then it's unclear which to multiplex down and whether you gain any benefit
> once you're multiplexing over simply using a single sort area.
> 
> And worse, if there are multiple sorts going on in the system then you're not
> going to get sequential access even if you have multiple sort areas available.
> If you have N sort areas and N sorts are going on then you're probably better
> off multiplexing each one down to a single sort area and letting them each
> proceed without interfering with each other rather than having each one hog
> all the sort areas and forcing the OS to do the multiplexing blindly.
> 
> > My point is that unless someone shows that there's a non-trivial
> > performance gain here, it's not going to happen.
> 
> I think two extreme cases are well worth pursuing: 
> 
> 1) Use n sort areas for n tapes making everything purely sequential access.
>That would be useful for large DSS systems where large sorts are running
>and i/o bandwidth is high for sequential access. That gives effectively a
>random_page_cost speed boost.
> 
> 2) Use the current algorithm unchanged but have each sort use a different sort
>area in some sort of round-robin fashion. That helps the OLTP type
>environment (ignoring for the moment that OLTP environments really ought
>not be doing disk sorts) where people complain about unreliable execution
>times more than slow execution times. If you can provide enough sort areas
>then it would remove one big reason other queries concurrent impact the
>execution time of queries.
> 
> -- 
> greg
> 
> 
> ---(end of broadcast)---
> TIP 3: Have you checked our extensive FAQ?
> 
>http://www.postgresql.org/docs/faq
> 

-- 
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDBhttp://www.enterprisedb.com

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

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Question about casts

2006-05-18 Thread Thomas Hallgren

Martijn van Oosterhout wrote:

On Thu, May 18, 2006 at 05:41:14PM +0200, Thomas Hallgren wrote:
  
Just out of curiosity (and most likely, ignorance). Why can't I cast an 
array of strings into a string? I.e.


 thhal=# select ('{"a","b"}'::varchar[])::varchar;
 ERROR:  cannot cast type character varying[] to character varying



Why would you need to? What would you expect to happen? Joined with a
seperator, no seperator, with parenthesis?

  

Well, let's assume I use JDBC. I write code like:

 ResultSet rs = stmt.executeQuery("SELECT arrValue ...");
 while(rs.next())
 String v = rs.getString(1);

The tuples received by the result set contains String[]. If I let 
PL/Java convert it (I don't currently), it will be according to Java 
semantics. I'd like to convert it using PostgreSQL semantics instead. So 
I change my statement to:


 "SELECT array_out(arrValue) ..."

that works of course. What baffles me is that I cannot write

 "SELECT arrValue::varchar"



What's the benefit of a cast over a function call?

  
None whatsoever. But PostgreSQL enables a lot of casts for some reason 
or another right? Why not this one?



Every cast costs space and lookup time. Any user can add their own
casts if they want, but the system generally only includes the ones
useful to many people or those required for standards complience.

  
OK. I can live with that. I would have thought that casting into the 
string types was something that could be hardwired since the backing 
functions are mandatory.


Regards,
Thomas Hallgren


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Google and the Beta Freeze

2006-05-18 Thread Robert Treat
On Thursday 18 May 2006 10:39, Tom Lane wrote:
> Robert Treat <[EMAIL PROTECTED]> writes:
> > On Thursday 18 May 2006 05:47, Simon Riggs wrote:
> >> I've just noticed that Google's Summer of Code projects are due to
> >> finish on August 21, 2006 at 08:00 Pacific Daylight Time.
> >>
> >> Which is three weeks past the beta freeze date of Aug 1st.
> >>
> >> Anyone see any problems there?
> >
> > None of these projects will be a surprise to anyone, so in theory we
> > could allow them to continue with submissions after the feature freeze
> > date...
>
> If we were going to allow SOC to determine our release schedule, we'd
> probably have to push back beta freeze at least two months --- we
> couldn't expect to go beta immediately after someone submits code,
> especially if the someone is a student whose code will need review
> before it goes in.
>

One issue here is that the applicants may not have time to spend working on 
thier projects after the SoC is Finished.  Remember the idea here is that the 
students can be *done* with the project  the end of the summer, where *done* 
to me means that the code should be in a fairly acceptable format for 
inclusion (and it is up to mentors to keep folks on track, getting some code 
review along the way).  If those submissions get pushed back to next release 
I think you are going to have a hard time looking these people up 3-4 months 
down the line to finish things... 

> I'm not particularly eager to do this, especially not when we don't
> even have any committed SOC projects.  There's always the next release.
>

IMHO pushing the date back 1 month (to Sept 1st) would give ample time for 
both any SoC projects to be finished, and probably work a little better for 
the community. Between the Summit and OSCon July is going to be a busy month, 
and that August 1st deadline will come pretty quick.  That said, I think we 
should at least wait until we know how many projects we are talking about 
(and what they are) before making a decision.  

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

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] Question about casts

2006-05-18 Thread Martijn van Oosterhout
On Thu, May 18, 2006 at 05:41:14PM +0200, Thomas Hallgren wrote:
> Just out of curiosity (and most likely, ignorance). Why can't I cast an 
> array of strings into a string? I.e.
> 
>  thhal=# select ('{"a","b"}'::varchar[])::varchar;
>  ERROR:  cannot cast type character varying[] to character varying

Why would you need to? What would you expect to happen? Joined with a
seperator, no seperator, with parenthesis?

> or a cstring into a varchar, i.e.
> 
>  thhal=# select array_out('{"a","b"}'::varchar[])::varchar;
>  ERROR:  cannot cast type cstring to character varying

varchar_in will do the conversion, why would want to make it a cast?
What's the benefit of a cast over a function call?

> ISTM, the implementation of such casts should be fairly simple and 
> straight forward and sometimes even useful. Every data type comes with 
> string coercion routines anyway right?

Every cast costs space and lookup time. Any user can add their own
casts if they want, but the system generally only includes the ones
useful to many people or those required for standards complience.

Have a nice day,
-- 
Martijn van Oosterhout  http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to 
> litigate.


signature.asc
Description: Digital signature


[HACKERS] Question about casts

2006-05-18 Thread Thomas Hallgren
Just out of curiosity (and most likely, ignorance). Why can't I cast an 
array of strings into a string? I.e.


 thhal=# select ('{"a","b"}'::varchar[])::varchar;
 ERROR:  cannot cast type character varying[] to character varying

or a cstring into a varchar, i.e.

 thhal=# select array_out('{"a","b"}'::varchar[])::varchar;
 ERROR:  cannot cast type cstring to character varying

ISTM, the implementation of such casts should be fairly simple and 
straight forward and sometimes even useful. Every data type comes with 
string coercion routines anyway right?


Regards,
Thomas Hallgren


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Google and the Beta Freeze

2006-05-18 Thread Jonah H. Harris

On 5/18/06, Josh Berkus  wrote:

The ones which are no-brainers, like ECPG cleanup,
can easily stray past Aug. 1st because they are
mostly bug-fixes.  Hmmm ... actually, that may be the
only one like that.


Yeah, the rest appear to be either contrib modules, core changes, or
related to other PostgreSQL projects (phpPgAdmin, PgAdmin, etc.)

--
Jonah H. Harris, Software Architect | phone: 732.331.1300
EnterpriseDB Corporation| fax: 732.331.1301
33 Wood Ave S, 2nd Floor| [EMAIL PROTECTED]
Iselin, New Jersey 08830| http://www.enterprisedb.com/

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [HACKERS] Google and the Beta Freeze

2006-05-18 Thread Josh Berkus
All,

> I'm not particularly eager to do this, especially not when we don't
> even have any committed SOC projects.  There's always the next release.

Also, our previous project (Meredith's "Query by Example") isn't yet ready for 
inclusion in the core code (nor have we had the discussion on whether it 
belongs there) -- she's still working on it.  There's no reason to believe 
that any of these projects will be any further than alpha by August 21.

The ones which are no-brainers, like ECPG cleanup, can easily stray past Aug. 
1st because they are mostly bug-fixes.  Hmmm ... actually, that may be the 
only one like that.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] Google and the Beta Freeze

2006-05-18 Thread Tom Lane
Robert Treat <[EMAIL PROTECTED]> writes:
> On Thursday 18 May 2006 05:47, Simon Riggs wrote:
>> I've just noticed that Google's Summer of Code projects are due to
>> finish on August 21, 2006 at 08:00 Pacific Daylight Time.
>> 
>> Which is three weeks past the beta freeze date of Aug 1st.
>> 
>> Anyone see any problems there?

> None of these projects will be a surprise to anyone, so in theory we could 
> allow them to continue with submissions after the feature freeze
> date...

If we were going to allow SOC to determine our release schedule, we'd
probably have to push back beta freeze at least two months --- we
couldn't expect to go beta immediately after someone submits code,
especially if the someone is a student whose code will need review
before it goes in.

I'm not particularly eager to do this, especially not when we don't
even have any committed SOC projects.  There's always the next release.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] PL/pgSQL 'i = i + 1' Syntax

2006-05-18 Thread Andrew Dunstan

Hannu Krosing wrote:


Can you do something like "A > (B := C)" or "IF (A:=B) THEN ..." in
ADA ?

  


Er, that's "Ada"; "ADA" is the American Dental Association among other 
things.


And no you certainly can't do it. Assignment is a statement, not an 
expression, and this family of languages distinguishes between the two 
quite sharply. This is quite different from, say, C, where an assignment 
statement is simply an expression whose evaluation has a side effect and 
whose value is thrown away.


Anyway, this discussion seems to going nowhere much.

cheers

andrew


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Google and the Beta Freeze

2006-05-18 Thread Robert Treat
On Thursday 18 May 2006 05:47, Simon Riggs wrote:
> I've just noticed that Google's Summer of Code projects are due to
> finish on August 21, 2006 at 08:00 Pacific Daylight Time.
>
> Which is three weeks past the beta freeze date of Aug 1st.
>
> Anyone see any problems there?

None of these projects will be a surprise to anyone, so in theory we could 
allow them to continue with submissions after the feature freeze date... in 
theory they should all have partial patches available by feature freeze time  
anyway. It would probably be easier to just push back the freeze a month 
though; guess that might depend on how many projects we actually get that 
need core internals hacking.  I suppose it is up to core eh, though we don't 
have all the info just yet.  

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

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Simon Riggs
On Tue, 2006-05-16 at 15:42 -0500, Jim C. Nasby wrote:
> On Tue, May 16, 2006 at 12:31:07PM -0500, Jim C. Nasby wrote:
> > In any case, my curiousity is aroused, so I'm currently benchmarking
> > pgbench on both a compressed and uncompressed $PGDATA/base. I'll also do
> > some benchmarks with pg_tmp compressed.
>  
> Results: http://jim.nasby.net/bench.log
> 
> As expected, compressing $PGDATA/base was a loss. But compressing
> pgsql_tmp and then doing some disk-based sorts did show an improvement,
> from 366.1 seconds to 317.3 seconds, an improvement of 13.3%. This is on
> a Windows XP laptop (Dell Latitude D600) with 512MB, so it's somewhat of
> a worst-case scenario. On the other hand, XP's compression algorithm
> appears to be pretty aggressive, as it cut the size of the on-disk sort
> file from almost 700MB to 82MB. There's probably gains to be had from a
> different compression algorithm.

Can you re-run these tests using "SELECT aid FROM accounts ..."
"SELECT 1 ... " is of course highly compressible.

I also note that the compressed file fits within memory and may not even
have been written out at all. That's good, but this sounds like the very
best case of what we can hope to achieve. We need to test a whole range
of cases to see if it is generally applicable, or only in certain cases
- and if so which ones.

Would you be able to write up some extensive testing of Martijn's patch?
He's followed through on your idea and written it (on -patches now...)

-- 
  Simon Riggs 
  EnterpriseDB   http://www.enterprisedb.com


---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


[HACKERS] Google and the Beta Freeze

2006-05-18 Thread Simon Riggs

I've just noticed that Google's Summer of Code projects are due to
finish on August 21, 2006 at 08:00 Pacific Daylight Time.

Which is three weeks past the beta freeze date of Aug 1st.

Anyone see any problems there?

-- 
  Simon Riggs 
  EnterpriseDB   http://www.enterprisedb.com


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] Clarification required

2006-05-18 Thread Dave Page
 

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: 18 May 2006 10:30
> To: Dave Page
> Cc: pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] Clarification required
> 
> The server log file means the files that are in pg_xlog. or 
> some more/some other files?
> 
> The log files in pg_xlog dir are not human readable. How is 
> it useful on the client side?

Not the transaction logs, the postmaster logs. Check the log_directory
parameter if redirect_stderr is turned on, or the startup parameters for
the server which can also specify the log location.

Regards, Dave.


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] PL/pgSQL 'i = i + 1' Syntax

2006-05-18 Thread Hannu Krosing
Ühel kenal päeval, N, 2006-05-18 kell 09:28, kirjutas Albe Laurenz:
> Josh Berkus wrote:
> >> If you only care about Oracle to PostgreSQL (and who wouldn't?), then  
> >> it in fact seems desirable for PL/pgSQL to be a superset of PL/SQL.
> > 
> > I agree with David here.   We care about the ability to migrate PL/SQL --> 
> > PL/pgSQL.   We do *not* care about the ability to migrate PL/pgSQL --> 
> > PL/SQL.  So supporting extra syntax which Oracle doesn't ... as long as 
> > the Oracle syntax still works ... is in fact a good thing.
> 
> I cannot feel good about deliberately introducing incompatibilities.

I guess that PL/pgSQL will always be "an extended subset" of PL/SQL, and
never be direct replacement, so I dont see another extension as
introducing incompatibilities.

> If assignment by '=' gets documented and known, it will get used.
> This in turn will make PL/pgSQL less familiar for PL/SQL coders.
> And that will make them more reluctant to change over.

Someone else using = instead of := is the least of their worries when
switching to PostgreSQL (and you cant switch to PL/pgSQL without
switching to PostgreSQL). 

PostgreSQL generally behaves differently on much deeper levels,
sometimes better sometimes worse. And you need to optimise code in
different ways, as much of oracles deep secrets are not applicable to
pg.

> I think it would be best to get a compile error when '=' is used for
> assignment, but if that's too much effort, I believe that the current
> behaviour is acceptable as long as it doesn't get documented and
> 'good practice'.

What does PL/SQL use for assignment inside UPDATE statements ?

Is it "SET A=B" like in SQL or "SET A:=B" like in rest of PL/SQL ?

-- 

Hannu Krosing
Database Architect
Skype Technologies OÜ
Akadeemia tee 21 F, Tallinn, 12618, Estonia

Skype me:  callto:hkrosing
Get Skype for free:  http://www.skype.com



---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] Clarification required

2006-05-18 Thread Dhanaraj M
The server log file means the files that are in pg_xlog. or some 
more/some other files?


The log files in pg_xlog dir are not human readable. How is it useful on 
the client side?


Dave Page wrote:





could not understand the following TODO item.
Can anyone explain this.

Monitoring:
=

Allow server logs to be remotely read and removed using SQL commands


Does it mean that the server log file should be read by the 
client? What kind of removal (using SQL)?
   



This is possible using the functions in the adminpack contrib module
that's currently in the patch queue:
http://candle.pha.pa.us/mhonarc/patches/msg6.html

 


Also I like to know where the server log file is stored.
   


Check your postgresql.conf file.

Regards, Dave.
 




---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Zeugswetter Andreas DCP SD

> 1) Use n sort areas for n tapes making everything purely sequential
access.

Some time ago testing I did has shown, that iff the IO block size is
large enough
(256k) it does not really matter that much if the blocks are at random
locations.
I think that is still true for current model disks.

So unless we parallelize, it is imho sufficient to see to it that we
write
(and read) large enough blocks with single calls. This also has no
problem in 
highly concurrent scenarios, where you do not have enough spindles.

Andreas

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] PL/pgSQL 'i = i + 1' Syntax

2006-05-18 Thread Florian Weimer
* Jonah H. Harris:

> On 5/17/06, Hannu Krosing <[EMAIL PROTECTED]> wrote:
>> Does ADA have both assignment and comparison as operators, or is
>> assignment a statement ?
>
> Yes.  Assignment is := and comparison is =

And its name is spelled "Ada", not "ADA", even though the language
itself is case-insensitive.

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] Compression and on-disk sorting

2006-05-18 Thread Florian Weimer
* Jim C. Nasby:

> The problem is that it seems like there's never enough ability to clue
> the OS in on what the application is trying to accomplish. For a long
> time we didn't have a background writer, because the OS should be able
> to flush things out on it's own before checkpoint. Now there's talk of a
> background reader, because backends keep stalling on waiting on disk IO.

I've recently seen this on one of our test systems -- neither CPU nor
disk I/O were maxed out.

Have you considered using asynchronous I/O?  Maybe it results in less
complexity and fewer context switches than a background reader.

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] [OT] MySQL is bad, but THIS bad?

2006-05-18 Thread Florian Weimer
* Mark Woodward:

> "On the other hand, you shouldn't use mysql_use_result() if you are doing
> a lot of processing for each row on the client side, or if the output is
> sent to a screen on which the user may type a ^S (stop scroll). This ties
> up the server and prevent other threads from updating any tables from
> which the data is being fetched."
>
> How do busy web sites work like this?

Any system based on locking exhibits this problem.  Even with MVCC,
you can run into it if you've got multiple writers.  As a rule of
thumb, I never perform network I/O within transactions which update
the database (or "read the database", for systems without MVCC).

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [PERFORM] [HACKERS] Big IN() clauses etc : feature proposal

2006-05-18 Thread Gregory S. Williamson
1.451 ms = 1.451 milliseconds
1451.0 ms = 1.451 seconds ...

so 32.918 ms for a commit seems perhaps reasonable ?

Greg Williamson
DBA
GlobeXplorer LLC



-Original Message-
From:   [EMAIL PROTECTED] on behalf of Zeugswetter Andreas DCP SD
Sent:   Thu 5/11/2006 12:55 AM
To: Jim C. Nasby; PFC
Cc: Greg Stark; Tom Lane; pgsql-performance@postgresql.org; 
pgsql-hackers@postgresql.org
Subject:Re: [PERFORM] [HACKERS] Big IN() clauses etc : feature proposal


> Something else worth considering is not using the normal 
> catalog methods
> for storing information about temp tables, but hacking that together
> would probably be a rather large task.

But the timings suggest, that it cannot be the catalogs in the worst
case
he showed.

> 0.101 ms BEGIN
> 1.451 ms CREATE TEMPORARY TABLE tmp ( a INTEGER NOT NULL, b INTEGER
NOT  
> NULL, c TIMESTAMP NOT NULL, d INTEGER NOT NULL ) ON COMMIT DROP

1.4 seconds is not great for create table, is that what we expect ?

> 0.450 ms INSERT INTO tmp SELECT * FROM bookmarks ORDER BY annonce_id
DESC  
> LIMIT 20
> 0.443 ms ANALYZE tmp
> 0.365 ms SELECT * FROM tmp
> 0.310 ms DROP TABLE tmp
> 32.918 ms COMMIT
> 
>   CREATING the table is OK, but what happens on COMMIT ? I hear
the disk  
> seeking frantically.

The 32 seconds for commit can hardly be catalog related. It seems the
file is 
fsynced before it is dropped.

Andreas

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq

!DSPAM:446c0a75172664042098162!





---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] Desperately Seeking Mentors -- Right Now!

2006-05-18 Thread Michael Meskes
On Wed, May 17, 2006 at 09:08:21PM -0700, Josh Berkus wrote:
> We could really use a couple more Mentors for Google Summer of Code Projects. 
>  
> Particularly, we've had some good proposals in these areas:
> 
> ECPG Cleanup

I'd be interested in being a mentor for this proposal.

> If you are interested in mentoring a student doing hacking on any of the 
> above, please contact me in the next 24 hours.  Also apply to be a mentor 
> here: http://code.google.com/soc/mentor_home.html

Done.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: [EMAIL PROTECTED]
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] PL/pgSQL 'i = i + 1' Syntax

2006-05-18 Thread Albe Laurenz
Josh Berkus wrote:
>> If you only care about Oracle to PostgreSQL (and who wouldn't?), then  
>> it in fact seems desirable for PL/pgSQL to be a superset of PL/SQL.
> 
> I agree with David here.   We care about the ability to migrate PL/SQL --> 
> PL/pgSQL.   We do *not* care about the ability to migrate PL/pgSQL --> 
> PL/SQL.  So supporting extra syntax which Oracle doesn't ... as long as 
> the Oracle syntax still works ... is in fact a good thing.

I cannot feel good about deliberately introducing incompatibilities.
We are not Microsoft, are we?

If assignment by '=' gets documented and known, it will get used.
This in turn will make PL/pgSQL less familiar for PL/SQL coders.
And that will make them more reluctant to change over.

I think it would be best to get a compile error when '=' is used for
assignment, but if that's too much effort, I believe that the current
behaviour is acceptable as long as it doesn't get documented and
'good practice'.

Yours,
Laurenz Albe

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match