[GENERAL] Request for help setting up source tree

2012-11-20 Thread r d
Hi,

I want to make an extension but don't understand the source setup well.
a) Do I need the full source of postgres locally?
b) Where must the source be? The project dir is ~/nbprojects/my_pg_ext
 and I am using the code of the fuzzystrmatch contrib as my template
from where to start
c) My installation of postgres is 9.1.6 and I don't intend to upgrade
for now. Can I use an extension compiled against 9.2.x code in my
9.1.6 installation?

I am using the Netbeans IDE but also understand Eclipse.

Thanks for any help/info.

RD


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Request for help setting up source tree

2012-11-20 Thread r d
Ok, that was a stupid question to ask, what comes from falling in panic and
suspending thinking before talking :-(

Solution in case anybody else panics:
a) install the *postgresql-devel* package from yum
b) add the include directory *'/usr/include/pgsql/server'* in your IDE. In
Netbeans 7.3b2 that would be in
Tools - Options - C/C++ - Code Assistance - C Compiler

and suddenly everything works ...

So then :-)

On 20 November 2012 15:51, r d rd0...@gmail.com wrote:

 Hi,

 I want to make an extension but don't understand the source setup well.
 a) Do I need the full source of postgres locally?
 b) Where must the source be? The project dir is ~/nbprojects/my_pg_ext
  and I am using the code of the fuzzystrmatch contrib as my template
 from where to start
 c) My installation of postgres is 9.1.6 and I don't intend to upgrade
 for now. Can I use an extension compiled against 9.2.x code in my
 9.1.6 installation?

 I am using the Netbeans IDE but also understand Eclipse.

 Thanks for any help/info.

 RD



[GENERAL] fuzzystrmatch module buggy? observations

