Re: [GENERAL] psqlODBC connection

2011-10-20 Thread Mamatha_Kagathi_Chan
Thanks Ray and Edson, I was able to finally connect. And the ODBCAD32.exe for 32 as well as 64 bit compatible was present in SYSWOW64 folder. This ODBCAD32.exe contained the PostgreSQL driver in DNS window. Thanks for all the inputs which helped me to figure out the driver and connection string.

Re: [BUGS] [GENERAL] One-click installer, Windows 7 32-bit, and icacls.exe

2011-10-20 Thread Craig Ringer
On 10/21/2011 01:43 PM, Eric McKeeth wrote: As far as how to use icacls to set permisions on a directory (as opposed to the files in a directory) without recursing to all subdirectories, I never did succeed in finding that out. Could it depend on the presence or absence of a trailing slash? So

Re: [BUGS] [GENERAL] One-click installer, Windows 7 32-bit, and icacls.exe

2011-10-20 Thread Eric McKeeth
On Wed, Oct 5, 2011 at 1:24 AM, Dave Page wrote: > > > On Wednesday, October 5, 2011, Thomas Kellerer wrote: > > Dave Page, 04.10.2011 21:46: > > >> > >> We updated our build system to use BitRock 7 today (for unrelated > >> reasons) which has new features for ACL management. We're going to > >>

Re: [GENERAL] Reading PG data from MySQL stored procedure

2011-10-20 Thread Craig Ringer
On 10/21/2011 11:21 AM, Gauthier, Dave wrote: A big part of thisinquiry has to do with feasibility. Another option is to approach those who control that system which the user has to use and get them to be more accommodating with regard to attaching to more than one DB and realizing that there

Re: [GENERAL] Reading PG data from MySQL stored procedure

2011-10-20 Thread Gauthier, Dave
A big part of thisinquiry has to do with feasibility. Another option is to approach those who control that system which the user has to use and get them to be more accommodating with regard to attaching to more than one DB and realizing that there are other DB engines than MySQL. Armed with th

Re: [GENERAL] Reading PG data from MySQL stored procedure

2011-10-20 Thread Craig Ringer
On 10/21/2011 03:56 AM, Gauthier, Dave wrote: The software system they are being forced to use gives them the ability to send queries to a MySQL which has already been connected to. However, they do have the authority to add things to that DB, like stored procedures. This user isn't coding an

Re: [GENERAL] plpgsql at what point does the knowledge of the query come in?

2011-10-20 Thread Henry Drexler
On Thu, Oct 20, 2011 at 5:41 PM, Raymond O'Donnell wrote: > > Are you sure about this? Try using RAISE NOTICE statements in the > function to output the value of nnlength each time it's executed. > > Ray. > > Thank you for showing me the 'Rase Notice' , I had not seen that before and it helped me

Re: [GENERAL] Date Range Using Months and Days Only

2011-10-20 Thread Jeff Adams
This seems like it will be much faster, though I will most likely create epoch ranges and forgo creating timestamps for all of my epoch values in my table of 100+ million rows. Thanks again Adam! Jeff From: Adam Cornett [mailto:adam.corn...@gmail.com] Sent: Thursday, October 20, 2011 11:37

[GENERAL] force JDBC driver fetch / autocommit parameters?

2011-10-20 Thread S. Balch
Greetings, I'm using the postgresql-9.1-901.jdbc4 driver in an application (that I don't control) that's not passing along my specified fetch and autocommit parameters. Is there anyway I can force the driver to use my required parameters outside of the application? Thanks, Sean

Re: [GENERAL] plpgsql at what point does the knowledge of the query come in?

2011-10-20 Thread Henry Drexler
On Thu, Oct 20, 2011 at 5:42 PM, Raymond O'Donnell wrote: > > I was just trying to figure your function out... :-) I think you're > mistaken about step 3 - This statement - > > node = substring(newnode, 1, i-1) || substring (newnode, i+1, nnlength) > > - is contatenating two substrings - the firs

Re: [GENERAL] plpgsql at what point does the knowledge of the query come in?

2011-10-20 Thread Raymond O'Donnell
On 20/10/2011 22:42, Raymond O'Donnell wrote: > - is contatenating two substrings - the first bit (up to the i-th Whoops - "concatenating" :-) Ray. -- Raymond O'Donnell :: Galway :: Ireland r...@iol.ie -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to yo

Re: [GENERAL] Date Range Using Months and Days Only

