Re: [HACKERS] ruby connect

2009-05-31 Thread Nikhil Sontakke
Hi, I’m trying to connect ruby to postgres on ubuntu and the only link I found that has the library is down. Does anyone have the postgres library for ruby? Or direct me to it? You would be better off searching for the drivers on rubyforge.org. Please do not send non-Postgres-development

Re: [HACKERS] pg_migrator and an 8.3-compatible tsvector data type

2009-05-31 Thread Bruce Momjian
Greg Stark wrote: On Sat, May 30, 2009 at 1:11 PM, Bruce Momjian br...@momjian.us wrote: I have discovered a simpler solution using ALTER TABLE and calling a conversion function: ? ? ? ?test= CREATE TABLE tsvector_test(x tsvector); ? ? ? ?CREATE TABLE ? ? ? ?test= ALTER TABLE

Re: [HACKERS] pg_migrator and an 8.3-compatible tsvector data type

2009-05-31 Thread Bruce Momjian
Bruce Momjian wrote: Tom Lane wrote: Bruce Momjian br...@momjian.us writes: I have discovered a simpler solution using ALTER TABLE and calling a conversion function: test= CREATE TABLE tsvector_test(x tsvector); CREATE TABLE test= ALTER TABLE tsvector_test ALTER COLUMN x

Re: [HACKERS] pg_migrator and an 8.3-compatible tsvector data type

2009-05-31 Thread Greg Stark
On Sun, May 31, 2009 at 3:04 PM, Bruce Momjian br...@momjian.us wrote: I think this is basically a large-caliber foot gun.  You're going to pretend that invalid data is valid, until the user gets around to fixing it? What choice do we have? I think in this case the caliber is pretty small

Re: [HACKERS] information_schema.columns changes needed for OLEDB

2009-05-31 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On Friday 22 May 2009 18:27:01 Konstantin Izmailov wrote: [ discussion of some details of information_schema results ] Are we going to do anything about any of these issues? In particular, 6. datetime_precision field, minor changes Code around:

Re: [HACKERS] Feedback on writing extensible modules

2009-05-31 Thread Tom Lane
Dimitri Fontaine dfonta...@hi-media.com writes: Dimitri Fontaine dfonta...@hi-media.com writes: And currently calling SPI_connect() from _PG_init will crash the backend. I'll try to obtain a gdb backtrace, I've just been told about pre_auth_delay and post_auth_delay parameters. Here we go:

Re: [HACKERS] [BUGS] BUG #4822: xmlattributes encodes '' twice

2009-05-31 Thread Tom Lane
Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp writes: Here is a patch to fix the bug. I added a parameter 'encode' to map_sql_value_to_xml_value() and pass false for xml attributes. One thing I was wondering about, which is sort of highlighted by your patch, is why is there the special

[HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Dunstan
I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, and I'm wondering if we should not have some sort of check for this on startup. Maybe we could check for the existence of the PG_VERSION file

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Stephen Frost
* Andrew Dunstan (and...@dunslane.net) wrote: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, and I'm wondering if we should not have some sort of check for this on startup. Maybe we

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, and I'm wondering if we should not have some sort of check for this on startup. Maybe we could

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, and I'm wondering if we should not have some sort of check for this on startup.

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: Tom Lane wrote: ... and do what? In general, I think I'd probably prefer normal database startup to fail if a tablespace is missing. That way I will know about it right then and can remedy it. This is something that is much more likely to happen

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Dunstan
Tom Lane wrote: So what you're imagining is * iterate through each symlink in $PGDATA/pg_tblspc * check that PG_VERSION exists (and has the right contents??) in each pointed-to directory * fail if not I guess this is reasonable, since we make a similar check for the core data directory

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: I'm not sure about the initdb reference - there won't be any tablespaces to check for during initdb, will there? No, but I think pg_tblspc/ itself might not be there either. Just a case to test your patch on ... regards, tom

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: I'm not sure about the initdb reference - there won't be any tablespaces to check for during initdb, will there? No, but I think pg_tblspc/ itself might not be there either. Just a case to test your patch on ...

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Chernow
Andrew Dunstan wrote: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, Have you uncovered why the tablespace when missing? and I'm wondering if we should not have some sort of check for this

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Chernow
Andrew Dunstan wrote: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, Have you uncovered why the tablespace went missing? and I'm wondering if we should not have some sort of check for this

Re: [HACKERS] dblink patches for comment

2009-05-31 Thread Joe Conway
Tom Lane wrote: It's hard to review it without any docs that say what it's supposed to do. (And you'd need to patch the docs anyway, eh?) Fair enough :-) Probably better if I break this up in logical chunks too. This patch only addresses the refactoring you requested here:

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Dunstan
Andrew Chernow wrote: Andrew Dunstan wrote: I am in the middle of helping a customer recover from a situation where a tablespace was missing when a machine was rebooted and postgres restarted, Have you uncovered why the tablespace went missing? No. It's on a SAN, and I understand our

Re: [HACKERS] Feedback on writing extensible modules

2009-05-31 Thread Dimitri Fontaine
Hi, First, thank you to have taken the time to see about the case. Le 31 mai 09 à 18:21, Tom Lane a écrit : The reason this doesn't work is that SPI can only be invoked inside a transaction, and you're not inside one when a library is being preloaded. Makes sense. Still crashing with basic

Re: [HACKERS] Dtrace probes documentation

2009-05-31 Thread Tom Lane
Joshua Tolley eggyk...@gmail.com writes: On Thu, May 28, 2009 at 06:28:14PM -0400, Tom Lane wrote: Read 26.4.3 and .4. I don't know why they have this bizarre set of conventions, but the single-hyphen version is the spelling most visible to end users. I thought it might be something like

Re: [HACKERS] check for missing tablespaces?

2009-05-31 Thread Andrew Chernow
Anyway, from this POV all we really need to know is that the device hosting this tablespace failed to mount when the machine was rebooted, and then postgres restarted. Good to know postgresql had nothing to do with the missing data. I wasn't sure if it was user error, config problem or

Re: [HACKERS] search_path improvements

2009-05-31 Thread Josh Berkus
Greg, What's the point of namespaces if not to implement visibility? The interesting thing to do would be to hide all the internal foo functions in a foo.* schema and only put the external api in public. That is an interesting idea. However, what our real users are really doing in the field

Re: [HACKERS] pg_migrator and an 8.3-compatible tsvector data type

2009-05-31 Thread Bruce Momjian
Bruce Momjian wrote: Bruce Momjian wrote: Tom Lane wrote: Bruce Momjian br...@momjian.us writes: I have discovered a simpler solution using ALTER TABLE and calling a conversion function: test= CREATE TABLE tsvector_test(x tsvector); CREATE TABLE

Re: [HACKERS] [GENERAL] INTERVAL SECOND limited to 59 seconds?

2009-05-31 Thread Tom Lane
Sebastien FLAESCH s...@4js.com writes: I would expect that an INTERVAL SECOND can store more that 59 seconds. I took a look into the SQL spec and I think that we do indeed have a spec compliance issue here. SQL99 section 4.7 saith Within a value of type interval, the first field is

[HACKERS] Patch: AdjustIntervalForTypmod shouldn't discard high-order data

2009-05-31 Thread Tom Lane
As I mentioned a bit ago http://archives.postgresql.org/pgsql-hackers/2009-05/msg01505.php there seems to be a definite problem still remaining with our handling of interval literals. To wit, this behavior is absolutely not per spec: regression=# select '999'::interval second; interval

Re: [HACKERS] search_path improvements

2009-05-31 Thread Greg Stark
On Sun, May 31, 2009 at 9:12 PM, Josh Berkus j...@agliodbs.com wrote: This assumes that all users should have access to the same public APIs as all other users.  Real applications are more complex. Well the goal is to make them simpler. I don't know any language that has implemented what you

Re: [HACKERS] search_path improvements

2009-05-31 Thread David E. Wheeler
On May 31, 2009, at 3:47 PM, Greg Stark wrote: On Sun, May 31, 2009 at 9:12 PM, Josh Berkus j...@agliodbs.com wrote: This assumes that all users should have access to the same public APIs as all other users. Real applications are more complex. Well the goal is to make them simpler. I

Re: [HACKERS] [GENERAL] INTERVAL data type and libpq - what format?

2009-05-31 Thread Tom Lane
I wrote: In a related example, regression=# select interval '123 11' day; interval -- 134 days (1 row) we seem to be adding the 123 and 11 together. This is, um, surprising behavior ... I'd be inclined to think throwing an error is more appropriate. I looked into

[HACKERS] survey of table blocksize changes

2009-05-31 Thread Mark Wong
Hi all, I ran a few more tests changing the table blocksizes, similar to: http://archives.postgresql.org/pgsql-hackers/2009-05/msg01068.php I did make one change, specifically enable autovacuum, which I had disabled for the previous thread. The WAL blocksize here is using 16KB. Here's the

Re: [HACKERS] dblink patches for comment

2009-05-31 Thread Joe Conway
Tom Lane wrote: It's hard to review it without any docs that say what it's supposed to do. (And you'd need to patch the docs anyway, eh?) Here's a much simpler SQL/MED support patch for dblink. This enforces security in the same manner for FOREIGN SERVER connections as that worked out over

[HACKERS] PostgreSQL 8.4 beta 2 restore error

2009-05-31 Thread Brian Klish
I just downloaded PostgreSQL 8.4 beta 2 and tried to restore my old database from version 8.3. I created a new database with the same name as my old one. Then when I tried to restore the old database I got the error posted below. I'm running Windows 7 RC. I realize that probably isn't

[HACKERS] Win32 link() function

2009-05-31 Thread Bruce Momjian
pg_migrator needs hard link() capabiity on Win32 to support its --link option. Can someone create that and hopefully add it to libpgport? libpgport currently only has symlink capability for Win32. -- Bruce Momjian br...@momjian.ushttp://momjian.us EnterpriseDB

Re: [HACKERS] information_schema.columns changes needed for OLEDB

2009-05-31 Thread Robert Haas
On Sun, May 31, 2009 at 11:41 AM, Tom Lane t...@sss.pgh.pa.us wrote: I'd prefer to avoid a catversion bump at this stage of the cycle, but it looks like any changes here would merely involve the bodies of some functions in information_schema.sql.  I think we could just change them without a

Re: [HACKERS] information_schema.columns changes needed for OLEDB

2009-05-31 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: Is this a regression relative to 8.3? If not, why not leave it for 8.5? No. it's not a regression. What I was concerned about was mainly that it seemed likely to drop off the radar screen without being addressed at all, since most of the other things

Re: [HACKERS] Win32 link() function

2009-05-31 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: pg_migrator needs hard link() capabiity on Win32 to support its --link option. Can someone create that and hopefully add it to libpgport? AFAIK hard links simply don't exist on Windows. regards, tom lane -- Sent via

Re: [HACKERS] Win32 link() function

2009-05-31 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian br...@momjian.us writes: pg_migrator needs hard link() capabiity on Win32 to support its --link option. Can someone create that and hopefully add it to libpgport? AFAIK hard links simply don't exist on Windows. Magnus showed me this:

Re: [HACKERS] Win32 link() function

2009-05-31 Thread Itagaki Takahiro
Bruce Momjian br...@momjian.us wrote: pg_migrator needs hard link() capabiity on Win32 to support its --link option. Can someone create that and hopefully add it to libpgport? libpgport currently only has symlink capability for Win32. Can we use CreateHardLink() ?

Re: [HACKERS] pg_migrator and an 8.3-compatible tsvector data type

2009-05-31 Thread Robert Haas
On Sat, May 30, 2009 at 11:58 PM, Bruce Momjian br...@momjian.us wrote: The way the restore works, you would have to call the data type 'tsvector', and then that oid is linked around in all sort of odd places and you need to change them all, hence confusion. In theory, I think it would be

Re: [HACKERS] Win32 link() function

2009-05-31 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Tom Lane wrote: AFAIK hard links simply don't exist on Windows. Magnus showed me this: http://msdn.microsoft.com/en-us/library/aa363860(VS.85).aspx Hmm, interesting. Are we requiring our DBs to be on NTFS already? What are the implications for

Re: [HACKERS] Win32 link() function

2009-05-31 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: AFAIK hard links simply don't exist on Windows. Magnus showed me this: http://msdn.microsoft.com/en-us/library/aa363860(VS.85).aspx Hmm, interesting. Are we requiring our DBs to be on NTFS already? I think

Re: [HACKERS] pg_migrator and an 8.3-compatible tsvector data type

2009-05-31 Thread Bruce Momjian
Robert Haas wrote: On Sat, May 30, 2009 at 11:58 PM, Bruce Momjian br...@momjian.us wrote: The way the restore works, you would have to call the data type 'tsvector', and then that oid is linked around in all sort of odd places and you need to change them all, hence confusion. In theory,

Re: [HACKERS] pg_migrator and an 8.3-compatible tsvector data type

2009-05-31 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: (At the risk of beating a dead horse, note if we were upgrading the catalog tables directly via SQL, this type of scenario could be handled cleanly without hacking pg_dump; I repeat my earlier critique that the pg_migrator approach consigns us to a

Re: [HACKERS] Win32 link() function

2009-05-31 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Tom Lane wrote: Hmm, interesting. Are we requiring our DBs to be on NTFS already? Oh, yea, we only support tablespaces on Win32 using NTFS. Well, the important point there is that we fail gracefully if you try to use tablespaces when not on NTFS. So

Re: [HACKERS] Win32 link() function

2009-05-31 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: Hmm, interesting. Are we requiring our DBs to be on NTFS already? Oh, yea, we only support tablespaces on Win32 using NTFS. Well, the important point there is that we fail gracefully if you try to use tablespaces

Re: [HACKERS] Win32 link() function

2009-05-31 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Tom Lane wrote: (Come to think of it, --link can fail on Unix too, if the user tries to put the new database on a different filesystem. Have you got guards in there to make sure this is discovered before the point of no return?) Of course: ... though

Re: [HACKERS] Win32 link() function

2009-05-31 Thread Bruce Momjian
Bruce Momjian wrote: Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: AFAIK hard links simply don't exist on Windows. Magnus showed me this: http://msdn.microsoft.com/en-us/library/aa363860(VS.85).aspx Hmm, interesting. Are we requiring our DBs to be

Re: [HACKERS] Win32 link() function

2009-05-31 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: (Come to think of it, --link can fail on Unix too, if the user tries to put the new database on a different filesystem. Have you got guards in there to make sure this is discovered before the point of no return?)

Re: [HACKERS] Win32 link() function

2009-05-31 Thread Bruce Momjian
Bruce Momjian wrote: Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: (Come to think of it, --link can fail on Unix too, if the user tries to put the new database on a different filesystem. Have you got guards in there to make sure this is discovered before

[HACKERS] pg_standby -l might destory the archived file

2009-05-31 Thread Fujii Masao
Hi, pg_standby can use ln command to restore an archived file, which might destroy the archived file as follows. 1) pg_standby creates the symlink to the archived file '102' 2) '102' is applied 3) the next file '103' doesn't exist and the trigger file is created 4) '102' is re-fetched 5) at the