[GENERAL] dbi-link freezing up DBs, needing reboot

2009-08-30 Thread Ow Mun Heng
I was playing around with dbi-link, hoping to get it connected to a teradata database. However, before I dive into that, I figured that I might as well try it out first on a PG Database (on another server) So, it installed dbi-link fine. I did a select on a 30GB table and it froze the

Re: [GENERAL] Snow Leopard and PG 8.4 problems....

2009-08-30 Thread Jan Otto
Hi Jerry, I have been able to use just the ip in the host field but Snow Leopard seems to have broken using a 'name' in the host field... see below. It appears that compiling pg 8.4 gives rise to libs with architecture of x386_64... hm, i have no problems to compile postgresql on snow

Re: [GENERAL] best practise/pattern for large OR / LIKE searches

2009-08-30 Thread Jasen Betts
On 2009-08-26, Ries van Twisk p...@rvt.dds.nl wrote: --Apple-Mail-1173-222712773 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hey All, I am wondering if there is a common pattern for these sort of queries :

Re: [GENERAL] New database or New Schema?

2009-08-30 Thread Eric Comeau
Filip RembiaƂkowski plk.zu...@gmail.com wrote in message news:92869e660908250856g62561141n557f88015cd21...@mail.gmail.com... 2009/8/25 Eric Comeau ecom...@signiant.com David Fetter da...@fetter.org wrote in message news:20090821170259.ga6...@fetter.org... On Fri, Aug 21,

[GENERAL] Trouble using TG_TABLE_NAME in BEFORE INSERT OR UPDATE trigger

2009-08-30 Thread Stephen Cuppett
Using PostgreSQL 8.4.0, I have the following generic trigger defined for use by a collection of the same structured tables: CREATE OR REPLACE FUNCTION pdf_active_check() RETURNS trigger AS $BODY$ DECLARE var_active BOOLEAN; BEGIN SELECT p.active INTO STRICT var_active FROM

Re: [GENERAL] export a schema / import as new schema

2009-08-30 Thread Jasen Betts
On 2009-08-21, David Kerr d...@mr-paradox.net wrote: On Fri, Aug 21, 2009 at 12:00:11PM -0700, Joshua D. Drake wrote: - On Fri, 2009-08-21 at 11:56 -0700, David Kerr wrote: - Is there an easy way, that I'm missing, where I can export a schema from - database A and then rename it on load

Re: [GENERAL] Removing older versions

2009-08-30 Thread Jasen Betts
On 2009-08-29, Blueb bl...@shaw.ca wrote: I installed PostgreSQL 8.4 over a PostgreSQL 8.3 installation (using msi) on a Windows machine. there's a msi installer for 8.4? My pgAdmin3 program correctly displays only PostgreSQL 8.4 on localhost. I went to my harddrive and noticed that I have

Re: [GENERAL] Select data for current week only

2009-08-30 Thread Jasen Betts
On 2009-08-27, BlackMage dsd7...@uncw.edu wrote: Hey all, I've been trying to figure this problem out with just using sql but I'm not sure how too. I have a table that holds events for each week but I only want to select events happening for the current week(Mon-Sun). So can anyone help me

Re: [GENERAL] Trouble using TG_TABLE_NAME in BEFORE INSERT OR UPDATE trigger

2009-08-30 Thread Pavel Stehule
Hello you cannot use variable as table or column name in direct query. look on execute statemen: http://www.postgresql.org/docs/8.4/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN or don't use generic triggers. regards Pavel Stehule 2009/8/30 Stephen Cuppett st...@cuppett.com:

Re: [GENERAL] best practise/pattern for large OR / LIKE searches

2009-08-30 Thread Pavel Stehule
Hello regex is compiled to a finite state machine and then the datanumber column is scanned in a single pass (for each row) Searches are currently taking to long and we would like to optimize them, but before we dive into our own solution we where wondering if there already common solutions

Re: [GENERAL] Trouble using TG_TABLE_NAME in BEFORE INSERT OR UPDATE trigger

2009-08-30 Thread Stephen Cuppett
Sorry, found my answer wrt dynamic queries, etc. Restructured trigger to look like this: CREATE OR REPLACE FUNCTION pdf_active_check() RETURNS trigger AS $BODY$ DECLARE var_curs1 refcursor; var_active BOOLEAN; BEGIN open var_curs1 FOR EXECUTE 'SELECT p.active FROM

