Re: [GENERAL] Using cp to back up a database?

2017-10-09 Thread Darren Douglas
-ar instead. The 'a' option invokes cp in "archive" mode, which will preserve file permissions. On Mon, Oct 9, 2017 at 9:49 AM, Darren Douglas wrote: > Ron: > > Here is an explanation that may help a bit. > > Your script is executing a PHYSICAL backup. A physica

Re: [GENERAL] Using cp to back up a database?

2017-10-09 Thread Darren Douglas
LECT pg_stop_backup();" > > > Should it use rsync or pg_dump instead? > > Thanks > > -- > World Peace Through Nuclear Pacification > > -- Darren Douglas Synse Solutions dar...@synsesolutions.com 520-661-5885

Re: [GENERAL] How to recover my postgres database ?

2017-05-11 Thread Hunley, Douglas
;ll need to restore from that backup and then get pgbackrest (or another equivalent tool) up and running to protect yourself going forward -- { "name" : "douglas j hunley", "title" : "database engineer", "email" : "douglas.hun...@openscg.com ", "mobile" : "+1 614 316 5079" }

Re: [GENERAL] PG_MODULE_MAGIC issue with small extension

2016-09-02 Thread Brent Douglas
Thanks a lot Tom, it works as expected now. When reading the docs I must have skipped to the code block without properly reading the sentence above. Brent On Fri, Sep 2, 2016 at 11:19 AM, Tom Lane wrote: > Brent Douglas writes: > > pg_zlib.c:24:1: warning: type specifier missing, de

Re: [GENERAL] PG_MODULE_MAGIC issue with small extension

2016-09-02 Thread Brent Douglas
rfering. Brent On Fri, Sep 2, 2016 at 11:07 AM, Tom Lane wrote: > Brent Douglas writes: > > What I have found however is that when I go to load my extensions I get > > this error: > > test=# create extension pg_zlib; > > ERROR: incompatible library "/usr/loca

[GENERAL] PG_MODULE_MAGIC issue with small extension

2016-09-02 Thread Brent Douglas
Hello all, I'm not sure if this is the correct list for extensions, if not please let me know where this should be sent too. I have a mid sized append only table that is read fairly infrequently and contains 2 columns that contain on average about 0.5Kb and 2Kb of xml per row. In an attempt to sa

Re: [GENERAL] pg_dump 8.4.9 failing after upgrade to openssl-1.0.1e-30.el6_6.11.x86_64 on redhat linux

2015-06-19 Thread Douglas Stetner
> > On 18 Jun 2015, at 02:06 , Tom Lane wrote: > > Douglas Stetner writes: >> Looking for confirmation there is an issue with pg_dump failing after >> upgrade to openssl-1.0.1e-30.el6_6.11.x86_64 on redhat linux. > > Quick thought --- did you restart the Po

Re: [GENERAL] pg_dump 8.4.9 failing after upgrade to openssl-1.0.1e-30.el6_6.11.x86_64 on redhat linux

2015-06-18 Thread Douglas Stetner
> > On 18 Jun 2015, at 02:06 , Tom Lane wrote: > > Douglas Stetner writes: >> Looking for confirmation there is an issue with pg_dump failing after >> upgrade to openssl-1.0.1e-30.el6_6.11.x86_64 on redhat linux. > > Quick thought --- did you restart the Po

[GENERAL] pg_dump 8.4.9 failing after upgrade to openssl-1.0.1e-30.el6_6.11.x86_64 on redhat linux

2015-06-17 Thread Douglas Stetner
Hi all, Looking for confirmation there is an issue with pg_dump failing after upgrade to openssl-1.0.1e-30.el6_6.11.x86_64 on redhat linux. -bash-4.1$ pg_dump -V pg_dump (PostgreSQL) 8.4.9 -bash-4.1$ pg_dump -h localhost -C Hogwarts -a -t mafs -f zz pg_dump: Dumping the contents of table "mafs

[GENERAL] pg_dump 8.4.9 failing after upgrade to openssl-1.0.1e-30.el6_6.11.x86_64 on redhat linux

2015-06-16 Thread Douglas Stetner
Admin3.app remotely from a Mac As stated I am fairly sure the cause was the upgrade of openssl as it started to fail the next day: Jun 16 05:18:25 qcmg-database1 yum[2965]: Updated: openssl-1.0.1e-30.el6_6.11.x86_64 Douglas Stetner Mobile 0474 082 019 UNIX - Live Free Or Die sig

Re: [GENERAL] new index type with clustering in mind.

2014-12-11 Thread Jack Douglas
> Currently, one issue you're going to face is that brin doesn't rescan a range to > find the tighest possible summary tuple. That's going to be an issue I think, thanks for mentioning it. We'd need some sort of mechanism for achieving this without a complete REINDEX, even if it only reset the min

