Re: [GENERAL] Replicating PostgreSQL DB to lightweight system

2006-05-02 Thread Leif B. Kristensen
On Wednesday 03 May 2006 04:31, pgdb wrote: >I like to know if I can replicate a PG db to another >lightweight platform like SQLite? The objective is to "push" >updates to remote devices(laptops, PDAs etc) from a central >server, so that the data can be used offline. These devices are >not expecte

Re: [GENERAL] Replicating PostgreSQL DB to lightweight system

2006-05-02 Thread pgdb
David Fetter writes: David Fetter writes: > On Wed, May 03, 2006 at 02:31:19AM +, pgdb wrote: >> Hi, > >> like to know if I can replicate a PG db to another lightweight >> platform like SQLite? The objective is to "push" updates to remote >> devices(laptops, PDAs etc) from a central ser

Re: [GENERAL] Replicating PostgreSQL DB to lightweight system

2006-05-02 Thread David Fetter
On Wed, May 03, 2006 at 02:31:19AM +, pgdb wrote: > Hi, > like to know if I can replicate a PG db to another lightweight > platform like SQLite? The objective is to "push" updates to remote > devices(laptops, PDAs etc) from a central server, so that the data > can be used offline. These devi

Re: [GENERAL] Replicating PostgreSQL DB to lightweight system

2006-05-02 Thread Chris
pgdb wrote: Hi, like to know if I can replicate a PG db to another lightweight platform like SQLite? The objective is to "push" updates to remote devices(laptops, PDAs etc) from a central server, so that the data can be used offline. These devices are not expected to modify any data, access

[GENERAL] Replicating PostgreSQL DB to lightweight system

2006-05-02 Thread pgdb
Hi,   like to know if I can replicate a PG db to another lightweight platform like SQLite? The objective is to "push" updates to remote devices(laptops, PDAs etc) from a central server, so that the data can be used offline. These devices are not expected to modify any data, accessing them thru' t

Re: [GENERAL] Calling V1 function from within the server

2006-05-02 Thread Don Y
Martijn van Oosterhout wrote: On Tue, May 02, 2006 at 11:24:34AM -0700, Don Y wrote: Hi, If I define: Datum barcode_checksum(PG_FUNCTION_ARGS) PG_FUNCTION_INFO_V1(barcode_checksum) and now want to *use* that function within some other (related) function, how can I invoke it? The intuiti

Re: [GENERAL] Locking confusion

2006-05-02 Thread Tom Lane
David J N Begley <[EMAIL PROTECTED]> writes: > My apologies for what may be an obvious answer to others but the documentation > (for v8.1) leaves me concerned (enough not to trust "expected behaviour" of > some commands). You're confusing table-level locks with row-level locks. They are entirely

Re: [GENERAL] For vim users: Syntax highlighting for PostgreSQL

