Re: [GENERAL] Using PG with Windows EFS or TrueCrypt for encryption

2010-12-08 Thread Magnus Hagander
On Wed, Dec 8, 2010 at 01:19, Brady Mathis wrote: > Hi - > I have searched the lists for comments about using PG with EFS and/or > TrueCrypt in order to encrypt the entire database transparently.  I found a > few posts making reference to this possibility so I have tried them both, > but I didn't

[GENERAL] Fwd: [ADMIN] Create database/table using postgresql stored function

2010-12-08 Thread Manasi Save
-- Regards, Manasi Save Database Administrator Artificial Machines Private Limited manasi.s...@artificialmachines.com Ph:-9833537392 - Forwarded message from Manasi Save - Date: Wed, 08 Dec 2010 04:43:50 -0500 From: Manasi Save Reply-To: Manasi Save Subject: [ADMIN] Create

Re: [GENERAL] Abusing Postgres in fun ways.

2010-12-08 Thread tv
> I'm creating a data queue on top of postgres and I'm wondering if I've > made > an incorrect assumption about isolation or synchronization or some similar > issue. Is there a particular reason why you are not using any of the proven queuing packages (pgq for example)? Because all the issues seem

[GENERAL] OID of type by name.

2010-12-08 Thread Dmitriy Igrishin
Hey general@, SELECT oid FROM pg_type WHERE typname = 'integer'; oid - (0 rows) SELECT oid FROM pg_type WHERE typname = 'int4'; oid - 23 (1 row) How can I get OID by name rather than alias ? -- // Dmitriy.

[GENERAL] How to obtain the maximum value of a date, between 3 tables...

2010-12-08 Thread Andre Lopes
Hi, I need to obtain the maximum value of a date, but that comparison will be made between 3 tables... I will explain better with a query... [code] select a.last_refresh_date as d1, ae.last_refresh_date as d2, ha.last_refresh_date as d3 from tbl1 a join tbl2 ae on a.id_anuncio_externo = ae.id_anu

Re: [GENERAL] Using PG with Windows EFS or TrueCrypt for encryption

2010-12-08 Thread Massa, Harald Armin
Brady, Then I attempted to mount a normal encrypted volume with TrueCrypt, move the > data\ and sub-folders to this volume and reconfigure PG to point to this as > the data folder. Now, the PG service will not start at all. > > moving data and subfolder on NTFS is a Level-20 operation. The usual

Re: [GENERAL] How to obtain the maximum value of a date, between 3 tables...

2010-12-08 Thread Jon Nelson
On Wed, Dec 8, 2010 at 7:15 AM, Andre Lopes wrote: > Hi, > > I need to obtain the maximum value of a date, but that comparison will be > made between 3 tables... I will explain better with a query... > > [code] > select > a.last_refresh_date as d1, ae.last_refresh_date as d2, ha.last_refresh_date

Re: [GENERAL] OID of type by name.

2010-12-08 Thread Dmitriy Igrishin
SELECT oid FROM pg_type WHERE typtype = 'b' AND typarray <> 0 AND typname::regtype = 'integer'; Many thanks to Florian Pflug. 2010/12/8 Dmitriy Igrishin > Hey general@, > > SELECT oid FROM pg_type WHERE typname = 'integer'; > oid > - > (0 rows) > > SELECT oid FROM pg_type WHERE typname = '

[GENERAL] Asynchronous query execution

2010-12-08 Thread c k
Hello, I would like to know how can we execute the queries asynchronously? If we use and execute plpgsql functions they just completes the execution or throws an error on error. In between next sql statement waits for the previous one to complete the execution. But in few situations it is required

Re: [GENERAL] How to obtain the maximum value of a date, between 3 tables...

2010-12-08 Thread Andre Lopes
Hi, Thanks for the reply. And there are other options to do it without using a UNION? I don't need to know from witch table comes the greatest date, but the query is complex, this query is part of an UNION. The use of the CASE WHEN could be an alternative? Best Regards, On Wed, Dec 8, 2010 a

Re: [GENERAL] Asynchronous query execution

2010-12-08 Thread John R Pierce
On 12/08/10 5:35 AM, c k wrote: Hello, I would like to know how can we execute the queries asynchronously? If we use and execute plpgsql functions they just completes the execution or throws an error on error. In between next sql statement waits for the previous one to complete the execution. B