Re: [GENERAL] new index type with clustering in mind.

2014-12-10 Thread Jack Douglas
> If the values are perfectly clustered, the index is optimal because you scan the minimal set of pages. That's the bit I'm particularly interested in, as my plan would be to keep the pages well clustered: http://dba.stackexchange.com/a/66293/1396 Do you see any blocker preventing BRIN being used

Re: [GENERAL] new index type with clustering in mind.

2014-12-10 Thread Jack Douglas
> in 9.4, GIN indexes are pretty close to this already Do I understand correctly that BRIN indexes will be even closer to this? Kindest regards Jack -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: 24 May 2014 22:46 To: Martijn van Oosterhout Cc: Jack Douglas; pg

Re: [GENERAL] Whats is lock type transactionid?

2014-07-17 Thread Douglas J Hunley
identify the tuple. > Have you tried the lock monitoring queries on http://wiki.postgresql.org/wiki/Lock_Monitoring yet by chance? -- Douglas J Hunley (doug.hun...@gmail.com)

Re: [GENERAL] Whats is lock type transactionid?

2014-07-17 Thread Douglas J Hunley
That will succeed only when the other transaction terminates and releases its locks. I believe that describes what you're seeing -- Douglas J Hunley (doug.hun...@gmail.com)

Re: [GENERAL] new index type with clustering in mind.

2014-06-03 Thread Jack Douglas
> > > To reduce complexity (eg MVCC/snapshot related issues), index entries > > > would be added when a row is inserted, but they would not be removed > > > when the row is updated/deleted (or when an insert is rolled back): > > It's an interesting idea, but, how can you *ever* delete index ent

Re: [GENERAL] new index type with clustering in mind.

2014-05-26 Thread Jack Douglas
> The discussions at PGCon pointed out that with the posting-list compression logic added in 9.4, GIN indexes are pretty close to this already. Multiple items on the same heap page will typically only take one byte of index space per item; but there is an identifiable entry, so you don't get into

[GENERAL] new index type with clustering in mind.

2014-05-24 Thread Jack Douglas
Hi Please forgive this question if it is naïve. Would the following be practical to implement: A btree-like index type that points to *pages* rather than individual rows. Ie if there are many rows in a page with the same data (in the indexed columns), only one index entry will exist. In

[GENERAL] Data Checksum feature and streaming replication

