Re: [GENERAL] Find similar records (compare tsvectors)

2015-03-07 Thread Patrick Dung
Thanks. smlar is fast and quite good.I need find tuning on the search result. On Saturday, March 7, 2015 12:07 AM, Oleg Bartunov wrote: On Fri, Mar 6, 2015 at 5:05 PM, Patrick Dung wrote: > Resend. > > How to quickly compare the similarity of two tsvector? >

Re: [GENERAL] Find similar records (compare tsvectors)

2015-03-06 Thread Patrick Dung
Resend. How to quickly compare the similarity of two tsvector? On Monday, March 2, 2015 11:01 PM, Patrick Dung wrote: Hello, I had a database with articles or attachment stored in bytea format.I also had a trigger: it insert/update the tsv column when a record is added/updated.The

[GENERAL] Find similar records (compare tsvectors)

2015-03-02 Thread Patrick Dung
Hello, I had a database with articles or attachment stored in bytea format.I also had a trigger: it insert/update the tsv column when a record is added/updated.The tsv column had a GIN index.With this setting, I can do very fast keyword search on the tsv. Suppose I had a specific record (id=1000

Re: [GENERAL] Question about gin index not used on a tsv column

2014-09-03 Thread Patrick Dung
-> Index Scan Backward using jobs_2013p_post_timestamp_idx on jobs_2013p (cost=0.42..29754.98 rows=522 width=432) (actual time=13.138..13.138 rows=1 loops=1) Filter: (tsv @@ '''barcod'''::tsquery) Rows Removed by Filter: 1664 To

Re: [GENERAL] Question about gin index not used on a tsv column

2014-09-02 Thread Patrick Dung
most of the time it would be faster than full table scan. Thanks and regards, Patrick On Wednesday, September 3, 2014 3:00 AM, David G Johnston wrote: Patrick Dung-2 wrote > Hello Postgresql users, > > In my setting, I found that sometimes the query does not use the gin index >

[GENERAL] Question about gin index not used on a tsv column

2014-09-02 Thread Patrick Dung
Hello Postgresql users, In my setting, I found that sometimes the query does not use the gin index built for a tsv column. Attached file provide more info (with explain analyze). Thanks and regards, Patrick jobs=> explain analyze SELECT company,industry FROM jobs WHERE tsv @@ to_tsquery('engli

Re: [GENERAL] How to make use of partitioned table for faster query?

2014-08-29 Thread Patrick Dung
sume it is a complete year (Jan-Dec) instead of school year. I thought the data in table partition 2014 can check with the table partition 2014. It do not need to check with other partitions. Same for other partitions. On Saturday, August 30, 2014 12:52 PM, John R Pierce wrote: On 8/29/2014 9

[GENERAL] How to make use of partitioned table for faster query?

2014-08-29 Thread Patrick Dung
Hello Postgresql users, Suppose the table 'attendance' is very large: id bigint student_name varchar late boolean record_timestamp timestamp The table is already partitioned by year (attendance_2012p, attendance_2013p, ...). I would like to count the number of lates by year. Instead of specif

Re: [GENERAL] Is there a function to save schema history internally?

2014-08-29 Thread Patrick Dung
Hi Adrian, Thanks for the info. Thanks and regards, Patrick On Saturday, August 30, 2014 5:28 AM, Adrian Klaver wrote: On 08/29/2014 11:23 AM, Patrick Dung wrote: > Hello Postgresql users, > > Is there a function to save schema history internally? > By keeping the schema hi

[GENERAL] Is there a function to save schema history internally?

2014-08-29 Thread Patrick Dung
Hello Postgresql users, Is there a function to save schema history internally? By keeping the schema history inside the DB, we can keep track of what and when is changed in the schema. While searching google. It seems it is a limitation with the audit trigger: https://wiki.postgresql.org/wiki/A

[GENERAL] Use of 'now' constant datatype in view to take advantage of partitioned table

2014-08-21 Thread Patrick Dung
Hi Postgresql users, I have a master table with two partition table (food_2013p, food_2014p). I found that when I use SELECT + 'now' constant, constraint exclusion works, (it skipped the 2013 partition). EXPLAIN ANALYZE  SELECT *    FROM food  WHERE food.post_timestamp >= ('now'::date - interva

Re: [GENERAL] Use of 'now' constant datatype in view to take advantage of partitioned table

2014-08-21 Thread Patrick Dung
Hi Ken, Thanks for reply. 1. The problem is that using 'now' in VIEW, the resulting VIEW will hard code the current timestamp. It is not dynamic. If I use write the view like this:  WHERE food.post_timestamp >= ('now'::date - interval '1 month')::timestamp without time zone  AND food.post_time

Re: [GENERAL] Use of 'now' constant datatype in view to take advantage of partitioned table

2014-08-21 Thread Patrick Dung
e running 'EXPLAIN ANALYZE select * from v_recent_items' I found that it skipped the partition table food_2013p. Is it a valid work around? Or there is other better or elegant way? Thanks and regards,Patrick On Thursday, August 21, 2014 4:01 PM, Patrick Dung wrote: An update, inspir

Re: [GENERAL] Use of 'now' constant datatype in view to take advantage of partitioned table

2014-08-21 Thread Patrick Dung
_items' I found that it skipped the partition table food_2013p. Is it a valid work around? Or there is other better or elegant way? Thanks and regards, Patrick On Thursday, August 21, 2014 3:21 PM, Patrick Dung wrote: Resent. As I could not see my mail in the mailing list after about

Re: [GENERAL] Use of 'now' constant datatype in view to take advantage of partitioned table

2014-08-21 Thread Patrick Dung
Resent. As I could not see my mail in the mailing list after about two hours. On Thursday, August 21, 2014 1:43 PM, Patrick Dung wrote: Hi Postgresql users, I have a master table with two partition table (food_2013p, food_2014p). I found that when I use SELECT + 'now'

Re: [GENERAL] PostgreSQL on AIX platform

2014-08-13 Thread Patrick Dung
Hi Payal, I haven't tried Postgresql on AIX. This web site provides binary and if you like to build yourself, it provided build instruction too. http://www.perzl.org/aix/ http://www.perzl.org/aix/index.php?n=Main.Instructions Thanks and regards, Patrick On Saturday, August 9, 2014 6:28 AM, Pa

Re: [GENERAL] Trigger function cannot reference field name with capital letter

2014-08-13 Thread Patrick Dung
Thanks all for the help. BTW, letter casing is just a preference. Some people liked to use all small caps, some liked to use all big caps. I sometimes found that mixed case is more meaningful for the filed (eg. serialnumber vs serialNumber) What is your preference or suggestion? On Thursday,

[GENERAL] Trigger function cannot reference field name with capital letter

2014-08-13 Thread Patrick Dung
Hello PGSQL users, I have a field called postTimestamp. The trigger function could not reference it. When I change my field to post_timestamp. I can reference it from the tigger function. Version is 9.3.5. Any comment? < 2014-08-14 00:23:32.717 HKT >ERROR:  post "new" has no field "posttimestam

Re: [GENERAL] Curious question about physical files to store database

2013-11-05 Thread Patrick Dung
On Monday, November 4, 2013 10:09 PM, Albe Laurenz wrote: Patrick Dung wrote: > As I have seen, some database created or pre-allocate large physical files on > the file system to as > the backend of the database tablespace. > > For Postgresql, I have observed that it

[GENERAL] Curious question about physical files to store database

2013-11-02 Thread Patrick Dung
As I have seen, some database created or pre-allocate large physical files on the file system to as the backend of the database tablespace. For Postgresql, I have observed that it created several files in the base and global directory. It may be by design, what is the pros and cons of this beha

Re: [GENERAL] (collation) Building postgresql on FreeBSD, the pros and cons of icu

2013-10-25 Thread Patrick Dung
> >On Friday, October 25, 2013 3:12 PM, Achilleas Mantzios > wrote: >On 23/10/2013 16:44, Tom Lane wrote: >> Patrick Dung writes: >>> By default, FreeBSD ports does not build postgresql with icu >>> (http://www.icu-project.org/). >> Postgres does

Re: [GENERAL] (collation) Building postgresql on FreeBSD, the pros and cons of icu

2013-10-25 Thread Patrick Dung
On Wednesday, October 23, 2013 10:00 PM, Patrick Dung wrote: > On Wednesday, October 23, 2013 9:45 PM, Tom Lane wrote: > Patrick Dung writes: > >  By default, FreeBSD ports does not build postgresql with icu >(http://www.icu-project.org/ > ). > > Postgres doe

Re: [GENERAL] (collation) Building postgresql on FreeBSD, the pros and cons of icu

2013-10-23 Thread Patrick Dung
> On Wednesday, October 23, 2013 9:45 PM, Tom Lane wrote: > Patrick Dung writes: > >  By default, FreeBSD ports does not build postgresql with icu >(http://www.icu-project.org/ > ). > > Postgres does not have any option to use ICU, default or otherwise. > Nor is it

[GENERAL] (collation) Building postgresql on FreeBSD, the pros and cons of icu

2013-10-23 Thread Patrick Dung
Hi all, By default, FreeBSD ports does not build postgresql with icu (http://www.icu-project.org/). Some questions: 1) It is necessary that icu should be used on FreeBSD? I have heard that FreeBSD's locale (glibc) has sorting problem with Postgresql UTF8 DB. reference: http://wiki.postgresql.

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-10-06 Thread Patrick Dung
Noted and thanks. I can see that it should be updated in the devel manual page: http://www.postgresql.org/docs/devel/static/pgupgrade.html Thanks, Patrick From: Bruce Momjian To: Patrick Dung Cc: Stephen Frost ; "pgsql-general@postgresql.org&quo

Re: [GENERAL] the new checksum feature

2013-09-19 Thread Patrick Dung
Hi Torsten, According to Postgresql 9.3 Wiki: http://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.3#Data_Checksums The checksum feature should be enabled during initdb. Regards, Patrick Dung From: Torsten Förtsch To: pgsql-general@postgresql.org

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-14 Thread Patrick Dung
delete the old cluster's data directories by running the script mentioned when pg_upgrade completes. You can also delete the old installation directories (e.g. bin, share). Thanks, Patrick Dung

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-14 Thread Patrick Dung
Oh sorry, it is typo. It should be Igor Neyman. It was 3AM in my timezone and I was sleepy. From: Ivan Voras To: Patrick Dung Cc: Stephen Frost ; "pgsql-general@postgresql.org" ; Tom Lane Sent: Saturday, September 14, 2013 4:08 AM Subject: Re

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-13 Thread Patrick Dung
From: Igor Neyman To: Stephen Frost ; Patrick Dung Cc: "pgsql-general@postgresql.org" ; Ivan Voras ; Tom Lane Sent: Saturday, September 14, 2013 2:14 AM Subject: RE: [GENERAL] Major upgrade of PostgreSQL and MySQL Hi Igor, >> -

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-13 Thread Patrick Dung
From: Stephen Frost To: Patrick Dung Cc: "pgsql-general@postgresql.org" ; Ivan Voras ; Tom Lane Sent: Saturday, September 14, 2013 2:05 AM Subject: Re: [GENERAL] Major upgrade of PostgreSQL and MySQL Hi Stephen, >Patrick, > >* Pat

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-13 Thread Patrick Dung
From: Stephen Frost To: Patrick Dung Cc: "pgsql-general@postgresql.org" ; Ivan Voras ; Tom Lane ; Stephen Frost Sent: Saturday, September 14, 2013 1:13 AM Subject: Re: [GENERAL] Major upgrade of PostgreSQL and MySQL On Friday, September 13, 2013, Patrick Dung wrote: >

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-13 Thread Patrick Dung
From: Thomas Kellerer To: pgsql-general@postgresql.org Sent: Saturday, September 14, 2013 12:27 AM Subject: Re: [GENERAL] Major upgrade of PostgreSQL and MySQL Patrick Dung wrote on 13.09.2013 18:17: >> The problem of pg_upgrade is that it needed t

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-13 Thread Patrick Dung
From: Stephen Frost To: Patrick Dung Cc: "pgsql-general@postgresql.org" ; Ivan Voras ; Tom Lane Sent: Saturday, September 14, 2013 12:43 AM Subject: Re: [GENERAL] Major upgrade of PostgreSQL and MySQL * Patrick Dung (patrick_...@yahoo.com

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-13 Thread Patrick Dung
From: Tom Lane To: Stephen Frost Cc: Ivan Voras ; pgsql-general@postgresql.org Sent: Friday, September 13, 2013 9:58 PM Subject: Re: [GENERAL] Major upgrade of PostgreSQL and MySQL >> * Ivan Voras (ivo...@freebsd.org) wrote: >>> If I read the documentatio

[GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-12 Thread Patrick Dung
While reading some manual of PostgreSQL and MySQL (eg. http://dev.mysql.com/doc/refman/5.1/en/upgrading-from-previous-series.html). I have found that MySQL has stated many incompatibilities and know issues (a long list) in the MySQL version 5.0, 5.1, 5.5, 5.6 and 5.7. For PostgreSQL, it seems I

Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-09-12 Thread Patrick Dung
From: Thomas Kellerer To: pgsql-general@postgresql.org Sent: Friday, September 13, 2013 12:58 AM Subject: Re: [GENERAL] Major upgrade of PostgreSQL and MySQL > There is such a list in the release notes: > >http://www.postgresql.org/docs/current/static/release-9-3.html#AEN114132 >    Version