Re: [GENERAL] pg_dump on local Windows, pg_restore on Linux?

2007-08-15 Thread Phoenix Kiula
> At least on a *nix system, collation is based on the value of the LC_ALL > environment variable at dbinit time. There's nothing you can do about > it in a live database. IMO that's a little awkward, and is what finally > made me change the global from ISO-8859-1 to UTF-8 on my three Gentoo > Linu

Re: [GENERAL] Best practice for: ERROR: invalid byte sequence for encoding "UTF8"

2007-08-15 Thread Phoenix Kiula
On 16/08/07, Phoenix Kiula <[EMAIL PROTECTED]> wrote: > On 16/08/07, Ben <[EMAIL PROTECTED]> wrote: > > On Thu, 16 Aug 2007, Phoenix Kiula wrote: > > > > > I am not advocating what others should do. But I know what I need my > > > DB to do. I

Re: [GENERAL] Best practice for: ERROR: invalid byte sequence for encoding "UTF8"

2007-08-15 Thread Phoenix Kiula
On 16/08/07, Ben <[EMAIL PROTECTED]> wrote: > On Thu, 16 Aug 2007, Phoenix Kiula wrote: > > > I am not advocating what others should do. But I know what I need my > > DB to do. If I want it to store data that does not match puritanical > > standards of textual stora

Re: [GENERAL] pg_dump on local Windows, pg_restore on Linux?

2007-08-15 Thread Phoenix Kiula
On 16/08/07, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On 8/15/07, Phoenix Kiula <[EMAIL PROTECTED]> wrote: > > Couple of questions with porting: > > > > 1. I have been playing around with my databases locally on Win XP so > > as not to hurt our websit

Re: [GENERAL] Best practice for: ERROR: invalid byte sequence for encoding "UTF8"

2007-08-15 Thread Phoenix Kiula
> What, exactly, does that mean? > > That PostgreSQL should take things in invalid utf-8 format and just store > them? > Or that PostgreSQL should autoconvert from invalid utf-8 to valid > utf-8, guessing the proper codes? > > Seriously, what do you want pgsql to do with these invalid inputs? PG

[GENERAL] pg_dump on local Windows, pg_restore on Linux?

2007-08-15 Thread Phoenix Kiula
Couple of questions with porting: 1. I have been playing around with my databases locally on Win XP so as not to hurt our website traffic. Now I would like to move the database to a Linux CentOS server. Can I use pg_dump on Windows and pg_restore it on Linux? If so, any tips on what I should keep

Re: [GENERAL] Best practice for: ERROR: invalid byte sequence for encoding "UTF8"

2007-08-15 Thread Phoenix Kiula
On 15/08/07, Ivan Zolotukhin <[EMAIL PROTECTED]> wrote: > Hello, > > Actually I tried smth like $str = @iconv("UTF-8", "UTF-8//IGNORE", > $str); when preparing string for SQL query and it worked. There's > probably a better way in PHP to achieve this: simply change default > values in php.ini for t

Re: [GENERAL] Customizing psql console to show execution times

2007-08-15 Thread Phoenix Kiula
> I think you're looking for the \timing command? > http://www.postgresql.org/docs/8.2/static/app-psql.html > (under meta-commands, about halfway down the page) Thanks everyone. "\timing" it is! Happy camper. ---(end of broadcast)--- TIP 5: don't

Re: [GENERAL] Yet Another COUNT(*)...WHERE...question

2007-08-15 Thread Phoenix Kiula
> Yes, optimization. :) You don't need an exact count to tell someone > that there's more data and they can go to it. In general, I agree. But my example of Amazon was only to illustrate the point about two queries and why they may be needed. I seem to see many more pages than you do, but in any

Re: [GENERAL] Yet Another COUNT(*)...WHERE...question

2007-08-15 Thread Phoenix Kiula
On 15/08/07, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On 8/15/07, Phoenix Kiula <[EMAIL PROTECTED]> wrote: > > On 15/08/07, Gregory Stark <[EMAIL PROTECTED]> wrote: > > > "Phoenix Kiula" <[EMAIL PROTECTED]> writes: > > > > > >

[GENERAL] Customizing psql console to show execution times

2007-08-15 Thread Phoenix Kiula
In some examples posted to this forum, it seems to me that when people execute queries in the psql window, they also see "90 ms taken" (milliseconds), which denotes the time taken to execute the query. Where can I set this option because I'm not seeing it in my psql window on both Win XP and Linux.

Re: [GENERAL] Yet Another COUNT(*)...WHERE...question