2014-05-24 Thread Jack Douglas
I posted this question on dba.se (http://dba.stackexchange.com/q/65821/1396) and was advised to try asking here. If I'm using the Data Checksum feature (new to 9.3: https://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.3#Data_Checksu ms), and in the event of a checksum failure on a repl

[GENERAL] returning clause and source columns

2014-05-12 Thread Jack Douglas
Hi Related to this post: http://dba.stackexchange.com/q/50693/1396 Would it be a major change to allow the `returning` clause of `insert` to return values that are *not* inserted? It seems you can already do so for literals (and perhaps that should be made explicit in the docs here: http://

Re: [GENERAL] table dump function

2013-03-07 Thread Little, Douglas
al Message- From: Adrian Klaver [mailto:adrian.kla...@gmail.com] Sent: Thursday, March 07, 2013 12:19 PM To: Little, Douglas Cc: PostgreSQL General (pgsql-general@postgresql.org) Subject: Re: [GENERAL] table dump function On 03/07/2013 08:42 AM, Little, Douglas wrote: > Thanks for the sugg

Re: [GENERAL] table dump function

2013-03-07 Thread Little, Douglas
Thanks for the suggestion Adrian, Unfortunately, my process is executing from psql, so to start pg_dump from within psql is a bit challenging. We have 1 instance where we start an OS process from a function, but it's new territory for us. My function is dumping everything but the ACL grant

Re: [GENERAL] FW: statement failure

2013-03-07 Thread Little, Douglas
build. Thanks From: Merlin Moncure [mailto:mmonc...@gmail.com] Sent: Wednesday, March 06, 2013 9:47 AM To: Little, Douglas Cc: PostgreSQL General (pgsql-general@postgresql.org) Subject: Re: [GENERAL] FW: statement failure On Wed, Mar 6, 2013 at 9:38 AM, Little, Douglas mailto:douglas.lit

[GENERAL] table dump function

2013-03-07 Thread Little, Douglas
I need a pl/pgsql function that will dump a table ddl so I can export the definition to a file before I drop the object. the psql \d command won't work, since it doesn't dump the table ddl, it just lists the table's attributes and indexes. I've got the function mostly working, but need help

[GENERAL] FW: statement failure

2013-03-06 Thread Little, Douglas
Hi, I have a dev and prod Greenplum system (4.2.2.4) that is based on PG 8.2.15 I have a function that's been working fine on dev, but when implemented in prod had a syntax error. I was easily able to fix by casting, but I can't see why the message didn't show up on our dev machine. I've review

[GENERAL] design question - repeated updates on temp or perm table.

2013-02-12 Thread Little, Douglas
Hi, Design question. Does it make a difference for a function to repeatedly update a temp table verses the permanent table? We are working in a data warehousing environment. We have daily etl that's used to update our dimension table which has approx. 500k rows. A dimension row holds all of the

[GENERAL] Reverse Engr into erwin

2013-02-04 Thread Little, Douglas
Thanks in advance for thinking about my problem. As I suspect you know, CA Erwin doesn't support Postgres or greenplum. But they do support ODBC for reverse engineering. When I reverse, Erwin executes the standard ODBC metadata queries for the system catalog. The process works fine, but I'm fin

Re: [GENERAL] psql question

2013-01-31 Thread Little, Douglas
Visit/part*' ) Runtime log ERROR: syntax error at or near ":" LINE 44: 'gphdfs://':filepath'/DimSiteVisit/part*' I think I'm going to shift down to using shell features. Thanks again for the help. From: Steve Crawford [mailto:scrawf...@pinpointresea

[GENERAL] psql question

2013-01-30 Thread Little, Douglas
I'm looking for a way where I can tailor DDL scripts for deployment with environment variables. Support I have a requirement to prefix table names with dev_ , fqa_, or prod_ I'd like to have a file for each env with their own unique settings - host, dbname Dev.sql \set env dev Fq

[GENERAL] evaluating expressions stored in table

2012-12-18 Thread Little, Douglas
Hi, I need to evaluate an expression that I have stored in a table, and not sure how to force evaluation of a column value. Some background. This is a generic testing application that we're using to test source to target ETL's. The specifics of the test expression depend on the actual tables

Re: [GENERAL] Getting show results into a table

2012-11-28 Thread Little, Douglas
Thanks everybody.Always wondered where the command was sourcing the data. Thanks -Original Message- From: Guillaume Lelarge [mailto:guilla...@lelarge.info] Sent: Wednesday, November 28, 2012 3:24 PM To: Little, Douglas Cc: PostgreSQL General (pgsql-general@postgresql.org) Subject

[GENERAL] Getting show results into a table

2012-11-28 Thread Little, Douglas
Is there a way in sql to get the results of the show all command into a table? I'm expecting something like Insert into Config_history as select * from (show all); Doug Little Sr. Data Warehouse Architect | Business Intelligence Architecture | Orbitz Worldwide 500 W. Madison, Suite 1000 Chi

Re: [GENERAL] psql & unix env variables

2012-08-29 Thread Little, Douglas
Thanks -Original Message- From: Ryan Kelly [mailto:rpkell...@gmail.com] Sent: Wednesday, August 29, 2012 12:41 PM To: Little, Douglas Cc: PostgreSQL General (pgsql-general@postgresql.org) Subject: Re: [GENERAL] psql & unix env variables On Wed, Aug 29, 2012 at 12:35:32PM -0500, Li

[GENERAL] psql & unix env variables

2012-08-29 Thread Little, Douglas
Is there a method for having unix env variables incorporated into a psql sql statement? Ie Export var='dev' Psql =c 'select count(*) from $var.customer;' Doug Little Sr. Data Warehouse Architect | Business Intelligence Architecture | Orbitz Worldwide 500 W. Madison, Suite 1000 Chicago IL 606

[GENERAL] cast name to oid

2012-08-14 Thread Little, Douglas
I got my function dump function to work. Enhancing to handle errors if the object doesn't exist. I want to add an exception block, to trap the object not found error. But when I changed the input parameter type from regproc to text, I was no longer getting matches. I am trying to explicitly c

[GENERAL] Function to dump function ddl

2012-08-09 Thread Little, Douglas
Hi, In deploying new versions of function source, I want to export the current definition to a file. After looking around it seems that I needed to create my own function. I got the function to work, but am having a slight problem with the execution of the exported file. It seems that if I inclu

[GENERAL] conversion from epoch

2012-07-30 Thread Little, Douglas
I have an input source that is in epoch time.Is there a built-in conversion to changing to timestamp Thanks Doug Little Sr. Data Warehouse Architect | Business Intelligence Architecture | Orbitz Worldwide 500 W. Madison, Suite 1000 Chicago IL 60661| Office 312.260.2588 | Fax 312.894.516

[GENERAL] log select access

2012-07-26 Thread Little, Douglas
Hello everybody, For PCI compliance I need to log user access to my PCI columns in a table and retain for 2 years. I know I can grep the log, but with 1m log rows/day and infrequent PCI access, I'm thinking this isn't the most efficient method. I've been thinking about a SELECT rule, for the

[GENERAL] error handling

2012-06-20 Thread Little, Douglas
Hello, Greenplum 4.1.2.4 (PG 8.2.3) We are revising how we implement functions in order to better capture and handle fatal errors. What we want to have happen, 1. is to have the fatal error captured, 2. logged to our processing table, 3. then have the function & psql exit wi

[GENERAL] composite type use in pl/gpsql

2012-06-13 Thread Little, Douglas
Merlin writes" first, the way to do insert from composite type is like this: insert into foo select (f).*; if f is type of foo. The actual error you're getting is probably" I gave this a try. Still bumping into syntax errors CREATE TYPE oww_mart_tbls.type_log_site_process AS (proc_id i

[GENERAL] composite type use in pl/gpsql

2012-06-13 Thread Little, Douglas
Hello, Thanks in advance for taking my question. Running on Greenplum 4.1.2/ based on PG 8.2.3 kernal We make extensive use of functions to do our ETL. So, I'm building a stored procedure template for our developers. I'd like the template to log the sql statements to a logging table for audit/deb

[GENERAL] describe command for

2012-06-08 Thread Little, Douglas
Is there a postgres sql command/function that will display an object ddl? I know of the psql metacharacters, but don't know how I'd submit from a non-psql client like sqldbx. I see that pgadmin generates a query and then formats into a ddl statement, but this seems like a lot of work for someth

[GENERAL] normalizing & join to table function

2012-01-31 Thread Little, Douglas
Hello, Need some help. Hoping some of the smart people might know how to solve this. I'd like to replace all name/value pairs in a delimited string with the id of the name/value pair in my reference table. Eg St=IL&city=Chicago&street=Madison To 13&50&247 Assuming St=IL is id 13, city=Chica

[GENERAL] help with normalizing

2012-01-30 Thread Little, Douglas
Hello, Need some help. Hoping some of the smart people might know how to solve this. I'd like to replace all name/value pairs in a delimited string with the id of the name/value pair in my reference table. Eg St=IL&city=Chicago&street=Madison To 13&50&247 Assuming St=IL is id 13, city=Chicag

[GENERAL] [RFE] auto ORDER BY for SELECT

2012-01-23 Thread Douglas Eric
I'm not sure if this is the right list to discuss this, but, I have a suggestion: ORDER BY clause, as defined in the SELECT documentation says: "If ORDER BY is not given, the rows are returned in whatever order the system finds fastest to produce" This order is usually not wanted, as it is not p

[GENERAL] hash options

2012-01-22 Thread Little, Douglas
Hello, I'm working on a data warehouse dimensionalization process where I need to hash a text string to use as the key. I've implemented with MD5. It works fine, the problem I have is the size of the md5 (32 bytes) is often longer than the original string - thus not accomplishing what I wan

[GENERAL] problems viewing information_schema.schemata

2011-07-27 Thread Little, Douglas
Hi, Some of my users are using sqldbx and it's not working due to a dependence on displaying the content of information_schema.schemata When I query the view I see content. When they do it, nothing - 0 rows - from sqldbx, pgadmin or other client. I suspect that they don't have access to a cata

[GENERAL] String library

2011-05-27 Thread Little, Douglas
I'm working a string parser. Is there a user module that expands the set of string functions? Doug Little Sr. Data Warehouse Architect | Business Intelligence Architecture | Orbitz Worldwide 500 W. Madison, Suite 1000 Chicago IL 60661| Office 312.260.2588 | Fax 312.894.5164 | Cell 847-997-

[GENERAL] "interval hour to minute" or "interval day to minute"

2011-04-17 Thread Jack Douglas
day + 10 hours 5 minutes'::interval hour to minute; interval ------ 3 years 2 mons -1 days +10:05:00 (1 row) Warm regards Jack Douglas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] psql dynamic comments

2010-10-06 Thread Little, Douglas
I'm trying to generate a comment on all my changes - so I know when they were completed. Does anybody have anything that does this. I think the psql script is something like d1gp1=> \set currtime `date '+20%y-%m-%d %H:%M:%S'` d1gp1=> \echo :currtime 2010-10-06 10:01:51 d1gp1=> comment on index

Re: [GENERAL] [SQL] Difference between these two queries ?

2010-06-06 Thread Little, Douglas
Nilesh, They should generate equivalent results, But the difference is the constraint on bu.bid=5. In the 1st case it's being done after the join. In the 2nd case it is being done before the join. The end result should be the same, but the execution time can be hugely different. Suppose b ha

Re: [GENERAL] ALTER Bigserial error

2010-05-25 Thread Little, Douglas
iginal Message- From: Scott Marlowe [mailto:scott.marl...@gmail.com] Sent: Monday, April 26, 2010 3:49 PM To: Little, Douglas Cc: Tom Lane; pgsql-general@postgresql.org Subject: Re: [GENERAL] ALTER Bigserial error On Mon, Apr 26, 2010 at 12:59 PM, Little, Douglas wrote: > Thanks for the response

[GENERAL] object tracking

2010-05-19 Thread Little, Douglas
Hi, I have a fairly large data warehouse in Greenplum, and am having trouble tracking object changes. I need to 1.Know when an object was changed, by who. 2. Have some logging about when an object was dropped - especially drop cascade. Currently I'm having a problem with a set

[GENERAL] Auditing usage

2010-05-12 Thread Little, Douglas
Hi, Is there anything in the system that would aid tracking who/how often an object (table/column/function/view) is accessed? In Teradata we have an accesslog table that record attempted access to an object and if it's granted or denied. Very important to our sox's folks. Thanks Doug Little

Re: [GENERAL] ALTER Bigserial error

2010-04-26 Thread Little, Douglas
Thanks for the response tom, I agree it's more of an missing feature. Regarding the concensus for direction. I'd like to see the product move in the direction of the sql standard. Overloading types with macro's probably wasn't a good idea, since it leads people like me astray. Maybe the doc

[GENERAL] ALTER Bigserial error

2010-04-25 Thread Little, Douglas
Hi, I'm trying to alter in a bigserial on GP/PG 8.1 I'm getting the error ERROR: type "bigserial" does not exist SQL state: 42704 I understand that bigserial isn't a 'true' type, that it's a notational convenience. And that I can alter in the default. But it is listed in the type table in the

[GENERAL] MS Access 2007 update write conflict problem & resolution

2010-03-19 Thread Little, Douglas
Hi, We've been struggling with an MS Access 2007 app that updates a PG table. It was working, and then it wasn't. It looks like we recreated the table without specifying the precision on the timestamp columns. PG is defaulting to timestamp(6), which doesn't work with MS Access. The finest p

[GENERAL] SQL select return into PSQL variables.

2010-02-18 Thread Little, Douglas
Hello, I want to get a sql select output into a psql variable. Any ideas how I might need to do this. My script executes a function which returns a TESTID. I'd like to imbed the testid in the script output filenames. I see that psql can set environment variables with the psql \i command. But

Re: [GENERAL] ERROR: could not load library "...": Exec format error

2010-02-09 Thread Korry Douglas
pending on which version of HP/UX you are using). -- Korry ------- Korry Douglas Senior Database Dude EnterpriseDB Corporation The Enterprise Postgres Company Phone: (804)241-4301 Mobile: (620) EDB-NERD -- Sent via pgsql-gen

[GENERAL] revoke from all users

2010-01-25 Thread Little, Douglas
Is there a form of the revoke command that will revoke specific privileges from all users? Thanks Doug Little Sr. Data Warehouse Architect | Enterprise Data Management | Orbitz Worldwide 500 W. Madison, Suite 1000 Chicago IL 60661| Office 312.260.2588 | Fax 312.894.5164 | Cell 847-997-5741 do

[GENERAL] column level encryption & select rules

2009-12-18 Thread Little, Douglas
Hi, I've implemented a scheme for column level encryption that uses table triggers (isrt/update) to encrypt the input data, and a view To perform the decrypt. It's working ok, but I'm having trouble altering my objects because of the dependents. To implement the scheme, I have to generate the

Re: [GENERAL] Pgadmin support for writing files or psql \copy command

2009-10-27 Thread Little, Douglas
From: Little, Douglas Sent: Tuesday, October 27, 2009 4:31 PM To: 'pgsql-gene...@postgresql.org.' Subject: Pgadmin support for writing files or psql \copy command Hi, I have a script I'd like to submit from pgadmin that needs to export query re

Re: [GENERAL] Right Join Question

2009-10-23 Thread Little, Douglas
Andrew, I think you want a full outer join. If I understood correctly, you want all real data, plus all codes without data. Doug -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Scott Marlowe Sent: Thursday, October

[GENERAL] object dependency workaround

2009-10-05 Thread Little, Douglas
Hello, We're migrating to Greenplum, and in our currently portfolio we base everything on views. In our prior system, we could alter tables and then refresh the views, but in PG/greenplum most alters are blocked because of the dependent objects. I understand that I can walk the pg_depends table

Re: [GENERAL] How can I manually alter the statistics for a column?

2009-06-02 Thread Douglas Alan
On Tue, Jun 2, 2009 at 9:52 AM, Tom Lane wrote: > > delete from pg_statistic > where (starelid, staattnum) in > (select attrelid, attnum from pg_attribute > where attrelid = 'my_relation'::regclass and attname = 'my_attribute'); > > regclass knows about schemas and search paths, so stuff like

Re: [GENERAL] How can I manually alter the statistics for a column?

2009-06-02 Thread Douglas Alan
r the specified column in the specified table. |>ouglas On Mon, Jun 1, 2009 at 2:20 PM, Douglas Alan wrote: > I'd like to manually alter the statistics for a column, as for the column > in question the statistics are causing Postgres to do the wrong thing for my > purposes. (I.e., a S

[GENERAL] How can I manually alter the statistics for a column?

2009-06-01 Thread Douglas Alan
I'd like to manually alter the statistics for a column, as for the column in question the statistics are causing Postgres to do the wrong thing for my purposes. (I.e., a Seq Scan, rather than an Index Scan.) If someone can tell me how to achieve this, I would quite grateful. Thanks! |>ouglas P.

Re: [GENERAL] What is the right way to deal with a table with rows that are not in a random order?

2009-05-29 Thread Douglas Alan
Scott Marlowe wrote: > Douglas Alan wrote: >> Okay -- no problem: >> >>set enable_seqscan = on; >>explain analyze select * from maindb_astobject >>where survey_id = 2 >>limit 1000; >> >>"Limit (cost=0.00..48.03 rows=1

Re: [GENERAL] What is the right way to deal with a table with rows that are not in a random order?

2009-05-28 Thread Douglas Alan
Scott Marlowe wrote: > Douglas Alan wrote: >> I'm worried that turning off seqscan would distort other queries. >> (Remember, I don't have control of the individual queries.  The >> user of the application can specify all sorts of queries, and >> there'

Re: [GENERAL] What is the right way to deal with a table with rows that are not in a random order?

2009-05-28 Thread Douglas Alan
On Thu, May 28, 2009 at 5:52 PM, Simon Riggs wrote: > > On Thu, 2009-05-28 at 15:03 -0400, Douglas Alan wrote: > > > The application in question is a kind of data warehousing thing (of > > astronomical stars), and there's an ORM in the middle, so it's not &

Re: [GENERAL] What is the right way to deal with a table with rows that are not in a random order?

2009-05-28 Thread Douglas Alan
On Thu, May 28, 2009 at 10:41 AM, Scott Marlowe wrote: > Note that in the OPs case I'd probably try testing things like turning > off seqscan, or lowering random_page_cost. I'd also look at > clustering on the index for the field you're selecting on. I'm worried that turning off seqscan would d

Re: [GENERAL] What is the right way to deal with a table with rows that are not in a random order?

2009-05-28 Thread Douglas Alan
On Thu, May 28, 2009 at 10:24 AM, Scott Marlowe wrote: >  OTOH, if you've got it all sussed out, then ignore the request for more > information. I don't *know* if I have it "all sussed out", but I *do* know why Postgres is doing what it is doing in this particular case. It's assuming that the

Re: [GENERAL] What is the right way to deal with a table with rows that are not in a random order?

2009-05-28 Thread Douglas Alan
On Thu, May 28, 2009 at 4:14 AM, Simon Riggs wrote: > Partition the table, then scan the correct partition. If I do that, will Postgres figure out the "right thing" to do if the parent table is queried instead?  Also, what are the performance implications then for doing queries that span all the

Re: [GENERAL] What is the right way to deal with a table with rows that are not in a random order?

2009-05-27 Thread Douglas Alan
On Wed, May 27, 2009 at 8:54 PM, Jeff Davis wrote: > If you're putting a LIMIT on it, why does it return millions of results? > It *doesn't* return millions of results with the LIMIT on it. It just does a sequential scan of the table and doesn't find any results until it gets to the last quart

[GENERAL] What is the right way to deal with a table with rows that are not in a random order?

2009-05-27 Thread Douglas Alan
We have a very large table (150 million rows) where the rows are not in a random order. Some common queries will have millions of results, and this of course is slow. For an interactive interface to the database, we want to put a limit on all queries so that queries will return quickly even if th

[GENERAL] vista failed to install postgresql

2009-05-27 Thread douglas
tried to install postgresql on vista ultimate, with uac turned off,( install user belongs to administrators group) tried the binary install and then the source install with mingw the binary , wouldn't start service, install ended then and there . the source with mingw gave me an error 2 is th

Re: [GENERAL] How to compile a 32 bit version of postgres on a x64 machine.

2009-03-28 Thread Douglas McNaught
On Thu, Mar 26, 2009 at 6:43 AM, Tim Uckun wrote: > It looks like most avenues for high availability with postgres are not > available if one of the machines is a 64 bit machine and the other a 32. > > Somebody on this list suggested I install a 32 bit version of postgres on my > x64 machine.  Wha

Re: [GENERAL] pgsql announce now on twitter

2009-03-06 Thread Douglas J Hunley
On Thursday 05 March 2009 21:15:08 Mark Styles wrote: > BTW, Identica has group support, and I created a postgres group a while > ago. You can join it here: > > http://identi.ca/group/postgres Joined -- Douglas J Hunley (doug at hunley.homeip.net) -- Sent via pgsql-general mailing

Re: [GENERAL] pgsql announce now on twitter

2009-03-05 Thread Douglas J Hunley
On Wednesday 04 March 2009 15:39:36 Mark Styles wrote: > On Tue, Mar 03, 2009 at 09:38:39PM -0500, Douglas J Hunley wrote: > > I really wanted to let everyone know that I've created @PGSQL_Announce on > > Twitter and setup a cron job to parse the feed and post it to Twitter. &

Re: [GENERAL] pgsql announce now on twitter

2009-03-04 Thread Douglas J Hunley
On Wednesday 04 March 2009 15:39:36 Mark Styles wrote: > On Tue, Mar 03, 2009 at 09:38:39PM -0500, Douglas J Hunley wrote: > > I really wanted to let everyone know that I've created @PGSQL_Announce on > > Twitter and setup a cron job to parse the feed and post it to Twitter. &

Re: [GENERAL] pgsql announce now on twitter

2009-03-04 Thread Douglas J Hunley
I have per week over 1000 Tritter spam I've had good response reporting said spammers to the @spam account on twitter. Sorry to hear you're not getting the traction needed. Since we're way off-topic for these lists, I'm out. Hope things get better for you. Thanks for the respo

Re: [GENERAL] pgsql announce now on twitter

2009-03-04 Thread Douglas J Hunley
On Wednesday 04 March 2009 01:58:14 Michelle Konzack wrote: > Am 2009-03-03 21:38:39, schrieb Douglas J Hunley: > > Hi everyone: > > I really wanted to let everyone know that I've created @PGSQL_Announce on > > Twitter and setup a cron job to parse the feed and post it

[GENERAL] pgsql announce now on twitter

2009-03-03 Thread Douglas J Hunley
hope someone can find use in this. (PS - I'm not on these lists. CC me if you want me to see your response) -- Douglas "Just-scratching-his-own-itch" Hunley (doug at hunley.homeip.net) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to you

Re: [GENERAL] Error in ALTER DATABASE command

2008-09-23 Thread Douglas McNaught
On Tue, Sep 23, 2008 at 11:49 AM, William Garrison <[EMAIL PROTECTED]> wrote: > In Postgresql 8.2.9 on Windows, you cannot rename a database if the name > contains mixed case. > 3) Open a query window, or use PSQL to issue the following command > ALTER DATABASE MixedCase RENAME TO anything_else;

Re: [GENERAL] offtopic, about subject prefix

2008-09-20 Thread Douglas McNaught
On Fri, Sep 19, 2008 at 3:01 PM, Michelle Konzack <[EMAIL PROTECTED]> wrote: > Am 2008-09-03 13:33:05, schrieb Fernando Moreno: >> Hello, I'm new to this mailing list, and I have a couple of questions: >> >> Is it really necessary to add the [GENERAL] prefix? > > No it is not since the PostgreQL Li

Re: [GENERAL] Index order

2008-09-17 Thread Korry Douglas
Hmm, I understand what you're saying, but how ion earth do I create a function that reorders the result based on all the different characters ^ . * etc that could cause this? Write a function that strips out the characters you want to ignore (returning the rest of the given string) and then

Re: [GENERAL] Install Postgres on a SAN volume?

2008-09-08 Thread Douglas McNaught
On Mon, Sep 8, 2008 at 6:18 PM, William Garrison <[EMAIL PROTECTED]> wrote: > 2) We could install PostgreSQL onto the C: drive and then configure the data > folder to be > on the SAN volume (Z:) You want this. If you're going to take snapshots, you need all the data files AND the transaction log