2012-10-30 Thread r d
The fuzzystrmatch module (
http://www.postgresql.org/docs/9.2/static/fuzzystrmatch.html) is currently,
as of 9.2.1, documented with the caution *At present, the soundex,
metaphone, dmetaphone, and dmetaphone_alt functions do not work well with
multibyte encodings (such as UTF-8)*.

While the venerable algorithms contained in the module *seem* to generally
work for Latin strings from European languages which all have
accented/diacritic characters such as äöüñáéíóúàèìòù, for languages with
non-Latin characters such as Kyrillic, Hebrew, Arabic, Chinese, these
venerable algorithms return NULL (empty) or plain weirdness.

Some examples:

dmetaphone ('Новости') = 'NN'
soundex ('Новости') = NULL

dmetaphone ('לפחות') = NULL
soundex ('לפחות') = NULL

soundex ('相关搜索') = NULL
dmetaphone ('相关搜索') = NULL

metaphone() crashes with SQL state: 42883 for all these strings (it tells
me I should cast the 'unknown' input).

The string 'äöüñáéíóúàèìòù' causes metaphone(), dmetaphone(),
dmetaphone_alt, soundex() to fail.

Only levenshtein() appears to function correctly with all above inputs,
even when I let it compare Hebrew against Chinese strings.

Summarizing my experience:
* for english (ASCII equivalent), the module works,
* for the rest of the Latin charsets (equivalent to ISO 8859-x) the module
works unreliably,
* for non-latin chars (UTF8 with 2-4 bytes per char) the module does not
work

Note: My DB and the OS are set up for UTF-8.

This would appear to be less a problem of Postgresql and the fuzzystrmach
module itself but because there
appear to exist no replacement algorithms adequate for a multilingual world
- at least that is my impression
after looking at the IPA and http://www.lt-world.org websites and branching
out from there.

Given all this I have no idea of this is a bug at all or the
state-of-the-art around this topic is inadequate.

Questions (to the developers):
- Is there anything in work or planned for the fuzzystrmatch module?
- Does anybody know about adequate replacements or upgrades of the soundex,
metaphone etc. algorithms from academia?


[GENERAL] Question about PARTIAL DATE type/s

2012-10-07 Thread r d
Hi,

I have text fields which contains dates in the format 'MM' (four
positions for the year, two for the month).
These fields are contained in text files which I load into the DB.

When I convert this field to a date using

to_date(PARTIAL_DATE_FIELD,'MM'); -- (a cast won't recognize
the input as valid)

I still get full dates as an output, for example,
'198801' --- 1988-01*-01*
'196408' --- 1964-08*-01*
and so on, what is wrong in this case because nowhere it is said that I
have the /first/ of that month, the entry just says that the event in
question happened /during/ that month.


*My question:*
Is it possible to define fields which contain partial dates per above? I
found nothing in the manual.


Thanks,

RD


Re: [GENERAL] Question about PARTIAL DATE type/s

2012-10-07 Thread r d
I suspected that this would be the answer.

Thank you lots for your kind help, Daniele  Tom [?]

On 7 October 2012 16:46, Daniele Varrazzo daniele.varra...@gmail.comwrote:

 On Sun, Oct 7, 2012 at 3:03 PM, Tom Lane t...@sss.pgh.pa.us wrote:
  Daniele Varrazzo daniele.varra...@gmail.com writes:
  Note: it exploits to_date() parsing '200013' as '2001-01', which is
  reasonable but haven't found documented and don't know how much
  reliable. Writing a safer one month later function is left as
  exercise.
 
  Consider adding '1 month'::interval to the month start date.
 
  (This function relies on text-munging way too much for my taste.
  There's almost always a better way to do it than that.)

 Didn't realize intervals store months/days info separately: I thought
 an interval was just a vector in the timestamp space. Nice surprise.

 -- Daniele

03D.gif

Re: [GENERAL] what Linux to run

2012-03-05 Thread r d

 If we move to Linux, what is the preferred Linux for running Postgres
 on.  This machine would be dedicated to the database only.=20

 I'd like a recommendation for both a GUI hosted version and a non-GUI
 version.  I haven't used Linux in the past but did spend several year s
 in a mixed Unix and IBM mainframe environment at the console level.


I run PostgreSQL on Fedora Core 16 64bit and have never had problems, now
or before.
From that point of view I can recommend FC, but I don't know how it compares
performance-wise to other distros.

I have been using the FC series since they split from the RedHat Linux
distribs at about RedHat 9,
perhaps 10 years ago and have never missed anything, and seldom noticed
troublesome behavior.
My main criticism of FC is that the distro updates to a new version quite
often, 1-2 times per year,
and upgrades are seldom as smooth as they are supposed/advertised to be,
but they have become
much better.

Beyond that, the FC series have about everything you need for
development or anything else,
like running PG

You can use FC both with GUI and without. It comes by default with GNOME.
It also has
KDE, which looks (and works) similar to Windows. Both Gnome and KDE run
atop X.
FC has the usual Unix shells like bash (default), sh, ksh, csh, tcsh ...
and if you need
to connect to your host, there are several 3270 emulator available, for X
and also text-mode.

Two components which do not mix well with FC are Java 7 (1.7.0x) and Oracle
RDBMS 11g.
For Java, stay with the 1.6 series until the problems of 1.7 are fixed. If
you need to use  the RDBMS
besides PG then FC is not your OS. Instead, look at what systems they
(Oracle) support.

I hope this helps you with your decision.


[GENERAL] Updating 9.0.4 -- 9.1.1: How best to ???

2011-10-02 Thread r d
Hi,

I would like to know which if any is a recommended install and upgrade
method.

My situation is summarized as:

I currently have Postgresql 9.0.4 installed via the Fedora Core FC15 yum
repo, and 9.1.x is not there (yet).

I decided to install the PGDG repo (pgdg-fedora91-9.1-5.noarch) to make it
update. It does not.

The FC15 packages are called postgresql_* and not postgresql90_*, the
PGDG packages are called postgresql91_*.


Since both repositories apparently get into each others way, my question is,
what is the best (recommended) way to update or install postgres:

- Dump my FC15 installation and replace it with one coming from the PGDG
repo?
- Wait for the 9.1 packages to appear in the Fedora Core repo?

I prefer install from repo as there is currently no reason for me to install
from source.

Thanks in advance,

RD