Re: [GENERAL] Defining character sets for indicidual fields

2008-05-31 Thread Steve Atkins
On May 31, 2008, at 6:22 PM, Ram Ravichandran wrote: Hi, By default, my postgresql server is set to use UTF8 character set. I was wondering if there is any way to make sure that certain fields like url etc. only makes use of ascii. My main aim is to save space by using only 1 byte / char

[GENERAL] Defining character sets for indicidual fields

2008-05-31 Thread Ram Ravichandran
Hi, By default, my postgresql server is set to use UTF8 character set. I was wondering if there is any way to make sure that certain fields like url etc. only makes use of ascii. My main aim is to save space by using only 1 byte / character for urls (some of the urls are over 200 characters long)

Re: [GENERAL] Converting empty input strings to Nulls

2008-05-31 Thread Martin
Hi Ken- Have you looked at encode ? http://www.postgresql.org/docs/8.3/interactive/functions-string.html Anyone else? Martin - Original Message - From: "Ken Winter" <[EMAIL PROTECTED]> To: "PostgreSQL pg-general List" Sent: Saturday, May 31, 2008 1:40 PM Subject: [GENERAL] Converting

Re: [GENERAL] Converting empty input strings to Nulls

2008-05-31 Thread Jeff Davis
On Sat, 2008-05-31 at 13:40 -0400, Ken Winter wrote: > I'm looking for a way to trap this bad input at the database level, quietly > convert the input empty strings to Null, and store the Null in the date > column. I tried a BEFORE INSERT OR UPDATE trigger evoking this function ... You can replac

Re: [GENERAL] Converting empty input strings to Nulls

2008-05-31 Thread Craig Ringer
Pavel Stehule wrote: > Hello > > 2008/5/31 Ken Winter <[EMAIL PROTECTED]>: >> ... but an empty string still evokes the error even before this function is >> triggered. >> >> Is there a way to convert empty strings to Nulls before the error is evoked? >> > no - it's not possible. And some "magic" f

Re: [GENERAL] Converting empty input strings to Nulls

2008-05-31 Thread Pavel Stehule
Hello 2008/5/31 Ken Winter <[EMAIL PROTECTED]>: > Applications accessing my PostgreSQL 8.0 database like to submit no-value > date column values as empty strings rather than as Nulls. This, of course, > causes this PG error: > > SQL State: 22007 > ERROR: invalid input syntax for type date: "" > >

[GENERAL] Converting empty input strings to Nulls

2008-05-31 Thread Ken Winter
Applications accessing my PostgreSQL 8.0 database like to submit no-value date column values as empty strings rather than as Nulls. This, of course, causes this PG error: SQL State: 22007 ERROR: invalid input syntax for type date: "" I'm looking for a way to trap this bad input at the database l

Re: [GENERAL] Mediawiki 1.10 and PG 8.3 upgrade

2008-05-31 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > If upgrading MediaWiki to a version that supports postgres 8.3, > another option could be to export from the old db as XML (using the > Special:Export page) You can also use the dumpBackup.php tool in the maintenance directory. The XML this d

Re: [GENERAL] Mediawiki 1.10 and PG 8.3 upgrade

2008-05-31 Thread Oliver Kohll
If upgrading MediaWiki to a version that supports postgres 8.3, another option could be to export from the old db as XML (using the Special:Export page) then import once the new wiki's installed with a blank database - that's what I'm going to try, I've had problems upgrading MediaWiki data

Re: [GENERAL] cannot use result of (insert .. returning)

2008-05-31 Thread dvs
I need to use query like: ,c from anytable where condition but it say ERROR: syntax error at or near "into" did you try with: select (insert into test (a) values (x) returning b) query_a JOIN c ON ... ? you about select * from (insert into test (a) values (x) returning b) z ? it get t