Re: [GENERAL] WAL file questions - how to relocate on Windows, how to replay after total loss, etc

2008-08-28 Thread Douglas McNaught
On Thu, Aug 28, 2008 at 3:35 PM, John T. Dow <[EMAIL PROTECTED]> wrote: > However, it would really be nice if the WAL files could be used to make the > restored data more current, even if not everything can be restored. Are we > certain that useful information can't be gleaned from them to apply

Re: [GENERAL] WAL file questions - how to relocate on Windows, how to replay after total loss, etc

2008-08-28 Thread Douglas McNaught
On Thu, Aug 28, 2008 at 12:35 PM, John T. Dow <[EMAIL PROTECTED]> wrote: > You can't blame me for being confused. Here's from section 23.3 of the 8.2 > manual. > > "At all times, PostgreSQL maintains a write ahead log (WAL) in the pg_xlog/ > subdirectory of the cluster's > data directory. The log

Re: [GENERAL] WAL file questions - how to relocate on Windows, how to replay after total loss, etc

2008-08-28 Thread Douglas McNaught
On Thu, Aug 28, 2008 at 10:57 AM, John T. Dow <[EMAIL PROTECTED]> wrote: > BACKGROUND INFO BEGINS > > Recently I had some questions about doing backups and received very helpful > replies. I have now put together a BAT file to do a routine backup, using > pg_dumpall with the -g option to get the