[GENERAL] Maximum size for char or varchar with limit

2010-12-08 Thread Rob Gansevles
Hello, Does anyone know what the maximum length is for char or varchar columns with limit. I saw some answers to this same question referring to section 8.3 of the docs, but I don't see the actual numbers there. I know you can go to 1GB if you don't specify the limit, but I would like to know wha

Re: [GENERAL] Asynchronous query execution

2010-12-08 Thread Robert Gravsjö
On 2010-12-08 14.35, c k wrote: Hello, I would like to know how can we execute the queries asynchronously? If we use and execute plpgsql functions they just completes the execution or throws an error on error. In between next sql statement waits for the previous one to complete the execution. B

Re: [GENERAL] Maximum size for char or varchar with limit

2010-12-08 Thread Adrian Klaver
On Wednesday 08 December 2010 5:47:25 am Rob Gansevles wrote: > Hello, > > Does anyone know what the maximum length is for char or varchar > columns with limit. > I saw some answers to this same question referring to section 8.3 of > the docs, but I don't see the actual numbers there. > > I know yo

Re: [GENERAL] OID of type by name.

2010-12-08 Thread Tom Lane
Dmitriy Igrishin writes: >> How can I get OID by name rather than alias ? > SELECT oid FROM pg_type WHERE typtype = 'b' AND typarray <> 0 AND > typname::regtype = 'integer'; Seems like the hard way --- if you think carefully about what regtype is doing, you'll realize that this is incredibly ine

Re: [GENERAL] OID of type by name.

2010-12-08 Thread Dmitriy Igrishin
Yeah, thank you very much! I've found it already too, but not post back! Thanks! 2010/12/8 Tom Lane > Dmitriy Igrishin writes: > >> How can I get OID by name rather than alias ? > > > SELECT oid FROM pg_type WHERE typtype = 'b' AND typarray <> 0 AND > > typname::regtype = 'integer'; > > Seems

Re: [GENERAL] OID of type by name.

2010-12-08 Thread Dmitriy Igrishin
Actually, all I need is to: SELECT oid::regtype, oid FROM pg_type WHERE ... to make cache of OIDs. 2010/12/8 Dmitriy Igrishin > Yeah, thank you very much! > > I've found it already too, but not post back! > > Thanks! > > 2010/12/8 Tom Lane > > Dmitriy Igrishin writes: >> >> How can I get OID

Re: [GENERAL] Maximum size for char or varchar with limit

2010-12-08 Thread Rob Gansevles
Adrian, Thanks for the reply, but this refers to max row or field size, it does not tell me where the max varchar limit of 10485760 comes from and if this is fixed or whether it depends on something else Has anyone some info on this? Rob On Wed, Dec 8, 2010 at 3:34 PM, Adrian Klaver wrote: > O

Re: [GENERAL] Maximum size for char or varchar with limit

2010-12-08 Thread Adrian Klaver
On Wednesday 08 December 2010 7:06:07 am Rob Gansevles wrote: > Adrian, > > Thanks for the reply, but this refers to max row or field size, it > does not tell me where the max varchar limit of 10485760 comes from > and if this is fixed or whether it depends on something else > > Has anyone some inf

Re: [GENERAL] Asynchronous query execution

2010-12-08 Thread Merlin Moncure
On Wed, Dec 8, 2010 at 8:40 AM, John R Pierce wrote: > On 12/08/10 5:35 AM, c k wrote: >> >> Hello, >> I would like to know how can we execute the queries asynchronously? >> If we use and execute plpgsql functions they just completes the execution >> or throws an error on error. In between next sq

Re: [GENERAL] Maximum size for char or varchar with limit

2010-12-08 Thread Tom Lane
Adrian Klaver writes: > So the answer is, it depends on your encoding. No, it doesn't. What Rob is looking for is this bit in htup.h: /* * MaxAttrSize is a somewhat arbitrary upper limit on the declared size of * data fields of char(n) and similar types. It need not have anything * directly

Re: [GENERAL] Maximum size for char or varchar with limit

2010-12-08 Thread Rob Gansevles
Thanks Tom, this is very helpful. Rob -- 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] Maximum size for char or varchar with limit

