Re: [HACKERS] Visual Studio 2005, C-language function - avoiding hacks?

2010-03-05 Thread Dave Page
On Fri, Mar 5, 2010 at 4:02 AM, Craig Ringer cr...@postnewspapers.com.au wrote: Kevin Flanagan wrote: the compiler complained about various missing include files, starting with ‘libintl.h’. Having read the post at http://archives.postgresql.org/pgsql-general/2009-03/msg00332.php I created

Re: [HACKERS] Visual Studio 2005, C-language function - avoiding hacks?

2010-03-05 Thread Craig Ringer
Dave Page wrote: On Fri, Mar 5, 2010 at 4:02 AM, Craig Ringer cr...@postnewspapers.com.au wrote: Kevin Flanagan wrote: the compiler complained about various missing include files, starting with ‘libintl.h’. Having read the post at

Re: [HACKERS] Visual Studio 2005, C-language function - avoiding hacks?

2010-03-05 Thread Dave Page
On Fri, Mar 5, 2010 at 9:05 AM, Craig Ringer cr...@postnewspapers.com.au wrote: How do _you_ go about building server extensions for Pg? Where do you get the headers for gettext etc? Same place I get the binaries - gnuwin32 mostly. I'm increasingly thinking the win32 package _should_ be

Re: [HACKERS] Visual Studio 2005, C-language function - avoiding hacks?

2010-03-05 Thread Craig Ringer
Dave Page wrote: On Fri, Mar 5, 2010 at 9:05 AM, Craig Ringer cr...@postnewspapers.com.au wrote: How do _you_ go about building server extensions for Pg? Where do you get the headers for gettext etc? Same place I get the binaries - gnuwin32 mostly. I'm increasingly thinking the win32

Re: [HACKERS] Visual Studio 2005, C-language function - avoiding hacks?

2010-03-05 Thread Dave Page
On Fri, Mar 5, 2010 at 9:31 AM, Craig Ringer cr...@postnewspapers.com.au wrote: Why _not_ distribute gettext headers, though? Sources I can understand for size reasons, but the headers are small and fuss free, and you need the _right_ _versions_ to build against the Pg backend. No reason,

Re: [HACKERS] Explicit psqlrc

2010-03-05 Thread Magnus Hagander
2010/3/5 David Christensen da...@endpoint.com: On Mar 4, 2010, at 4:00 PM, Magnus Hagander wrote: I've now for the second time found myself wanting to specify an explicit psqlrc file instead of just parsing ~/.psqlrc, so attached is a patch that accepts the PSQLRC environment variable to

[HACKERS] Using GIN/Gist to search the union of two indexes?

2010-03-05 Thread Jesper Krogh
Hi. How complicated would it be to make postgresql-fts search the union of several GIN/Gist indexes. The use-case is that you have two tables: tablea(id serial, tableb_id int, text tsvector); and tableb(id serial, text tsvector); and indices on both tsvectors. The typical query would join the

Re: [HACKERS] Visual Studio 2005, C-language function - avoiding hacks?

2010-03-05 Thread Craig Ringer
Dave Page wrote: On Fri, Mar 5, 2010 at 9:31 AM, Craig Ringer cr...@postnewspapers.com.au wrote: Why _not_ distribute gettext headers, though? Sources I can understand for size reasons, but the headers are small and fuss free, and you need the _right_ _versions_ to build against the Pg

Re: [HACKERS] Visual Studio 2005, C-language function - avoiding hacks?

2010-03-05 Thread Kevin Flanagan
Ok, re building with the win32 configuration ... that sounds like just the thing I should know about. All I've done is downloaded and installed the 1-click installer for Windows from http://www.enterprisedb.com/products/pgdownload.do#windows ... so while I'm sure it knows it's running on

Re: [HACKERS] Visual Studio 2005, C-language function - avoiding hacks?

2010-03-05 Thread Craig Ringer
Kevin Flanagan wrote: Ok, re building with the win32 configuration ... that sounds like just the thing I should know about. All I've done is downloaded and installed the 1-click installer for Windows from http://www.enterprisedb.com/products/pgdownload.do#windows ... so while I'm sure it

Re: [HACKERS] Visual Studio 2005, C-language function - avoiding hacks?