Re: [GENERAL] hibernate nativequery and uuid

2008-07-31 Thread Douglas McNaught
On Thu, Jul 31, 2008 at 5:57 PM, Andrew <[EMAIL PROTECTED]> wrote: > The only relevant thing I have been able to find relating to it is > http://archives.postgresql.org/pgsql-bugs/2007-12/msg00061.php which > suggests adding a ::uuid cast to the parameter. > > However, when doing that, hibernate t

Re: [GENERAL] CAST(integer_field AS character) truncates trailing zeros

2008-07-31 Thread Douglas McNaught
On Thu, Jul 31, 2008 at 4:17 PM, Richard Broersma <[EMAIL PROTECTED]> wrote: > On Thu, Jul 31, 2008 at 1:03 PM, Warren Bell <[EMAIL PROTECTED]> wrote: >> I am trying to cast an int to a character. The int is the number 1000 it >> gets cast down to "1" and not "1000". How do I cast from int to chara

Re: [GENERAL] CAST(integer_field AS character) truncates trailing zeros

2008-07-31 Thread Douglas McNaught
On Thu, Jul 31, 2008 at 4:03 PM, Warren Bell <[EMAIL PROTECTED]> wrote: > I am trying to cast an int to a character. The int is the number 1000 it > gets cast down to "1" and not "1000". How do I cast from int to character > without loosing the trailing zeros? Please supply the exact syntax that y