2011-10-20 Thread Jeff Adams
Thanks for the reply and assistance. I share your concern that the approach may be slow. I am not adverse to creating some sort of table to store the time periods with years for the temporal extent of the data if that would speed up the process. In that situation there would be multiple records (on

Re: [GENERAL] plpgsql at what point does the knowledge of the query come in?

2011-10-20 Thread Raymond O'Donnell
On 20/10/2011 22:13, Henry Drexler wrote: > On Thu, Oct 20, 2011 at 4:57 PM, Raymond O'Donnell > wrote: > > > Not sure what you mean by the above... that statement only gets executed > once, so the value of nnlength doesn't change. > > Ray. > > > > doesn't the

Re: [GENERAL] how to disable all pkey/fkey constraints globally

2011-10-20 Thread Joe Abbate
On 10/20/2011 05:10 PM, J.V. wrote: > Is there a simpler way than this to query the database for meta-data and > get the constraint definitions? > > If I have the constraint name (which I do), I could store the constraint > definition to a file or database table and recreate them if I could get >

Re: [GENERAL] plpgsql at what point does the knowledge of the query come in?

2011-10-20 Thread Raymond O'Donnell
On 20/10/2011 22:31, Henry Drexler wrote: > > On Thu, Oct 20, 2011 at 4:57 PM, Raymond O'Donnell > wrote: > > > > Not sure what you mean by the above... > > Ray. > > > This is what I thought it was doing. > 1. it gets the node from the first row > 2. measures

Re: [GENERAL] plpgsql at what point does the knowledge of the query come in?

2011-10-20 Thread Henry Drexler
On Thu, Oct 20, 2011 at 4:57 PM, Raymond O'Donnell wrote: > > > Not sure what you mean by the above... > > Ray. > > This is what I thought it was doing. 1. it gets the node from the first row 2. measures its length 3. then loops through removing one character at a time and comparing that to th

Re: [GENERAL] plpgsql at what point does the knowledge of the query come in?

2011-10-20 Thread Henry Drexler
On Thu, Oct 20, 2011 at 4:57 PM, Raymond O'Donnell wrote: > > Not sure what you mean by the above... that statement only gets executed > once, so the value of nnlength doesn't change. > > Ray. doesn't the function get executed once for each row in the query? so in the below example thr wil

Re: [GENERAL] how to disable all pkey/fkey constraints globally

2011-10-20 Thread J.V.
Is there a simpler way than this to query the database for meta-data and get the constraint definitions? If I have the constraint name (which I do), I could store the constraint definition to a file or database table and recreate them if I could get the definition. This seems like a very sim

Re: [GENERAL] plpgsql at what point does the knowledge of the query come in?

2011-10-20 Thread Raymond O'Donnell
On 20/10/2011 21:51, Henry Drexler wrote: > I found the problem, it looks like nnlength := length(newnode); is not > getting reset > > create or replace function nnodetestt(text) returns text language > plpgsql as $$ > DECLARE > newnode alias for $1; > nnlength integer; > t text; > nmarker text; >

Re: [GENERAL] plpgsql at what point does the knowledge of the query come in?

2011-10-20 Thread Henry Drexler
I found the problem, it looks like nnlength := length(newnode); is not getting reset create or replace function nnodetestt(text) returns text language plpgsql as $$ DECLARE newnode alias for $1; nnlength integer; t text; nmarker text; BEGIN nnlength := length(newnode); for i in 1..(nnlength-1) loo

Re: [GENERAL] a set of key/value pairs

2011-10-20 Thread Merlin Moncure
On Thu, Oct 20, 2011 at 1:53 PM, J.V. wrote: > Does anyone have a specific example of how to: >    1) create a variable that is a set or array of key value pairs? >    2) how to populate each element of the array (each element being a key / > value pair) >    3) how to iterate through the list or

Re: [GENERAL] Reading PG data from MySQL stored procedure

2011-10-20 Thread Gauthier, Dave
The software system they are being forced to use gives them the ability to send queries to a MySQL which has already been connected to. However, they do have the authority to add things to that DB, like stored procedures. This user isn't coding anything per-se, they're just using the interface

Re: [GENERAL] Reading PG data from MySQL stored procedure

2011-10-20 Thread Merlin Moncure
On Thu, Oct 20, 2011 at 2:22 PM, Gauthier, Dave wrote: > Here's a real long shot, but what the heck... > > > > I have a user that's using a system that gives him a single MySQL DB handle > to work with.  He must get all his data through this handle.  He wants some > of my PG based data.  Not only

Re: [GENERAL] Extraneous Files

2011-10-20 Thread Ian Harding
Well, they are actually streaming replication slaves, and I boogered up the rsync command, so there they are. I diffed the directories from the master to the slave, and think I will go ahead and delete all the files that don't appear in both places and see what happens. Worst case, I have to set t

Re: [GENERAL] Extraneous Files