Re: [GENERAL] Trouble using TG_TABLE_NAME in BEFORE INSERT OR UPDATE trigger

2009-08-30 Thread Martijn van Oosterhout
On Sun, Aug 30, 2009 at 03:22:16PM +0200, Pavel Stehule wrote: Hello you cannot use variable as table or column name in direct query. look on execute statemen: http://www.postgresql.org/docs/8.4/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN or don't use generic

Re: [GENERAL] Trouble using TG_TABLE_NAME in BEFORE INSERT OR UPDATE trigger

2009-08-30 Thread Pavel Stehule
2009/8/30 Martijn van Oosterhout klep...@svana.org: On Sun, Aug 30, 2009 at 03:22:16PM +0200, Pavel Stehule wrote: Hello you cannot use variable as table or column name in direct query. look on execute statemen:

Re: [GENERAL] dbi-link freezing up DBs, needing reboot

2009-08-30 Thread Andy Colson
Ow Mun Heng wrote: I was playing around with dbi-link, hoping to get it connected to a teradata database. However, before I dive into that, I figured that I might as well try it out first on a PG Database (on another server) So, it installed dbi-link fine. I did a select on a 30GB table and it

Re: [GENERAL] dbi-link freezing up DBs, needing reboot

2009-08-30 Thread Ow Mun Heng
-Original Message- From: Andy Colson [mailto:a...@squeakycode.net] Ow Mun Heng wrote: I was playing around with dbi-link, hoping to get it connected to a teradata database. However, before I dive into that, I figured that I might as well try it out first on a PG Database (on another

[GENERAL] Connecting to Teradata via Postgresql

2009-08-30 Thread Ow Mun Heng
Hi All, Anyone here has a teradata box ? Are you able to connect to it from withing postgresql? I would like to pull 1or 2 tables from the box (sync) and was wondering if there's anyway to do that w/o using dbi-link. I actually am trying dbi-link but it seem as though it doesn't support

[GENERAL] convert epoch to date

2009-08-30 Thread Kevin Kempter
Hi all; I know how to convert a date to an epoch: select extract ('epoch' from timestamp '2009-08-12') How do I do the opposite, I want to convert epoch values to a date Thanks in advance -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Connecting to Teradata via Postgresql

2009-08-30 Thread David Fetter
On Sun, Aug 30, 2009 at 11:21:55PM +0800, Ow Mun Heng wrote: Hi All, Anyone here has a teradata box? Are you able to connect to it from withing postgresql? If you can get me a test environment including Teradata, I'd be delighted to add support to DBI-Link, most likely in the form of

Re: [GENERAL] Lotus Approach like find function (ie CTRL-F) in some libre forms client?

2009-08-30 Thread Adrian Klaver
On Saturday 29 August 2009 4:59:14 pm Zenaan Harkness wrote: I am charged with migrating a Lotus Approach db + forms. Approach (97 I think :) has this function where, when viewing a record or within a form (or in the spreadsheet view for that matter) one can press CTRL-F, for find records.

Re: [GENERAL] Problem libpython2.3.so.1.0

2009-08-30 Thread Adrian Klaver
On Saturday 29 August 2009 4:33:14 pm nesfree wrote: Hello, I am not experienced PostgreSQL user but have following problem: I am unable to use plpythonu on linux (ubuntu 9.04). After I execute command: psql# CREATE LANGUAGE plpythonu; I got following error message: ERROR: could not

Re: [GENERAL] convert epoch to date

2009-08-30 Thread Pavel Stehule
Hello 2009/8/30 Kevin Kempter kev...@consistentstate.com: Hi all; I know how to convert a date to an epoch: select extract ('epoch' from timestamp '2009-08-12') postgres=# select extract ('epoch' from timestamp '2009-08-12'); date_part 1250028000 (1 row) Time: 0,734 ms

[GENERAL] Using WITH queries on VIEWs

2009-08-30 Thread Jorge Godoy
Hi! Is it possible to use WITH queries ( http://www.postgresql.org/docs/8.4/interactive/queries-with.html) on VIEWs? I have a rather complex view that I could optimize with it... Regards, -- Jorge Godoy jgo...@gmail.com

[GENERAL] $Body$

2009-08-30 Thread bilal ghayyad
Hi List; What does it mean the $BODY$ when writing the function? In other words: why to use the $ sign? Regards Bilal -- 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] $Body$

2009-08-30 Thread Christophe Pettus
It's just a string constant: http://www.postgresql.org/docs/8.4/interactive/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS It could be anything between the dollar signs, but BODY is self- documenting. On Aug 30, 2009, at 3:37 PM, bilal ghayyad wrote: Hi List; What does it mean the

Re: [GENERAL] $Body$

2009-08-30 Thread David Fetter
On Sun, Aug 30, 2009 at 03:37:56PM -0700, bilal ghayyad wrote: Hi List; What does it mean the $BODY$ when writing the function? In other words: why to use the $ sign? See http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING Cheers, David. --

Re: [GENERAL] Using WITH queries on VIEWs

2009-08-30 Thread David Fetter
On Sun, Aug 30, 2009 at 07:33:52PM -0300, Jorge Godoy wrote: Hi! Is it possible to use WITH queries ( http://www.postgresql.org/docs/8.4/interactive/queries-with.html) on VIEWs? I have a rather complex view that I could optimize with it... A WITH query can go anywhere any other

[GENERAL] short circuit joins

2009-08-30 Thread Marcus Engene
Hi, -- a select ... from base_table bt left outer join sub_table_1 st1 on (st1.base_table = bt.id) left outer join sub_table_2 st1 on (st2.base_table = bt.id) -- b select ... from base_table bt left outer join sub_table_1 st1 on (bt.objecttype = 1 AND st1.base_table =

Re: [GENERAL] $Body$

2009-08-30 Thread bilal ghayyad
This is the idea david: Why in the constant string we use the tag and we do not use the tag in the BODY? In other wrods, why we write it $BODY$ and does not write it as $q$BODY$q$ or as $$BODY$$? Also why in the single-quote syntax, each backslash will be written as four backslashes? While

Re: [GENERAL] $Body$

2009-08-30 Thread David Fetter
On Sun, Aug 30, 2009 at 04:13:18PM -0700, bilal ghayyad wrote: This is the idea david: Why in the constant string we use the tag and we do not use the tag in the BODY? In other wrods, why we write it $BODY$ and does not write it as $q$BODY$q$ or as $$BODY$$? The string BODY in $BODY$ has

[GENERAL] Query and the number of row result

2009-08-30 Thread bilal ghayyad
Hi All; After doing a SELECT query, how can I know the number of returned rows from this query? If it returned 5 rows or 1 row or non? Regards Bilal -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Query and the number of row result

2009-08-30 Thread David Fetter
On Sun, Aug 30, 2009 at 06:56:59PM -0700, bilal ghayyad wrote: Hi All; After doing a SELECT query, how can I know the number of returned rows from this query? If it returned 5 rows or 1 row or non? Lots of language bindings have this. Which language(s) are you using? Cheers, David. --

[GENERAL] indexes on partitioned tables - on the base table, or the partitioned tables?

2009-08-30 Thread Kevin Kempter
Hi all; where's the best place for the indexes/constraints on a partitioned table. I assume it's best to place the FK constraints/triggers on the base/master table and the indexes on the individual partition tables. Thoughts? Thanks in advance. -- Sent via pgsql-general mailing list

Re: [GENERAL] Query and the number of row result

2009-08-30 Thread bilal ghayyad
Postgresql. Is there alot of Postgresql? How can I know mine? Regards Bilal --- On Sun, 8/30/09, David Fetter da...@fetter.org wrote: From: David Fetter da...@fetter.org Subject: Re: [GENERAL] Query and the number of row result To: bilal ghayyad bilmar...@yahoo.com Cc:

Re: [GENERAL] Query and the number of row result

2009-08-30 Thread David Fetter
On Sun, Aug 30, 2009 at 07:35:42PM -0700, bilal ghayyad wrote: Postgresql. Is there alot of Postgresql? How can I know mine? Are you connecting from C? PHP? Perl? Python? Ruby? Cheers, David. -- David Fetter da...@fetter.org http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666