Re: [GENERAL] How do I convert a timestamp with time zone to local time?

2008-07-29 Thread Valter Douglas Lisbôa Jr.
SELECT extract (epoch from your_time_field) from your_table; SELECT to_timestamp(your_epoch_field) from your_table; -- Valter Douglas Lisbôa Jr. Sócio-Diretor Trenix - IT Solutions "Nossas Idéias, suas Soluções!" www.trenix.com.br [EMAIL PROTECTED] Tel. +55 19 3402.2957 Cel. +55 19 9183.424

Re: [GENERAL] mac install question

2008-07-23 Thread Douglas McNaught
On Wed, Jul 23, 2008 at 2:19 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Well I got it from a link on postgresql.org. Of course it does say that it > is a beta installer. > http://www.postgresql.org/download/macosx Well, hopefully the maintainer reads this mailing list then. :) -Doug -

Re: [GENERAL] mac install question

2008-07-23 Thread Douglas McNaught
On Wed, Jul 23, 2008 at 1:58 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Please excuse my lack of mac knowledge. I installed postgresql 8.3 using the > mac os x 1 click installer onto my brand new powerbook. The install appeared > to go very smooth. If I go to Postgresql under Applica

Re: [GENERAL] Whassup with this? (Create table xxx like yyy fails)