2011-10-20 Thread John R Pierce
On 10/20/11 12:14 PM, Karsten Hilbert wrote: Well, Ian isn't talking about removing data. What he was asking (I believe) is how to remove from the data directory files which got nothing to do with the database in question (but probably look like database files because, say, someone copied*another

[GENERAL] Reading PG data from MySQL stored procedure

2011-10-20 Thread Gauthier, Dave
Here's a real long shot, but what the heck... I have a user that's using a system that gives him a single MySQL DB handle to work with. He must get all his data through this handle. He wants some of my PG based data. Not only can't he open a new DB handle to my PG DB, but he cannot even run

[GENERAL] Cleaning up index names

2011-10-20 Thread Mike Blackwell
I have a database which was created with DDL from several different tools. Each one seems to have had their own naming convention for indexes. I'd like to rename them to be consistent. Has anyone seen a tool or put together a script to do this based on the catalog data?

Re: [GENERAL] a set of key/value pairs

2011-10-20 Thread John R Pierce
On 10/20/11 11:53 AM, J.V. wrote: Does anyone have a specific example of how to: 1) create a variable that is a set or array of key value pairs? 2) how to populate each element of the array (each element being a key / value pair) 3) how to iterate through the list or array retrieving

Re: [GENERAL] Extraneous Files

2011-10-20 Thread Karsten Hilbert
On Thu, Oct 20, 2011 at 02:32:18PM -0400, Scott Mead wrote: > On Thu, Oct 20, 2011 at 1:12 PM, Ian Harding wrote: > > > If someone happened to accidentally end up with a lot of files that > > were NOT part of their database in the data/base/X directory, how > > could they go about getting a

[GENERAL] plpgsql at what point does the knowledge of the query come in?

2011-10-20 Thread Henry Drexler
I am struggling to understand at what point the query knowledge comes into play here. Ideally it should look in nmarker and if there is an 'N' then execute the query (but how would it know that without running the query first?) and return the results in the nnodetest, but (in its current form it s

[GENERAL] a set of key/value pairs

2011-10-20 Thread J.V.
Does anyone have a specific example of how to: 1) create a variable that is a set or array of key value pairs? 2) how to populate each element of the array (each element being a key / value pair) 3) how to iterate through the list or array retrieving each key/value pair? Please do

Re: [GENERAL] Recovery from Archive files

2011-10-20 Thread Raghavendra
On Thu, Oct 20, 2011 at 11:58 PM, John R Pierce wrote: > On 10/20/11 2:33 AM, Raghavendra wrote: > >> Am assuming you are having $PGDATA (data directory) and their WAL >> Archives. >> > > he said he does not have the base backup ($PGDATA), so this is pointless. > > Ahh.. Agreed. I mis-read, I tho

Re: [GENERAL] Extraneous Files

2011-10-20 Thread Scott Mead
On Thu, Oct 20, 2011 at 1:12 PM, Ian Harding wrote: > If someone happened to accidentally end up with a lot of files that > were NOT part of their database in the data/base/X directory, how > could they go about getting a reliable list of files they could safely > delete? The files were ther

Re: [GENERAL] Recovery from Archive files

2011-10-20 Thread John R Pierce
On 10/20/11 2:33 AM, Raghavendra wrote: Am assuming you are having $PGDATA (data directory) and their WAL Archives. he said he does not have the base backup ($PGDATA), so this is pointless. -- john r pierceN 37, W 122 santa cruz ca mid-left

Re: [GENERAL] inserting bytea using PHPs pg_escape_bytea()

2011-10-20 Thread Jeff Davis
On Thu, 2011-10-20 at 14:13 -0300, Martín Marqués wrote: > How would that work with abstraction layers like MDB2 or PDO? I'm not sure. If there isn't some way to use parameterized queries, then it's not a very good abstraction layer, in my opinion (because parameterized queries are widely recogniz

Re: [GENERAL] inserting bytea using PHPs pg_escape_bytea()

2011-10-20 Thread Martín Marqués
El día 20 de octubre de 2011 14:28, Rodrigo Gonzalez escribió: > El 20/10/11 14:13, Martín Marqués escribió: > > El día 19 de octubre de 2011 23:20, Jeff Davis escribió: > > On Wed, 2011-10-19 at 14:30 -0300, Martín Marqués wrote: > > The only concern I have is that on insertion, I get this WARNI

Re: [GENERAL] Postgresql - FDW, ForeignScanState and subqueries

2011-10-20 Thread Tom Lane
Ronan Dunklau writes: > Now, if I query my table like this (a subquery, joined on the outer query), > what info should I be able to parse from the PlanState ? > select name, (select max(value) from test t2 where t2.name = t1.name) as max > from test t1; > I don't really know much about postgresq

Re: [GENERAL] inserting bytea using PHPs pg_escape_bytea()