2010-03-05 Thread Dave Page
On Fri, Mar 5, 2010 at 9:50 AM, Craig Ringer cr...@postnewspapers.com.au wrote: Dave Page wrote: On Fri, Mar 5, 2010 at 9:31 AM, Craig Ringer cr...@postnewspapers.com.au wrote: Why _not_ distribute gettext headers, though? Sources I can understand for size reasons, but the headers are small

Re: [HACKERS] Explicit psqlrc

2010-03-05 Thread Magnus Hagander
2010/3/5 Magnus Hagander mag...@hagander.net: 2010/3/5 David Christensen da...@endpoint.com: On Mar 4, 2010, at 4:00 PM, Magnus Hagander wrote: I've now for the second time found myself wanting to specify an explicit psqlrc file instead of just parsing ~/.psqlrc, so attached is a patch that

Re: [HACKERS] Repetition of warning message while REVOKE

2010-03-05 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: One thought is that the column cases should be phrased more like no privileges could be revoked for column foo of table bar Check the messages associated with DROP cascading for the canonical phrasing here, but I think that's what it is. Looks like

Re: [HACKERS] machine-readable pg_controldata?

2010-03-05 Thread Greg Smith
Magnus Hagander wrote: Huh? It's fixed with, you don't need regexps for that. Just split the string apart. Taking options for single fields might have a better usecase, of course :-) I do find it a bit hard to imagine that any program capable of shelling out to call pg_controldata and

Re: [HACKERS] Explicit psqlrc

2010-03-05 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: 2010/3/5 David Christensen da...@endpoint.com: My bikeshed has a --psqlrc path/to/file, but +1 on the idea. Do you have a use-case where --psqlrc would be more useful than an environment variable, or is it *only* bike-shedding? ;) The env variable

[HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread François Pérou
Dear friends, As a reminder, I took part in the development of pgAdmin and I am not looking for a flame war. I would like to point out Drupal community efforts (including myself) to write down the most frequent problems when porting MySQL from/to PostgreSQL: The main MySQL/PostgreSQL issues can

Re: [HACKERS] machine-readable pg_controldata?

2010-03-05 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I do find it a bit hard to imagine that any program capable of shelling out to call pg_controldata and doing something with the output would hit a major hurdle parsing the format that's already there. +1 1) How do you handle the

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Dave Page
2010/3/5 François Pérou francois.pe...@free.fr: Dear friends, As a reminder, I took part in the development of pgAdmin and I am not looking for a flame war. What did you work on François? I can't find your name in my email archives or on archives.postgresql.org. -- Dave Page EnterpriseDB

Re: [HACKERS] machine-readable pg_controldata?

2010-03-05 Thread Heikki Linnakangas
Greg Smith wrote: pg_controldata itself just reads the file in directly and dumps the data. There is a copy of it kept around all the time in shared memory though (ControlFile in xlog.c), protected by a LWLock. At a high level you can imagine a new function in xlog.c that acquires that lock,

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Andrew Dunstan
François Pérou wrote: An important pending issue, which goes on and on for years: = All non-aggregate fields must be present in the GROUP BY clause http://drupal.org/node/30 The trouble is that the bottom of this page looks like nonsense to me. The reason that |SELECT

Re: [HACKERS] Explicit psqlrc

2010-03-05 Thread Magnus Hagander
2010/3/5 Tom Lane t...@sss.pgh.pa.us: Magnus Hagander mag...@hagander.net writes: 2010/3/5 David Christensen da...@endpoint.com: My bikeshed has a --psqlrc path/to/file, but +1 on the idea. Do you have a use-case where --psqlrc would be more useful than an environment variable, or is it

[HACKERS] Core dump running PL/Perl installcheck with bleadperl [PATCH]

2010-03-05 Thread Tim Bunce
I encountered a core dump running PL/Perl installcheck with a very recent git HEAD of PostgreSQL and a not quite so recent git HEAD of perl. The cause is a subtle difference between SvTYPE(sv) == SVt_RV and SvROK(sv). The former is checking a low-level implementation detail while the later is

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Merlin Moncure
2010/3/5 François Pérou francois.pe...@free.fr: = All non-aggregate fields must be present in the GROUP BY clause http://drupal.org/node/30 My take is that this is never going to happen unless we are strictly talking about cases where the non-aggregate fields can be unambiguously

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Robert Haas
2010/3/5 François Pérou francois.pe...@free.fr: Dear friends, As a reminder, I took part in the development of pgAdmin and I am not looking for a flame war. I would like to point out Drupal community efforts (including myself) to write down the most frequent problems when porting MySQL

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread François Pérou
Thanks for your answers. To speak frankly: * I wrote the Drupal guide for porting from MySQL to PostgreSQL. * I am also the author of remarks about people should use PostgreSQL to write portable SQL. * I am very surprised by the SQL level of Php developers. The example Drupal developers

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Robert Haas
2010/3/5 François Pérou francois.pe...@free.fr: * I am very surprised by the SQL level of Php developers. The example Drupal developers trying to rewrite SQL queries dynamically adding DISTINCT clause is just an example. So don't expect them to understand the difference between MySQL and

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Andrew Dunstan
François Pérou wrote: I believe that PostgreSQL should support more MySQLisms in order to BEAT MySQL. Our aim is not to beat MySQL. At least mine is not, and I don't think I'm alone. Many of the MySQLisms you want supported are just broken behaviour, in the view of many people. So

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Alastair Turner
2010/3/5 François Pérou francois.pe...@free.fr: Thanks for your answers. To speak frankly: * I wrote the Drupal guide for porting from MySQL to PostgreSQL. * I am also the author of remarks about people should use PostgreSQL to write portable SQL. * I am very surprised by the SQL level

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Jaime Casanova
2010/3/5 François Pérou francois.pe...@free.fr: I believe that PostgreSQL should support more MySQLisms in order to BEAT MySQL. we BEAT mysql long ago... to make postgres as broken as mysql is not an improve... Feel free to use my guide on Drupal website. We have to adapt tools to people,

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Joshua D. Drake
On Fri, 2010-03-05 at 12:42 -0500, Robert Haas wrote: 2010/3/5 François Pérou francois.pe...@free.fr: * I am very surprised by the SQL level of Php developers. The example Drupal developers trying to rewrite SQL queries dynamically adding DISTINCT clause is just an example. So don't expect

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Robert Haas
On Fri, Mar 5, 2010 at 9:55 AM, Dave Page dp...@pgadmin.org wrote: 2010/3/5 François Pérou francois.pe...@free.fr: Dear friends, As a reminder, I took part in the development of pgAdmin and I am not looking for a flame war. What did you work on François? I can't find your name in my email

Re: [HACKERS] machine-readable pg_controldata?

2010-03-05 Thread Greg Smith
Heikki Linnakangas wrote: Then again, if you don't use the copy in shared memory but just open the pg_control file and read it in the UDF, you could implement this as a pgfoundry module that works with older versions too. This is the direction I'd prefer to see this go in a 9.0 context.

Re: [HACKERS] machine-readable pg_controldata?

2010-03-05 Thread Josh Berkus
On 3/5/10 10:28 AM, Greg Smith wrote: I would rather have the ability to tweak on this for a few months to get everything right, while being able to expose regular updates outside of core, than to commit this is the best we've got so far just under the wire for 9.0 without necessarily enough

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Josh Berkus
All, Given that Francois seems to return to this list every 3 months with the exact same set of requests, I think we need to make a habit of ignoring him the way we used to ignore Al Dev (although I'll comment that Al Dev was *much* more entertaining). Several members of our community are

[HACKERS] arithmetic about inet

2010-03-05 Thread fanng yuan
Hi Guys: I just do some research on ip address storage and comparing. I found pgsql already fixed that issue. I want to get some point from your guys about how this work. Could you give me some data about that . Also I'm interesting in pgsql . Could you give me some suggestion about how to hack

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Robert Haas
On Fri, Mar 5, 2010 at 1:48 PM, Josh Berkus j...@agliodbs.com wrote: Given that Francois seems to return to this list every 3 months with the exact same set of requests, I think we need to make a habit of ignoring him the way we used to ignore Al Dev (although I'll comment that Al Dev was

Re: [HACKERS] machine-readable pg_controldata?

2010-03-05 Thread Greg Smith
Josh Berkus wrote: Oh, I wasn't proposing doing *anything* for 9.0. I wanted to get something on the TODO list for 9.1. As far as I'm concerned, 9.0 is closed to new ideas. We have enough bugs to fix as it is. I didn't get that initially from how you characterized this as past time to

Re: [HACKERS] machine-readable pg_controldata?

2010-03-05 Thread Josh Berkus
I didn't get that initially from how you characterized this as past time to add. It's at http://wiki.postgresql.org/wiki/Todo#Point-In-Time_Recovery_.28PITR.29 now. Sorry for not being clear. I took it for granted that since it's past 2/15, no non-critical patches would be even considered.

Re: [HACKERS] arithmetic about inet

2010-03-05 Thread Robert Haas
On Thu, Mar 4, 2010 at 4:36 AM, fanng yuan fanngy...@gmail.com wrote: Hi Guys: I just do some research on ip address storage and comparing. I found pgsql already fixed that issue. I want to get some point from your guys about how this work. Could you give me some data about that . Also I'm

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread David Fetter
On Fri, Mar 05, 2010 at 02:56:23PM +0100, François Pérou wrote: Dear friends, As a reminder, I took part in the development of pgAdmin and I am not looking for a flame war. You're doing a poor job on that latter. You asked before for the PostgreSQL project to address the concerns of some,

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Andrew Dunstan
David Fetter wrote: On Fri, Mar 05, 2010 at 02:56:23PM +0100, François Pérou wrote: Dear friends, As a reminder, I took part in the development of pgAdmin and I am not looking for a flame war. You're doing a poor job on that latter. You asked before for the PostgreSQL project to

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Joshua D. Drake
On Fri, 2010-03-05 at 15:10 -0500, Andrew Dunstan wrote: David Fetter wrote: On Fri, Mar 05, 2010 at 02:56:23PM +0100, François Pérou wrote: Dear friends, As a reminder, I took part in the development of pgAdmin and I am not looking for a flame war. You're doing a poor

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread David Fetter
On Fri, Mar 05, 2010 at 03:10:59PM -0500, Andrew Dunstan wrote: David Fetter wrote: On Fri, Mar 05, 2010 at 02:56:23PM +0100, François Pérou wrote: Dear friends, As a reminder, I took part in the development of pgAdmin and I am not looking for a flame war. You're doing a poor job on

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Dave Page
On Fri, Mar 5, 2010 at 6:25 PM, Robert Haas robertmh...@gmail.com wrote: On Fri, Mar 5, 2010 at 9:55 AM, Dave Page dp...@pgadmin.org wrote: 2010/3/5 François Pérou francois.pe...@free.fr: Dear friends, As a reminder, I took part in the development of pgAdmin and I am not looking for a flame

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Robert Haas
On Fri, Mar 5, 2010 at 3:30 PM, Dave Page dp...@pgadmin.org wrote: On Fri, Mar 5, 2010 at 6:25 PM, Robert Haas robertmh...@gmail.com wrote: On Fri, Mar 5, 2010 at 9:55 AM, Dave Page dp...@pgadmin.org wrote: 2010/3/5 François Pérou francois.pe...@free.fr: Dear friends, As a reminder, I took

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread Chris Browne
francois.pe...@free.fr (François Pérou) writes: * I am very surprised by the SQL level of Php developers. The example Drupal developers trying to rewrite SQL queries dynamically adding DISTINCT clause is just an example. So don't expect them to understand the difference between MySQL and

Re: [HACKERS] SQL compatibility reminder: MySQL vs PostgreSQL

2010-03-05 Thread François Pérou
Le vendredi 05 mars 2010 à 15:40 -0500, Robert Haas a écrit : having said that, asking us to make changes that are not based on solid technical arguments, don't conform to the SQL standard, and most important that we already clearly said we were not going to make is not the way to get there.

Re: [HACKERS] machine-readable pg_controldata?

2010-03-05 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Greg Smith wrote: 1) How do you handle the situation where the pg_controldata is invalid? If the data in pg_control are invalid, the database won't start up, so by the time you're running the user-defined-functions the data

Re: [HACKERS] Visual Studio 2005, C-language function - avoiding hacks?

2010-03-05 Thread Kevin Flanagan
Ok, that got me on the right track, thanks. I think the key points for this build scenario are these: 1. you have to define the symbol BUILDING_DLL in your code before including postgres.h (as that then means PGDLLIMPORT gets defined right in pg_config_os.h). That makes the 'inconsistent dll

Re: [HACKERS] machine-readable pg_controldata?

2010-03-05 Thread Josh Berkus
(FWIW, my recollection of the original design intention for pg_controldata was that it was meant as a troubleshooting tool if the database wouldn't start up. I'm somewhat bemused to hear that people are trying to use it as part of production scripts. It wasn't meant to produce