2010-12-08 Thread Adrian Klaver
On 12/08/2010 08:04 AM, Tom Lane wrote: Adrian Klaver writes: So the answer is, it depends on your encoding. No, it doesn't. What Rob is looking for is this bit in htup.h: /* * MaxAttrSize is a somewhat arbitrary upper limit on the declared size of * data fields of char(n) and similar t

Re: [GENERAL] Postgresql 9.1 pg_last_xact_replay_timestamp limitations

2010-12-08 Thread Gabi Julien
On Tuesday 07 December 2010 21:58:56 you wrote: > On Wed, Dec 8, 2010 at 1:31 AM, Gabi Julien wrote: > > pg_last_xact_replay_timestamp() returns null when the server is restarted > > until a new transaction is streamed to the hot standby server. It might > > take a long time before this happens.

Re: [GENERAL] Maximum size for char or varchar with limit

2010-12-08 Thread Tom Lane
Adrian Klaver writes: > On 12/08/2010 08:04 AM, Tom Lane wrote: >> The rationale for having a limit of this sort is (a) we *don't* want >> the upper limit of declarable length to be encoding-dependent; and >> (b) if you are trying to declare an upper limit that's got more than a >> few digits in i

Re: [GENERAL] Maximum size for char or varchar with limit

2010-12-08 Thread Adrian Klaver
On 12/08/2010 09:05 AM, Tom Lane wrote: Adrian Klaver writes: On 12/08/2010 08:04 AM, Tom Lane wrote: The rationale for having a limit of this sort is (a) we *don't* want the upper limit of declarable length to be encoding-dependent; and (b) if you are trying to declare an upper limit that's g

Re: [GENERAL] How to obtain the maximum value of a date, between 3 tables...

2010-12-08 Thread bricklen
On Wed, Dec 8, 2010 at 5:15 AM, Andre Lopes wrote: > Hi, > > I need to obtain the maximum value of a date, but that comparison will be > made between 3 tables... I will explain better with a query... > > [code] > select > a.last_refresh_date as d1, ae.last_refresh_date as d2, ha.last_refresh_date

Re: [GENERAL] SELECT is immediate but the UPDATE takes forever

2010-12-08 Thread Vick Khera
2010/12/7 Raimon Fernandez : > I'm using now another database with same structure and data and the delay > doesn't exist there, there must be something wrong in my current development > database. > does autovacuum run on it? is the table massively bloated? is your disk system really, really slo

Re: [GENERAL] How to obtain the maximum value of a date, between 3 tables...

2010-12-08 Thread Igor Neyman
> -Original Message- > From: Andre Lopes [mailto:lopes80an...@gmail.com] > Sent: Wednesday, December 08, 2010 8:16 AM > To: postgresql Forums > Subject: How to obtain the maximum value of a date, between 3 > tables... > > Hi, > > I need to obtain the maximum value of a date, but that

Re: [GENERAL] Postgresql 9.1 pg_last_xact_replay_timestamp limitations

2010-12-08 Thread Gabi Julien
I just tried with postgresql 9.1alpha from http://www.enterprisedb.com/products/pgdevdownload.do (linux x86-32): postgres=# select pg_last_xact_replay_timestamp(), now() as not_modified_since; ERROR: function pg_last_xact_replay_timestamp() does not exist LINE 1: select pg_last_xact_replay_times

Re: [GENERAL] Postgresql 9.1 pg_last_xact_replay_timestamp limitations

2010-12-08 Thread Tom Lane
Gabi Julien writes: > I just tried with postgresql 9.1alpha from > http://www.enterprisedb.com/products/pgdevdownload.do (linux x86-32): > postgres=# select pg_last_xact_replay_timestamp(), now() as > not_modified_since; > ERROR: function pg_last_xact_replay_timestamp() does not exist > LINE 1:

Re: [GENERAL] Uncommitted Data

2010-12-08 Thread Simon Riggs
On Wed, 2010-12-08 at 00:56 +, Jonathan Tripathy wrote: > What does PG do with data that has been inserted into a table, but was > never committed? Does the data get discarded once the connection dies? The data is there, but is not visible. You can run an explicit VACUUM to remove the "dead

Re: [GENERAL] pg_standby logging issues

