Re: [GENERAL] ts_headline

2008-02-22 Thread Stephen Davies
Not quite:-( It is the ts_headline with the explicit english configuration that fails rather than the implicit simple. That's what is so weird. As you say, the ts_vector has databas so the english version of ts_headline should work - but it doesn't. The simple version does; despite the

Re: [GENERAL] ts_headline

2008-02-22 Thread Richard Huxton
Stephen Davies wrote: OK. The first level explanation is that my default config is simple. Aha! Actually, that's the whole explanation. This explains the different query results as english reduces database to databas while simple does not reduce it at all. Exactly. The document is

Re: [GENERAL] ts_headline

2008-02-22 Thread Richard Huxton
Stephen Davies wrote: Not quite:-( It is the ts_headline with the explicit english configuration that fails rather than the implicit simple. Hmm... arse. That's what is so weird. As you say, the ts_vector has databas so the english version of ts_headline should work - but it doesn't. The

Re: [GENERAL] Querying the schema for column widths - what syntax do I use?

2008-02-22 Thread Tino Wildenhain
Hi Howard, Howard Wilkinson wrote: I am working on some upgrades to the MyDNS open source product. I have some expertise in MySQL but am not overly familiar with PostgreSQL and need some guidance on how to query the schema for the maximum size of data a column can hold. In MySQL I can do

Re: [GENERAL] ts_headline

2008-02-22 Thread Richard Huxton
Stephen Davies wrote: Unfortunately, my link to the box with the test database is down due to lack of maintenance by our local telco (Telstra) but I think that I also missed the optional config arg to ts_headline. The lack of link also means that I cannot confirm your findings but your logic

Re: [GENERAL] ts_headline

2008-02-22 Thread Stephen Davies
Unfortunately, my link to the box with the test database is down due to lack of maintenance by our local telco (Telstra) but I think that I also missed the optional config arg to ts_headline. The lack of link also means that I cannot confirm your findings but your logic looks good. It begs

Re: [GENERAL] selective backup and restore

2008-02-22 Thread Tino Wildenhain
Hi, [EMAIL PROTECTED] wrote: Hi All. Is it possible in postgreSQL 8.2.4, using pg_dump.exe, make a backup/restore conditioned to the key of some tables (respecting existing constraints)? You can either use the -t option or with a full backup in custom format you can pick a few objects

[GENERAL] Selecting large objects stored as bytea

2008-02-22 Thread Ludger Zachewitz
Hello, I have the following problem accessing postgres (version: 8.2.X) from java 1.6_03 using driver (currently version: postgresql-8.2-508.jdbc4.jar) and hope someone can help me. I have created an table 'files' with the columns 'file_id', 'filename' and 'file_content'. 'file_content'is of

Re: [GENERAL] Selecting large objects stored as bytea

2008-02-22 Thread Richard Huxton
Ludger Zachewitz wrote: Hello, I have the following problem accessing postgres (version: 8.2.X) from java 1.6_03 using driver (currently version: postgresql-8.2-508.jdbc4.jar) and hope someone can help me. I have created an table 'files' with the columns 'file_id', 'filename' and

Re: [GENERAL] Querying the schema for column widths - what syntax do I use?

2008-02-22 Thread Howard Wilkinson
Tino Wildenhain wrote: Hi Howard, Howard Wilkinson wrote: I am working on some upgrades to the MyDNS open source product. I have some expertise in MySQL but am not overly familiar with PostgreSQL and need some guidance on how to query the schema for the maximum size of data a column can

Re: [GENERAL] PostgreSQL 8.3.0 RPMs are available for download

2008-02-22 Thread Jorge Godoy
Em Thursday 21 February 2008 14:33:03 Julio Cesar Leiva escreveu: I found the RPMs for postgresql8.3 suse here http://software.opensuse.org/search just type postgresql and choose your O.S But then, there are no PL and contrib and whatever packages to go with it. It is still just the client

Re: [GENERAL] need some help on figuring out how to write a query

2008-02-22 Thread Jorge Godoy
Em Thursday 21 February 2008 18:37:47 Justin escreveu: Now i could write a function to do this or do it in C++ program that creates query with all kinds of unions. I'm wondering if there is a way to create this in a single select statement?? I can't think of a way to do it??? Why you need

Re: [GENERAL] ts_headline

2008-02-22 Thread Oleg Bartunov
On Fri, 22 Feb 2008, Stephen Davies wrote: H! I think I now understand the ts position better, thank you. Part of my problem has been that I am used to the functionality of Open Text's LCS (aka BASIS) product which handles text differently. It includes the position (and context)

Re: [GENERAL] ts_headline

2008-02-22 Thread Stephen Davies
H! I think I now understand the ts position better, thank you. Part of my problem has been that I am used to the functionality of Open Text's LCS (aka BASIS) product which handles text differently. It includes the position (and context) information in the index and does remember how the

[GENERAL] configure build flags

2008-02-22 Thread luca . ciciriello
'!!! www.grandinettisport.com Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7509d=20080222

[GENERAL] current_query pg_stat_activity column

2008-02-22 Thread Carlos H. Reimer
Hi, I´ve noticed in my Fedora Core 6 box running PG 8.2.3 that column current_query of pg_stat_activity view is not showing the complete query. The complete query: _ SELECT INT.DESMAT, INT.ESPMAT,

Re: [GENERAL] Unique indicies

2008-02-22 Thread Dot Yet
that would mean Every row in foo for column f1 has to be unique and Every row in foo for column f2 has to be unique Say for example: create table test1 ( a int, b int ) ; create unique index idx_t1_a on test1(a) ; create unique index idx_t1_b on test1(b) ; insert into test1 values (1,1) ; --

Re: [GENERAL] Unique indicies

2008-02-22 Thread Tom Lane
Naz Gassiep [EMAIL PROTECTED] writes: If you have an index like this: CREATE UNIQUE INDEX foo ON tablename (f1, f2); Is there any value in having independent indicies on f1 and f2 as well or are they unnecessary? See http://www.postgresql.org/docs/8.3/static/indexes.html particularly

Re: [GENERAL] Mac ordering with locales

2008-02-22 Thread Martijn van Oosterhout
On Thu, Feb 21, 2008 at 11:14:58AM -0800, Jeff Davis wrote: I have looked for a standard related to the locale behavior and I was surprised that I couldn't find one. Is a given locale, e.g. en_US, supposed to have identical behavior on any platform for which it's available? If there is a

Re: [GENERAL] Function parameters change when update to 8.3

2008-02-22 Thread Tom Lane
tuanhoanganh [EMAIL PROTECTED] writes: I write script in Query of pgAdminIII ... In functions, I have a new function test. But when I choose CREATE script with function test the script change to -- Function: test(ud_stt_rec(24)) -- DROP FUNCTION test(ud_stt_rec(24)); CREATE OR REPLACE

Re: [GENERAL] configure build flags

2008-02-22 Thread Andrew Sullivan
On Fri, Feb 22, 2008 at 03:29:31PM +0100, [EMAIL PROTECTED] wrote: Hi All. nbsp;Anyone knows if rebuilding the postgresql sources with the flag --without-tcl --without-perl in ./configure filecan prevent the correct use of the triggers wrote in plpgsql language? PL/pgSQL has nothing to do

Re: [GENERAL] current_query pg_stat_activity column

2008-02-22 Thread Andrew Sullivan
On Fri, Feb 22, 2008 at 11:50:51AM -0300, Carlos H. Reimer wrote: Hi, I´ve noticed in my Fedora Core 6 box running PG 8.2.3 that column current_query of pg_stat_activity view is not showing the complete query. Yeah, it can't show very long queries. I forget what the length restriction is,

Re: [GENERAL] text and bytea

2008-02-22 Thread Martijn van Oosterhout
On Thu, Feb 21, 2008 at 02:34:15PM -0200, hernan gonzalez wrote: (After dealing a while with this, and learning a little, I though of post this as comment in the docs, but perhaps someone who knows better can correct or clarify) It seems to me that postgres is trying to do as you suggest: text

Re: [GENERAL] Unique indicies

2008-02-22 Thread Erik Jones
On Feb 22, 2008, at 8:38 AM, Dot Yet wrote: that would mean Every row in foo for column f1 has to be unique and Every row in foo for column f2 has to be unique The OP was asking about maintaining normal indexes on each in addition to the unique index on (f1, f2), not separate unique

Re: [GENERAL] Mac ordering with locales

2008-02-22 Thread A.M.
On Feb 22, 2008, at 10:16 AM, Martijn van Oosterhout wrote: On Thu, Feb 21, 2008 at 11:14:58AM -0800, Jeff Davis wrote: I have looked for a standard related to the locale behavior and I was surprised that I couldn't find one. Is a given locale, e.g. en_US, supposed to have identical behavior

Re: [GENERAL] Querying the schema for column widths - what syntax do I use?

2008-02-22 Thread Martijn van Oosterhout
On Fri, Feb 22, 2008 at 11:38:33AM +, Howard Wilkinson wrote: The package is a DNS server originally hosted on top of a MySQL data base. I am extending it in a number of ways, but this particular need arises as I need to store some data (binary in nature) in a field that is part of the

Re: [GENERAL] Selecting large objects stored as bytea

2008-02-22 Thread Daniel Verite
Ludger Zachewitz wrote: 'ResultSet rs = statement.executeQuery(selectClause);' After increase of HEAP in java it works, but also the java needs much memory, as I don't expect it. I have also tried to substitute this command line by prepared-statement like 'PreparedStatement ps =

[GENERAL] Function problem

2008-02-22 Thread Enrico
Hi all, I have this piece of code DECLARE minv my_inv; r record; totale numeric(20,5); valore numeric(20,5); BEGIN [.] totale := 0; for r in select * from tminv loop [.] valore := r.prezzo*r.giacenza; totale := totale+valore;

Re: [GENERAL] need some help on figuring out how to write a query

2008-02-22 Thread Justin
I'm not after small code i'm after maintainable code where the date range for this report would be always changing. So if i can get it to one select statement i would on have to pass in some variables and it would create the moving average. Plus what if the sales people decide they want to

[GENERAL] Understanding ps -ef command column

2008-02-22 Thread David Jaquay
When I do a ps -ef, in the command column, I see: postgres: postgres dbname 10.170.1.60(57413) idle I get all of this, except the 57413. What does this mean, and more importantly, how can I tie that number back to a connection that I've acquired via JDBC? In my case, I've got a connection

[GENERAL] /var/lib/postgres on Hitachi E5K160 60 GByte (Raid-1 + Hotfix)

2008-02-22 Thread Michelle Konzack
Hello, I am building a new small PostgreSQL Server for my Solar-Powered Mobil- Office based on a Mini-ITX VIA EPIA LN1EAG with 1 GByte of memory where the OS (Debian GNU/Linux) is in three Hitachi TravelStar 20 GByte (in a Raid-1 + Hotfix). I am normaly working alone, but maybe the server

Re: [GENERAL] Understanding ps -ef command column

2008-02-22 Thread Douglas McNaught
On 2/22/08, David Jaquay [EMAIL PROTECTED] wrote: When I do a ps -ef, in the command column, I see: postgres: postgres dbname 10.170.1.60(57413) idle I get all of this, except the 57413. What does this mean, and more importantly, how can I tie that number back to a connection that I've

Re: [GENERAL] text and bytea

2008-02-22 Thread Alvaro Herrera
Martijn van Oosterhout escribió: The most surprising this is that to_ascii won't accept a bytea. TBH the whole to_ascii function seems somewhat half-baked. If what you're trying to do is remove accents, there are perl functions around that do that. Basically, the switch to a different normal

Re: [GENERAL] Understanding ps -ef command column

2008-02-22 Thread David Jaquay
Yeah, kinda guessed that. So there's no way (that you know of) to, say, cast my JDBC connection object to something Postgresql'y and peer into its internals? Thanks, Dave On Fri, Feb 22, 2008 at 11:28 AM, Douglas McNaught [EMAIL PROTECTED] wrote: On 2/22/08, David Jaquay [EMAIL PROTECTED]

Re: [GENERAL] Function problem

2008-02-22 Thread Tom Lane
Enrico [EMAIL PROTECTED] writes: the first record has valore=98 and totale=0 for the first time of the loop, but my first result of totale is -298 instead of +98. Hmm, that's a bit hard to believe. Could we see the whole example not just a fragment? Usually, when you can't understand the

Re: [GENERAL] Understanding ps -ef command column

2008-02-22 Thread David Jaquay
On the one hand, that's pretty cool. I keep forgetting that's out there. On the other hand, I know what process is holding the connection; it's the only one on the box connecting to that server. So lsof doesn't let me connect a process on the server to a connection object (one of many) on the

Re: [GENERAL] Function problem

2008-02-22 Thread Enrico
On Fri, 22 Feb 2008 11:51:01 -0500 Tom Lane [EMAIL PROTECTED] wrote: Enrico [EMAIL PROTECTED] writes: the first record has valore=98 and totale=0 for the first time of the loop, but my first result of totale is -298 instead of +98. Hmm, that's a bit hard to believe. Yes you right, it's

Re: [GENERAL] Understanding ps -ef command column

2008-02-22 Thread Erik Jones
On Feb 22, 2008, at 10:28 AM, Douglas McNaught wrote: On 2/22/08, David Jaquay [EMAIL PROTECTED] wrote: When I do a ps -ef, in the command column, I see: postgres: postgres dbname 10.170.1.60(57413) idle I get all of this, except the 57413. What does this mean, and more importantly, how

Re: [GENERAL] Function problem

2008-02-22 Thread brian
Enrico wrote: Hi all, I have this piece of code DECLARE minv my_inv; r record; totale numeric(20,5); valore numeric(20,5); BEGIN [.] totale := 0; for r in select * from tminv loop [.] valore := r.prezzo*r.giacenza; totale := totale+valore;

[GENERAL] joining on concatonation?

2008-02-22 Thread blackwater dev
I have a query that is driving me nuts. In one table we have data that is split between two columns and I'm trying to pull in all values from another table where that column is represented by one piece of data. Also, all the info in column2 is unique but not in col 1. table1 col1_pfx

Re: [GENERAL] Function problem

2008-02-22 Thread [EMAIL PROTECTED]
I solved my problem :) the problem is in the query that calls my function: select * from calcolo_inventario('26','2008-02-22','05') where giacenza 0 because the resulset has a negative row that doesn't appear on screen Thank you very much to all of you Enrico ---(end

Re: [GENERAL] Selecting large objects stored as bytea

2008-02-22 Thread Tomasz Ostrowski
On Fri, 22 Feb 2008, Daniel Verite wrote: You could use the function below that breaks a bytea value into pieces of 'chunksize' length and returns them as a set of rows. When you do this then make sure that this column has external storage: alter column [column_name] set storage

Re: [GENERAL] Understanding ps -ef command column

2008-02-22 Thread Andrej Ricnik-Bay
On 23/02/2008, David Jaquay [EMAIL PROTECTED] wrote: When I do a ps -ef, in the command column, I see: postgres: postgres dbname 10.170.1.60(57413) idle This doesn't resemble any ps -ef output I've ever seen. What OS is this on, what's the version of ps? Cheers, Andrej

Re: [GENERAL] Understanding ps -ef command column

2008-02-22 Thread Kris Jurka
On Fri, 22 Feb 2008, David Jaquay wrote: In my case, I've got a connection that's hanging around after my code should have closed it, which means almost certainly that I've got problems in my code, but I'd love to be able to get that 57413 number from my jdbc object and write it to my logs to

Re: [GENERAL] Understanding ps -ef command column

2008-02-22 Thread Douglas McNaught
On 2/22/08, David Jaquay [EMAIL PROTECTED] wrote: Yeah, kinda guessed that. So there's no way (that you know of) to, say, cast my JDBC connection object to something Postgresql'y and peer into its internals? The docs and the source code for the PG JDBC driver are freely available. Worst case

Re: [GENERAL] Unique indicies

2008-02-22 Thread Dot Yet
oops yeah... must have read it clearly rgds, dotyet On 2/22/08, Erik Jones [EMAIL PROTECTED] wrote: On Feb 22, 2008, at 8:38 AM, Dot Yet wrote: that would mean Every row in foo for column f1 has to be unique and Every row in foo for column f2 has to be unique The OP was

Re: [GENERAL] PostgreSQL's hashing function?

2008-02-22 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, 22 Feb 2008 16:49:10 -0500 Kynn Jones [EMAIL PROTECTED] wrote: Hi! Does PostgreSQL expose its hash function? I need a fast way to hash a string to a short code using characters in the set [A-Za-z0-9_]. (I'm not sure yet how long this

[GENERAL] PostgreSQL's hashing function?

2008-02-22 Thread Kynn Jones
Hi! Does PostgreSQL expose its hash function? I need a fast way to hash a string to a short code using characters in the set [A-Za-z0-9_]. (I'm not sure yet how long this code needs to be, but I think even something as short as length 2 may be enough.) TIA! Kynn

[GENERAL] Queries w/ computed table names? (eval in Pg?)

2008-02-22 Thread Kynn Jones
Hi. Suppose I have a database that contains a meta table that holds the names of other the tables in the database, keyed by human-readable but longish strings. I would like to write queries that first compute the names of some tables (i.e. by looking them up in meta table), and after that they

Re: [GENERAL] Queries w/ computed table names? (eval in Pg?)

2008-02-22 Thread Jeff Davis
On Fri, 2008-02-22 at 18:40 -0500, Kynn Jones wrote: Hi. Suppose I have a database that contains a meta table that holds the names of other the tables in the database, keyed by human-readable but longish strings. I would like to write queries that first compute the names of some tables (i.e.

Re: [GENERAL] Queries w/ computed table names? (eval in Pg?)

2008-02-22 Thread Steve Atkins
On Feb 22, 2008, at 3:40 PM, Kynn Jones wrote: Hi. Suppose I have a database that contains a meta table that holds the names of other the tables in the database, keyed by human- readable but longish strings. I would like to write queries that first compute the names of some tables (i.e.

Re: [GENERAL] ts_headline

2008-02-22 Thread Stephen Davies
As it turns out, all I needed was in the doco but the key element - the first config arg to ts_headline - was not in any of the examples so I missed it. Would it be possible for ts_headline to work with the pre-parsed ts_vector? I see references to future plans for phrase searching in ts. Is

Re: [GENERAL] PostgreSQL's hashing function?

2008-02-22 Thread Greg Stark
Joshua D. Drake wrote: On Fri, 22 Feb 2008 16:49:10 -0500 Kynn Jones [EMAIL PROTECTED] wrote: Hi! Does PostgreSQL expose its hash function? I need a fast way to hash a string to a short code using characters in the set [A-Za-z0-9_]. Is md5 good enough? :) Probably not. He said