Re: [GENERAL] Queries with Regular Expressions

2006-04-06 Thread Silas Justiniano
'); > > I bet you get back 2, not 1. I don't know if a UTF8 database will > handle this correctly or not. The safest thing to do may be to use > queries like this: > >SELECT field FROM table WHERE field ~* 'ch(a|ã)o'; > > - John D. Burge

[GENERAL] Queries with Regular Expressions

2006-04-06 Thread Silas Justiniano
T field FROM table WHERE field ~* 'chão'; But I just can't make it work correctly using brackets: SELECT field FROM table WHERE field ~* 'ch[aã]o'; It just returns tuples that have 'chao', but not 'chão'. My queries are utf-8 an the

Re: [GENERAL] Insert more than one t-uple in a single sql

2006-02-12 Thread Silas Justiniano
Thank you very much. But what do you think of: select foobar from table where ; if (pgsql_num_rows($result) > 15) show_pages; show_only_15($result); Thank you! ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] What's faster?

2006-02-08 Thread Silas Justiniano
Hello all! I'm performing a query that returns me hundreds of records... but I need cut them in pages that have 15 items! (using PHP) So, is it faster: select blablabal from _complex_query if (count($result) > 15) show_pages; show_only_15_rows($result); or: select count(*) from _comple

Re: [GENERAL] Indexes again

2006-02-02 Thread Silas Justiniano
I know understand. Thank you ;) On 2/2/06, Richard Huxton wrote: > Silas Justiniano wrote: > > Sorry, I'll remake (rewrite? redo? ... bad English :/ ) my question: > > > > I have Books, Authors and Intermediate table. At intermediate I'm > >

[GENERAL] Indexes again

2006-02-02 Thread Silas Justiniano
I need a third index to not allow duplicated data in my table: CREATE UNIQUE INDEX blablabla ON Intermediate(author_id, book_id); I'd like to know if, using the third index I can delete one of the first. Maybe both? Thank you! Bye! -- Silas Justiniano - Brazil ---

[GENERAL] Indexes

2006-01-29 Thread Silas Justiniano
Silas Justiniano Jan 17, 5:53 pm show options Newsgroups: pgsql.general From: "Silas Justiniano" <[EMAIL PROTECTED]> - Find messages by this author Date: 17 Jan 2006 11:53:37 -0800 Local: Tues, Jan 17 2006 5:53 pm Subject: Indexes Reply | Reply to Author | Forward | Pr

[GENERAL] Indexes

2006-01-19 Thread Silas Justiniano
Another little doubt: I've already asked that in #postgresql at freenode, but I didn't understand well. I have two tables: Books - book_id - name Authors - author_id - name One book can have many authors and one author can have many books. To make that possible, I need a third table: Intermed

[GENERAL] Replicating a remote database (backuping)

2006-01-19 Thread Silas Justiniano
Hello all! I was looking for ways to backup my remote database in a local computer. I was talking to #postgresql folks, who said me to try sloty. I tried, but I couldn't make it run (I was following http://gborg.postgresql.org/project/slony1/genpage.php?howto_basic). I have a database that is, f