2006-05-02 Thread Fernan Aguero
+[ Devrim GUNDUZ <[EMAIL PROTECTED]> (27.Apr.2006 23:39): | | Hi, | | I just wrote a pgsql.vim file for vim users. It helps you to colorize | the file which contains PostgreSQL SQL keywords: | | http://www.gunduz.org/postgresql/pgsql.vim Devrim, thanks for contributing this! | In ord

Re: [GENERAL] Using the REPLACE command to replace all vowels

2006-05-02 Thread Tony Wasson
On 1 May 2006 13:16:15 -0700, EbGrooveCb <[EMAIL PROTECTED]> wrote: Is there a way to make seperate replacements in 1 field in one command in SQL? I need to remove all vowels (a,e,i,o,u) in a field. How would I go about that? You can do all the replacements in a single SQL statement by nestin

Re: [GENERAL] age(datfrozenxid) negative for template0. Is this normal?

2006-05-02 Thread Tom Lane
Denis Gasparin <[EMAIL PROTECTED]> writes: > Is it normal that the age for template0 is negative? template0 doesn't require vacuuming, so it doesn't matter what age it shows. regards, tom lane ---(end of broadcast)--- TIP 9:

Re: [GENERAL] Use of ISpell dictionaries with tsearch2 - what is

2006-05-02 Thread Oleg Bartunov
Don, let me to answer to your original question "Use of ISpell dictionaries with tsearch2 - what is the point?". The purpose of any dictionaries in search engines is to help people to search words not bothering about different forms (declension, inflexion,...). Dictionaries could be used to pr

[GENERAL] Recovering a row result

2006-05-02 Thread Luis Alberto Pérez Paz
Hi everybody!   I'm migrating some sybase store procedures to postgres functions, In sybase I can write: -- create proc algo() as if exists (something)   return -900; else   SELECT * from tabla   return 0 -   Inside of my procedure I don't use the SELECT result, however I ca

Re: [GENERAL] For vim users: Syntax highlighting for PostgreSQL

2006-05-02 Thread Devrim GUNDUZ
Hi, On Mon, 2006-05-01 at 15:15 -0700, [EMAIL PROTECTED] wrote: > Thank you! I find this useful and am testing it. Great to hear that. I'm also working on plpgsql.vim file. > Should feedback go to this thread in the newsgroup or to your email > account or another channel? I think e-mail to m

Re: [GENERAL] shp2pgsql

2006-05-02 Thread Michael Fuhr
On Mon, May 01, 2006 at 03:03:24PM +0100, gouse shaik wrote: > I want source code of shp2pgsl. > Please provide link if available. shp2pgsql is part of PostGIS. http://www.postgis.org/ -- Michael Fuhr ---(end of broadcast)--- TIP 1: if postin

Re: [GENERAL] Socket command type I unknown

2006-05-02 Thread Joel Richard
Tom (and others who may benefit from this), I'm sorry for taking so long to reply to this. PostgreSQL administration is not my primary task. :) After a client noticed this error twice this morning, I spent several hours investigating our machine and researching on the web. This email led me

[GENERAL] charting performance measures with number or records in table

2006-05-02 Thread SunWuKung
We had a discussion with my friend about whether to use an array or an attached table and I was in favor of the attached table while he was concerned about the the performance of the select/insert as the number or records in the attached table grew and so favored to use an array in the parent t

[GENERAL] Using the REPLACE command to replace all vowels

2006-05-02 Thread EbGrooveCb
Is there a way to make seperate replacements in 1 field in one command in SQL? I need to remove all vowels (a,e,i,o,u) in a field. How would I go about that? ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire

Re: [GENERAL] For vim users: Syntax highlighting for PostgreSQL

2006-05-02 Thread brsaweda
Devrim GUNDUZ wrote: > Hi, > > I just wrote a pgsql.vim file for vim users. It helps you to colorize > the file which contains PostgreSQL SQL keywords: (...) > - Many of the keywords (let us see if I've missed anything) > - Comments > > I've used mysql.vim as a template. Thanks to \df, \dT and ps

Re: [GENERAL] file I/O in plpgsql

2006-05-02 Thread Jessica M Salmon
Thanks everyone for their input on this. -Meghan ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] how can i view deleted records?

2006-05-02 Thread Ian Harding
There used to be a knob that would allow you to temporarily see deleted tuples. Don't know if it's still there. Sounded kinda dangerous. http://archives.postgresql.org/pgsql-patches/2005-02/msg00126.php Also, you could start (now) using PITR so you could simply restore to the moment before the

[GENERAL] shp2pgsql

2006-05-02 Thread gouse shaik
Hello Friends,   I want source code of shp2pgsl. Please provide link if available.   Thank you Shaik. Yahoo! India Answers: Share what you know. Learn something new. Click here

[GENERAL] age(datfrozenxid) negative for template0. Is this normal?

2006-05-02 Thread Denis Gasparin
Today I executed the following query as stated into the Administrator Guide to check the XID wraparound problem: SELECT datname, age(datfrozenxid) FROM pg_database; All the database report an age of 1 billion except for the template0 database. This is an extract of the result of the query:

Re: [GENERAL] convert LO to BYTEA

2006-05-02 Thread Jerry LeVan
Markus, PgBrowse 1.7a allows saving Large Objects into a file and the PgBrowse editor also allows inserting Bytea Fields from a file. See http://homepage.mac.com/levanj/TclTk Jerry ---(end of broadcast)--- TIP 4: Have you searched our list archiv

Re: [GENERAL] 8.1.4 anytime soon?

2006-05-02 Thread Bruno Wolff III
On Tue, May 02, 2006 at 14:20:03 -0400, "Matthew T. O'Connor" wrote: > Hey all, I was just wondering if there were any plans to get 8.1.4 > release in the near future. I'm seeing semi-frequent out of memory > errors that are related to a bugfix that Tom put in post 8.1.3. (Yes I > know I can

Re: [GENERAL] Calling V1 function from within the server

2006-05-02 Thread Martijn van Oosterhout
On Tue, May 02, 2006 at 11:24:34AM -0700, Don Y wrote: > Hi, > > If I define: > > Datum barcode_checksum(PG_FUNCTION_ARGS) > > PG_FUNCTION_INFO_V1(barcode_checksum) > and now want to *use* that function within some other > (related) function, how can I invoke it? The intuitive You want Dire

[GENERAL] FATAL: database "dspace" does not exist"

2006-05-02 Thread Christo Romberg
Hi!I have some problems with PostgreSQL v8.1.3.My system is Windows XP Professional Edition.An error occur when I try to connect to the database "dspace" that I've made. It claims that the db does not exist, though it does. Another error occur when try to create a new database. Then error messages

[GENERAL] Calling V1 function from within the server

2006-05-02 Thread Don Y
Hi, If I define: Datum barcode_checksum(PG_FUNCTION_ARGS) PG_FUNCTION_INFO_V1(barcode_checksum) Datum barcode_checksum(PG_FUNCTION_ARGS) { barcode value; short result; label = (barcode) PG_GETARG_INT32(0); // compute barcode PG_RETURN_INT16(result); } and now want to *use* that f

[GENERAL] 8.1.4 anytime soon?

2006-05-02 Thread Matthew T. O'Connor
Hey all, I was just wondering if there were any plans to get 8.1.4 release in the near future. I'm seeing semi-frequent out of memory errors that are related to a bugfix that Tom put in post 8.1.3. (Yes I know I can compile from source, but I'd rather not do that on my production server.) Th

Re: [GENERAL] Return value (instead of reference) for user defined

2006-05-02 Thread Don Y
Tom Lane wrote: Don Y <[EMAIL PROTECTED]> writes: Nearest I can tell, the problem is related to my attempt to return an int "by value" If that's what you intend, try cluing in CREATE TYPE (see PASSEDBYVALUE). Thanks! That did the trick! --don ---(end of broadcast)--

Re: [GENERAL] PG_RETURN_?

2006-05-02 Thread Don Y
Martijn van Oosterhout wrote: On Tue, May 02, 2006 at 10:06:19AM -0700, Don Y wrote: The type as declared determines the storage required to store it. That Yes, but for a function returning a value that does not exceed sizeof(Datum), there is no *space* consequence. I would assume most modern

Re: [GENERAL] Using a pointer as statetype for an aggregate

2006-05-02 Thread Florian G. Pflug
Tom Lane wrote: > "Florian G. Pflug" <[EMAIL PROTECTED]> writes: >>why doesn't postgres allow "internal" as statetype? > > Because it's not a type. If it were, it certainly wouldn't have the > semantics you seem to hope for (ie, "pass by reference type but don't > actually try to copy the bits")

Re: [GENERAL] Unexpected behavior

2006-05-02 Thread Martijn van Oosterhout
On Tue, May 02, 2006 at 12:11:34PM -0500, Steve V wrote: > >When that rule should never fire (the id hasn't changed). If I change > >the conditional of the rule to something that must always be false > >(like false, or 1 = 0), it will still behave in this manner. > > Does anyone know what's going

Re: [GENERAL] PG_RETURN_?

2006-05-02 Thread Martijn van Oosterhout
On Tue, May 02, 2006 at 10:06:19AM -0700, Don Y wrote: > >The type as declared determines the storage required to store it. That > > Yes, but for a function returning a value that does not exceed > sizeof(Datum), there is no *space* consequence. I would assume > most modern architectures use 32 b

Re: [GENERAL] Unexpected behavior

2006-05-02 Thread Steve V
On 4/27/06, Strobhen <[EMAIL PROTECTED]> wrote: Hey, I am trying to figure out some unexpected behavior in Postgresql. When I create a rule that fires on a table after an update, and if that rule has a SELECT statement in it, it seems to be attempting to fire (on an empty set) regardless of how

[GENERAL] libpq for palm?

2006-05-02 Thread Ottavio Campana
Is there a libpq for palm os? That would be great to develop applications. -- Non c'è più forza nella normalità, c'è solo monotonia. signature.asc Description: OpenPGP digital signature

Re: [GENERAL] PG_RETURN_?

2006-05-02 Thread Don Y
Martijn van Oosterhout wrote: On Tue, May 02, 2006 at 08:43:03AM -0700, Don Y wrote: Richard Huxton wrote: Don Y wrote: Hi, I have a set of functions for a data type that return small integers (i.e. [0..12]). I can, of course, represent it as a char, short or long (CHAR, INT16 or INT32). re

Re: [GENERAL] PG_RETURN_?

2006-05-02 Thread Martijn van Oosterhout
On Tue, May 02, 2006 at 08:43:03AM -0700, Don Y wrote: > Richard Huxton wrote: > >Don Y wrote: > >>Hi, > >> > >>I have a set of functions for a data type that return > >>small integers (i.e. [0..12]). I can, of course, represent > >>it as a char, short or long (CHAR, INT16 or INT32). > >>re there

Re: [GENERAL] PG_RETURN_?

2006-05-02 Thread Richard Huxton
Don Y wrote: Richard Huxton wrote: Don Y wrote: Hi, I have a set of functions for a data type that return small integers (i.e. [0..12]). I can, of course, represent it as a char, short or long (CHAR, INT16 or INT32). re there any advantages/drawbacks to chosing one particular PG_RETURN_ type

Re: [GENERAL] PG_RETURN_?

2006-05-02 Thread Don Y
Richard Huxton wrote: Don Y wrote: Hi, I have a set of functions for a data type that return small integers (i.e. [0..12]). I can, of course, represent it as a char, short or long (CHAR, INT16 or INT32). re there any advantages/drawbacks to chosing one particular PG_RETURN_ type over another (

Re: [GENERAL] Socket command type I unknown

2006-05-02 Thread Joel Richard
Sorry to spam you guys with my noise, but for the sake of posterity, I thought I'd reply with the solution to this problem. I learned a lot about the PGSQL protocol during this time. So, I ended up getting a Ethereal installed on a machine so I could follow the protocol and see what exactly

[GENERAL] convert LO to BYTEA

2006-05-02 Thread Markus Schiltknecht
Hi, is there an easy way to convert a large object to a bytea field? Thanks Markus ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Using a pointer as statetype for an aggregate

2006-05-02 Thread Tom Lane
"Florian G. Pflug" <[EMAIL PROTECTED]> writes: > why doesn't postgres allow "internal" as statetype? Because it's not a type. If it were, it certainly wouldn't have the semantics you seem to hope for (ie, "pass by reference type but don't actually try to copy the bits") r

Re: [GENERAL] How would I write this query...

2006-05-02 Thread John D. Burger
Martijn van Oosterhout wrote: That's because they're not equivalent. IN/NOT IN have special semantics w.r.t. NULLs that make them a bit more difficult to optimise. OUTER JOINs on the other hand is easier since in a join condition anything = NULL evaluates to NULL -> FALSE. Which is why Hash IN

[GENERAL] number of page slots needed exceeds max_fsm_pages

2006-05-02 Thread David Brain
I have a cron job that vacuums one of my dbs daily (Postgres 7.3.11)- using 'vacuumdb -a -f -z -q -U postgres'. Currently I get an email containing the folowing error messages: NOTICE: number of page slots needed (38320) exceeds max_fsm_pages (2) HINT: Consider increasing the configurat

Re: [GENERAL] How to join to delete

2006-05-02 Thread Chris Velevitch
On 5/2/06, Richard Huxton wrote: Chris Velevitch wrote: > I'm using pg 7.4.5 on Win XP SP1. The first official release for Windows was 8.0, and there have been I'm the cygwin version of pg for testing. several bugfixes to 7.4.x since then. Upgrade as soon as is practical. I'm deploying to

Re: [GENERAL] Unnecessary function calls

2006-05-02 Thread Terry Fielder
1) If the join to rank_lookup is done across Pkey and/or unique indexed fields and a foreign key is defined for said join, I don't know how the subquery could possibly be more optimized then it is (the reasoning being beyond the scope of this discussion and possibly even beyond the scope of are

Re: [GENERAL] Unnecessary function calls

2006-05-02 Thread Markus Schiltknecht
On Tue, 2006-05-02 at 14:02 +0200, Martijn van Oosterhout wrote: > How about: > > SELECT id, get_category_text_path(id) > FROM (SELECT id FROM category > ORDER BY rank > LIMIT 5) as x; Oh that works? Great! Let me see, with 'rank' from a joined table that looks like: SELECT id, get_cate

Re: [GENERAL] Unnecessary function calls

2006-05-02 Thread Terry Fielder
SELECT id, get_category_text_path(id) FROM category WHERE id IN ( SELECT c.id FROM category AS c ORDER BY c.rank LIMIT 5 ) Terry Fielder [EMAIL PROTECTED] Associate Director Software Development and Deployment Great Gulf Homes / Ashton Woods Homes Fax: (416) 441-9085 Markus Schiltknech

Re: [GENERAL] Unnecessary function calls

2006-05-02 Thread Markus Schiltknecht
Hello Terry, Thanks a lot. That's so simple I didn't see it. (The original query is much more complex.) The only problem is, rank is not a column of category itself, but a joined row. With this solution, the join will have to be performed twice. But since this doesn't cost that much and because t

Re: [GENERAL] Unnecessary function calls

2006-05-02 Thread Martijn van Oosterhout
On Tue, May 02, 2006 at 01:37:54PM +0200, Markus Schiltknecht wrote: > Hi, > > when using LIMIT, how do I tell the planner to only call a function for > rows it returns? > > An example: I want to fetch the top five categories. A function > get_category_text_path(cat_id int) returns the textual re

Re: [GENERAL] Unnecessary function calls

2006-05-02 Thread Richard Huxton
Markus Schiltknecht wrote: Hi, when using LIMIT, how do I tell the planner to only call a function for rows it returns? An example: I want to fetch the top five categories. A function get_category_text_path(cat_id int) returns the textual representation of the category. For that I do something

[GENERAL] Unnecessary function calls

2006-05-02 Thread Markus Schiltknecht
Hi, when using LIMIT, how do I tell the planner to only call a function for rows it returns? An example: I want to fetch the top five categories. A function get_category_text_path(cat_id int) returns the textual representation of the category. For that I do something like: SELECT id, get_categor

[GENERAL] Using a pointer as statetype for an aggregate

2006-05-02 Thread Florian G. Pflug
Hi I've now completed my implementation of a collect_distinct aggregate, and it seems to work. My statetype is basically a pointer to a hashtable (allocated from the aggcontext). Since using internal as statetype is unsupported, I use int8, and just cast my pointer back and forth from int8. It a

Re: [GENERAL] Alternative for vacuuming queue-like tables

2006-05-02 Thread Csaba Nagy
> > I guess what I'm asking for is a kind of "REBUILD TABLE" which is not > > MVCC by definition but it would be useful in the mentioned queue table > > case. > > > > vaccum full ? Nope, it won't work, it will still leave in all the dead tuples potentially visible by old transactions, even if tho

Re: [GENERAL] How would I write this query...

2006-05-02 Thread Martijn van Oosterhout
On Mon, May 01, 2006 at 05:23:41PM -0400, John D. Burger wrote: > In my experience, queries like the OUTER LEFT JOIN version posted > earlier are usually much more efficient than NOT IN queries like the > above. The planner seems to be pretty smart about turning (positive) > IN queries into joi

Re: [GENERAL] How would I write this query...

2006-05-02 Thread Alban Hertroys
Guy Rouillier wrote: Jim Fitzgerald wrote: Hi - I have two tables, one of them has names of people and an associated integer ID. The other table is a list of the people (from the first table) by their ID number that have signed up for a class. How would I write a query that would list all t

Re: [GENERAL] How to join to delete

2006-05-02 Thread Richard Huxton
Chris Velevitch wrote: I'm using pg 7.4.5 on Win XP SP1. The first official release for Windows was 8.0, and there have been several bugfixes to 7.4.x since then. Upgrade as soon as is practical. I want to delete rows from a table B, but need to join it to another table A in order to select

Re: [GENERAL] PG_RETURN_?

2006-05-02 Thread Richard Huxton
Don Y wrote: Hi, I have a set of functions for a data type that return small integers (i.e. [0..12]). I can, of course, represent it as a char, short or long (CHAR, INT16 or INT32). re there any advantages/drawbacks to chosing one particular PG_RETURN_ type over another (realizing that they are

Re: [GENERAL] How to join to delete

2006-05-02 Thread Noel Faux
Hi Chris, I think the best bet would be to use a nested select: Delete from A WHERE A.bk = (SELECT bk FROM B) where A.ak = x; Cheers Noel Chris Velevitch wrote: I'm using pg 7.4.5 on Win XP SP1. I want to delete rows from a table B, but need to join it to another table A in order to select t

Re: [GENERAL] Return value (instead of reference) for user defined type

2006-05-02 Thread Tom Lane
Don Y <[EMAIL PROTECTED]> writes: > Nearest I can tell, the problem is related to my attempt to > return an int "by value" If that's what you intend, try cluing in CREATE TYPE (see PASSEDBYVALUE). regards, tom lane ---(end of broadcast)