2008-07-19 Thread Douglas McNaught
On Sat, Jul 19, 2008 at 9:02 PM, Karl Denninger <[EMAIL PROTECTED]> wrote: > childrensjustice=# create table petition_bail like petition_white; > ERROR: syntax error at or near "like" > LINE 1: create table petition_bail like petition_white; It's not super-easy to see from the docs, but I think y

Re: [GENERAL] Writing a user defined function

2008-07-18 Thread Douglas McNaught
On Fri, Jul 18, 2008 at 12:07 PM, Suresh_ <[EMAIL PROTECTED]> wrote: > > Hello, > I am trying to code a simple udf in postgres. How do I write sql commands > into pl/sql ? The foll. code doesnt work. > > CREATE OR REPLACE FUNCTION udf() > RETURNS integer AS $$ > BEGIN > for i in 1..2000 loop > fo

Re: [GENERAL] Reducing memory usage of insert into select operations?

2008-07-18 Thread Douglas McNaught
On Fri, Jul 18, 2008 at 12:18 AM, Francisco Reyes <[EMAIL PROTECTED]> wrote: > Douglas McNaught writes: > > >> It does seem that reducing work_mem might help you, but others on this > > I reduced it from 256MB to 64MB. It seems it is helping. You should also loo

Re: [GENERAL] Reducing memory usage of insert into select operations?

2008-07-17 Thread Douglas McNaught
On Thu, Jul 17, 2008 at 9:27 PM, Francisco Reyes <[EMAIL PROTECTED]> wrote: > Douglas McNaught writes: > >> Is this a 32-bit installation or 64-bit? 3GB of shared_buffers is way >> too big for a 32-bit setup. > > > 64-bit. > The machine has 12GB of RAM so shar

  1   2   3   4   >