2011-10-20 Thread Rodrigo Gonzalez
El 20/10/11 14:13, Martín Marqués escribió: El día 19 de octubre de 2011 23:20, Jeff Davis escribió: On Wed, 2011-10-19 at 14:30 -0300, Martín Marqués wrote: The only concern I have is that on insertion, I get this WARNING: WARNING: nonstandard use of \\ in a string literal at character 41 H

Re: [GENERAL] inserting bytea using PHPs pg_escape_bytea()

2011-10-20 Thread Martín Marqués
El día 19 de octubre de 2011 23:20, Jeff Davis escribió: > On Wed, 2011-10-19 at 14:30 -0300, Martín Marqués wrote: >> The only concern I have is that on insertion, I get this WARNING: >> >> WARNING:  nonstandard use of \\ in a string literal at character 41 >> HINT:  Use the escape string syntax

[GENERAL] Extraneous Files

2011-10-20 Thread Ian Harding
If someone happened to accidentally end up with a lot of files that were NOT part of their database in the data/base/X directory, how could they go about getting a reliable list of files they could safely delete? The files were there before the current incarnation of the database, so have ctim

Re: [GENERAL] timeline X of the primary does not match recovery target timeline Y

2011-10-20 Thread Jeff Davis
On Thu, 2011-10-20 at 12:45 -0400, Adam Tistler wrote: > Yes you understood correctly. Would the same apply for a hot standby > situation? Right. Hot standby just means that you can query (read-only) an instance that's still in recovery. Basically, going from recovery mode (or hot standby, whic

Re: [GENERAL] timeline X of the primary does not match recovery target timeline Y

2011-10-20 Thread Adam Tistler
Yes you understood correctly. Would the same apply for a hot standby situation? On Oct 20, 2011, at 12:00 PM, Jeff Davis wrote: > On Mon, 2011-09-26 at 08:54 -0400, Adam Tistler wrote: >> I am trying to set up master/slave warm standby streaming replication >> (9.1). I am not doing archiving/lo

[GENERAL] Postgresql - FDW, ForeignScanState and subqueries

2011-10-20 Thread Ronan Dunklau
Hello. Sorry if this is not the appropriate mailing list, but I understood that I needed to post here first. Warning: I'm not a native english speaker ;) I'm implementing a Foreign Data Wrapper, and I'm trying to "optimize" it by parsing the required columns and simple "quals" from the foreignsc

Re: [GENERAL] timeline X of the primary does not match recovery target timeline Y

2011-10-20 Thread Jeff Davis
On Mon, 2011-09-26 at 08:54 -0400, Adam Tistler wrote: > I am trying to set up master/slave warm standby streaming replication > (9.1). I am not doing archiving/log shipping. I have read that you > cannot reverse roles between the master and slave, and that once a > slave is "promoted", you need

Re: [GENERAL] Date Range Using Months and Days Only

2011-10-20 Thread Adam Cornett
On Thu, Oct 20, 2011 at 8:42 AM, Jeff Adams wrote: > Thanks for the reply and assistance. I share your concern that the approach > may be slow. I am not adverse to creating some sort of table to store the > time periods with years for the temporal extent of the data if that would > speed up the p

Re: [GENERAL] psqlODBC connection

2011-10-20 Thread Raymond O'Donnell
On 20/10/2011 05:23, mamatha_kagathi_c...@dell.com wrote: > Hi Ray, > > Thanks for the help. Since I am using classic ASP this is exactly > what I am looking for. But there is a problem here. When I go the > "Create New Data Source" window as mentioned in step ii, Ifind only > sql server and Oracl

Re: [GENERAL] Recovery from Archive files

2011-10-20 Thread Raghavendra
On Thu, Oct 20, 2011 at 10:01 AM, senthilnathan wrote: > Thanks John., > > Yes its from WAL Archives. I dont have the basebackup instead i am having > all the WAL files that are archived right from the server start. My > question > is how(steps?) to to build whole setup(postgres server)by replayin

[GENERAL] archive_timeout runtime change

2011-10-20 Thread Birta Levente
Hi I use postgrsql 9.1.1 and I want to change archive_timeout on a running server. My default archive_timeout is 1800s, and nightly I want to change to 3600s or more, but I get the following error message: set archive_timeout='3600'; ERROR: parameter "archive_timeout" cannot be changed now

Re: [GENERAL] Recovery from Archive files

2011-10-20 Thread John R Pierce
On 10/19/11 9:31 PM, senthilnathan wrote: Thanks John., Yes its from WAL Archives. I dont have the basebackup instead i am having all the WAL files that are archived right from the server start. My question is how(steps?) to to build whole setup(postgres server)by replaying all WAL files WAL f