2007-08-15 Thread Phoenix Kiula
On 15/08/07, Gregory Stark <[EMAIL PROTECTED]> wrote: > "Phoenix Kiula" <[EMAIL PROTECTED]> writes: > > > I'm grappling with a lot of reporting code for our app that relies on > > queries such as: > > > > SELECT COUNT(*) FROM TABL

[GENERAL] Yet Another COUNT(*)...WHERE...question

2007-08-15 Thread Phoenix Kiula
I'm grappling with a lot of reporting code for our app that relies on queries such as: SELECT COUNT(*) FROM TABLE WHERE (conditions)... And I still do not find, from the discussions on this thread, any truly viable solution for this. The one suggestion is to have a separate counts table,

Re: [GENERAL] Compound Indexes

2007-08-15 Thread Phoenix Kiula
> you do a lot of queries like that and the id,s_id restriction isn't very > selective you might look into tsearch2 which can index that type of query. > Thanks. Does tsearch2 come installed with 8.2.3? I am not techie enough to do all the compiling stuff so I'm hoping it does! How can I check?

Re: [GENERAL] Best practice for: ERROR: invalid byte sequence for encoding "UTF8"

2007-08-15 Thread Phoenix Kiula
On 15/08/07, Ivan Zolotukhin <[EMAIL PROTECTED]> wrote: > Hello, > > Imagine a web application that process text search queries from > clients. If one types a text search query in a browser it then sends > proper UTF-8 characters and application after all needed processing > (escaping, checks, etc)

Re: [GENERAL] Compound Indexes

2007-08-14 Thread Phoenix Kiula
On 15/08/07, Chris Browne <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] ("Phoenix Kiula") writes: > > I have a table with ten columns. My queries basically one column as > > the first WHERE condition, so an index on that column is certain. But > > the columns

[GENERAL] Compound Indexes

2007-08-14 Thread Phoenix Kiula
I have a table with ten columns. My queries basically one column as the first WHERE condition, so an index on that column is certain. But the columns after that one vary depending on end-user's choice (this is a reporting application) and so does the sorting order. In MySQL world, I had sort_buffe

Re: [GENERAL] Moving to postgresql and some ignorant questions

2007-08-14 Thread Phoenix Kiula
> You could do this with savepoints which are a kind of sub-transaction inside a > "bigger" transaction. > > e.g.: > BEGIN TRANSACTION; > > SAVEPOINT sp1; > UPDATE1; > IF (failed) rollback to savepoint sp1; > > SAVEPOINT sp1; > UPDATE2; > IF (failed) rollback to savepoint sp2; Thanks Thomas, thi

Re: [GENERAL] Moving to postgresql and some ignorant questions

2007-08-14 Thread Phoenix Kiula
> If you issue a BEGIN then nothing gets committed until you issue a COMMIT. If > anything happens in the meantime then everything you've done since the BEGIN > disappears. > There are some cases where I would like to bunch queries into a transaction purely for speed purposes, but they're not in

Re: [GENERAL] Moving to postgresql and some ignorant questions

2007-08-14 Thread Phoenix Kiula
> You're confusing CHECK constraints and FOREIGN KEY constraints. They're > different things ;) > > CHECK constraints verify that data in a certain column matches a certain > condition. I'm not sure they can reference columns in other tables, > unless you wrap those checks in stored procedures mayb

Re: [GENERAL] Moving to postgresql and some ignorant questions

2007-08-14 Thread Phoenix Kiula
Thank you AM. Very useful note, must appreciate the info you shared. About COPY, I have two simple questions: 1. Is there anything like an ALTER DATABASE command? I would like to change the character set without having to recreate the DATABASE again! 2. Also, when I do a mysqldump I seem to be e

Re: [GENERAL] Moving to postgresql and some ignorant questions

2007-08-14 Thread Phoenix Kiula
On 14/08/07, Gregory Stark <[EMAIL PROTECTED]> wrote: > "Phoenix Kiula" <[EMAIL PROTECTED]> writes: > > > Though other threads I have learned that multiple inserts or updates > > can be sped up with: > > > > [QUOTE] > > - BEGIN TRA

[GENERAL] Moving to postgresql and some ignorant questions

2007-08-14 Thread Phoenix Kiula
I have been a long time user of mysql. Switching to Postgresql because the true features included in 5.1 (as of this moment) are nothing to write home about. The InnoDB stuff is highly advocated but it has its own set of issues, and when one looks at things like backup/restore etc, it is clearly ta

<    1   2   3   4