2010-12-08 Thread Simon Riggs
On Tue, 2010-12-07 at 16:19 -0800, Greg Swisher wrote: > Anything more elegant out there? http://projects.2ndquadrant.com/2warm -- Simon Riggs http://www.2ndQuadrant.com/books/ PostgreSQL Development, 24x7 Support, Training and Services -- Sent via pgsql-general mailing list (pg

[GENERAL] Set new owner on cloned database

2010-12-08 Thread James B. Byrne
I am testing a Rails deployment and wish to copy a database assigning it an new owner. I have tried this: createdb --owner=hll_theheart_db_devl --template=hll_th_deploytest_prod hll_theheart_devl While this indeed sets the database owner to hll_theheart_db_devl everything else, schema, tables w

Re: [GENERAL] Set new owner on cloned database

2010-12-08 Thread Ivan Sergio Borgonovo
On Wed, 8 Dec 2010 13:40:29 -0500 (EST) "James B. Byrne" wrote: > I am testing a Rails deployment and wish to copy a database > assigning it an new owner. I have tried this: > > createdb --owner=hll_theheart_db_devl > --template=hll_th_deploytest_prod hll_theheart_devl > > While this indeed se

Re: [GENERAL] Hanging with pg_restore and large objects

2010-12-08 Thread Reuven M. Lerner
Hi. Tom. You wrote: That's pretty curious. Can you take the dump file to a non-Windows machine, or at least one with a different build of pg_restore, and see what happens there? I'm wondering about possible corrupted executable, buggy zlib, etc. I'll try to get a copy of the problematic data

Re: [GENERAL] Set new owner on cloned database

2010-12-08 Thread Guillaume Lelarge
Le 08/12/2010 22:41, Ivan Sergio Borgonovo a écrit : > On Wed, 8 Dec 2010 13:40:29 -0500 (EST) > "James B. Byrne" wrote: > >> I am testing a Rails deployment and wish to copy a database >> assigning it an new owner. I have tried this: >> >> createdb --owner=hll_theheart_db_devl >> --template=hll

[GENERAL] pl/perl object destruction (or lack thereof) at session end

2010-12-08 Thread Toby Corkindale
Hi, Looking at this: http://www.postgresql.org/docs/9.0/interactive/plperl-under-the-hood.html Specifically, the "known limitations" part, I see it says: When a session ends normally, not due to a fatal error, any END blocks that have been defined are executed. Currently no other actions ar

[GENERAL] pl/perl interpreter instance(s) - how long does it persist?

2010-12-08 Thread Toby Corkindale
Hi, Apologies in advance if this has been covered before, but I've searched extensively without finding anything so far. I would like to know how long the pl/perl interpreter instances persist? I ask because I'm doing some work where we have PL/Perlu code that loads some Perl modules in trigg

Re: [GENERAL] pl/perl object destruction (or lack thereof) at session end

2010-12-08 Thread Toby Corkindale
On 09/12/10 13:00, Toby Corkindale wrote: Hi, Looking at this: http://www.postgresql.org/docs/9.0/interactive/plperl-under-the-hood.html Specifically, the "known limitations" part, I see it says: When a session ends normally, not due to a fatal error, any END blocks that have been defined are ex

Re: [GENERAL] pl/perl interpreter instance(s) - how long does it persist?

2010-12-08 Thread Tom Lane
Toby Corkindale writes: > I would like to know how long the pl/perl interpreter instances persist? Till end of session. > Initial testing seems to give me contrary results. > In some cases, creating a new DB then loading the same module in a new > stored procedure will get the old version. > Bu

Re: [GENERAL] pl/perl interpreter instance(s) - how long does it persist?

2010-12-08 Thread Toby Corkindale
On 09/12/10 13:37, Tom Lane wrote: Toby Corkindale writes: I would like to know how long the pl/perl interpreter instances persist? Till end of session. Where session = connection (whether from psql, DBI, etc), yes? Initial testing seems to give me contrary results. In some cases, creati

Re: [GENERAL] How to obtain the maximum value of a date, between 3 tables...

2010-12-08 Thread Vincent Veyron
Le mercredi 08 décembre 2010 à 13:35 +, Andre Lopes a écrit : > Hi, > > Thanks for the reply. > > And there are other options to do it without using a UNION? I don't > need to know from witch table comes the greatest date, but the query > is complex, this query is part of an UNION. The use of

Re: [GENERAL] Postgresql 9.1 pg_last_xact_replay_timestamp limitations

2010-12-08 Thread Fujii Masao
On Thu, Dec 9, 2010 at 1:37 AM, Gabi Julien wrote: > slave# /etc/init.d/postgresql start > slave# psql -hlocalhost my_db -c "select pg_last_xact_replay_timestamp(), > now() as not_modified_since;" >  pg_last_xact_replay_timestamp |      not_modified_since > ---+---

Re: [GENERAL] How to obtain the maximum value of a date, between 3 tables...

2010-12-08 Thread Vincent Veyron
Le jeudi 09 décembre 2010 à 03:58 +0100, Vincent Veyron a écrit : > > SELECT 'tbl1',last_refresh_date FROM tbl1 UNION SELECT 'tbl2', > last_refresh_date FROM tbl2 UNION SELECT 'tbl3', last_refresh_date FROM > tbl3 ORDER BY 1 DESC; > Argh... make that : ORDER BY 2 DESC; -- Vincent Veyron h

Re: [GENERAL] Set new owner on cloned database

2010-12-08 Thread James B. Byrne
On Wed, December 8, 2010 17:46, Guillaume Lelarge wrote: > > You should try REASSIGN OWNED BY. See > http://www.postgresql.org/docs/9.0/interactive/sql-reassign-owned.html Thanks for that. I ended up doing a pg_dump followed by a sed followed by a psql < which sufficed for my purposes, even it

[GENERAL] Error handling in PL/PgSQL (without execution termination)

2010-12-08 Thread Allan Kamau
I am searching for the resource that explains how to handle SQL related exceptions in PL/PgSQL without letting the function's execution terminate. I would like to use his to address possible UNIQUE constraint violation (and resulting exception) attributed to multiple clients concurrently populating

Re: [GENERAL] SELECT is immediate but the UPDATE takes forever

2010-12-08 Thread Raimon Fernandez
On 8dic, 2010, at 18:18 , Vick Khera wrote: > 2010/12/7 Raimon Fernandez : >> I'm using now another database with same structure and data and the delay >> doesn't exist there, there must be something wrong in my current development >> database. >> > > does autovacuum run on it? no > is the

Re: [GENERAL] SELECT is immediate but the UPDATE takes forever

2010-12-08 Thread Raimon Fernandez
On 7dic, 2010, at 16:37 , Tom Lane wrote: >> Quoting Raimon Fernandez : >>> I want to understand why one of my postgresql functions takes an >>> eternity to finish. > >> Maybe there is any check or constraint on belongs_to_compte_id.comptes that >> might take longer? > > Or maybe the UPDATE is

[GENERAL] use a variable name for an insert in a trigger for an audit

2010-12-08 Thread Raimon Fernandez
Hello, I have to audit all the changes for all rows of one database. I have a trigger that executes BEFORE any update or delete, and simply copy the row (INSERT INTO) into the replicated table. For example, every table has the same name plus '_audit' at the end and belongs to the schema audit:

Re: [GENERAL] Error handling in PL/PgSQL (without execution termination)

2010-12-08 Thread Pavel Stehule
Hello http://www.postgresql.org/docs/9.0/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING Regards Pavel Stehule 2010/12/9 Allan Kamau : > I am searching for the resource that explains how to handle SQL > related exceptions in PL/PgSQL without letting the function's > execution

Re: [GENERAL] Error handling in PL/PgSQL (without execution termination)

2010-12-08 Thread Allan Kamau
Thanks Pavel, this is exactly what I have been looking for. Allan On Thu, Dec 9, 2010 at 8:44 AM, Pavel Stehule wrote: > Hello > > http://www.postgresql.org/docs/9.0/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING > > Regards > > Pavel Stehule > > 2010/12/9 Allan Kamau : >> I

Re: [GENERAL] Implement online database using Postgresql

2010-12-08 Thread Kalai R
Thank You for your suggestion. Any other suggestions are welcome. On Tue, Dec 7, 2010 at 4:50 PM, Vincent Veyron wrote: > > Le mardi 07 décembre 2010 à 13:42 +0530, Kalai R a écrit : > > So please guide me, What should do to implement online postgresql > > database? > > You need a web server