Re: [GENERAL] Amazon EC2 | Any recent developments

2009-06-15 Thread David Kerr
On Mon, Jun 15, 2009 at 11:12:32AM -0700, AJAY A wrote: - Hello All, - - I am investigating the possibility of hosting pgsql 8.3 on Amazon EC2 - & implementing a simple HA solution. My search of postgresql & amazon - cloud has produced little result. Just wondering if there has been - any recent

Re: [GENERAL] Select ranges based on sequential breaks

2009-06-15 Thread David Wilson
(select bin from table t2 where t2.datet1.bin; Ugly, and I'm pretty sure there's a much better way, but my brain is failing me right now- hopefully this'll at least get you started, though. -- - David T. Wilson david.t.wil...@gmail.com -- 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] Custom Fields Database Architecture

2009-06-15 Thread David Fetter
On Mon, Jun 15, 2009 at 10:37:04PM +0200, Stefan Keller wrote: > @David: You wrote in the links cited "The "flexibility" stems from > fear of making a design decision.". That's an important note. > Nevertheless, there are use cases where you *can not* know in

Re: [GENERAL] Amazon EC2 | Any recent developments

2009-06-15 Thread David Kerr
On Mon, Jun 15, 2009 at 12:11:54PM -0700, Just Someone wrote: - Hi, - - I have more than a few Postgres instances on EC2. For reliability I - use EBS, and take regular snapshots while also streaming the WAL files - to S3. So far, the few times that my machine died, I had no issue with - getting it

Re: [GENERAL] Amazon EC2 | Any recent developments

2009-06-16 Thread David Kerr
On Mon, Jun 15, 2009 at 06:53:00PM -0700, Just Someone wrote: - Hi, - - I've seen both - some unknown reason for it to die (mostly related to - the underlying hardware having issues). We also see instance failure - from time to time with advanced notice. Just like a regular machine - dies from tim

Re: [GENERAL] Naming functions with reserved words

2009-06-17 Thread David Fetter
object with a reserved word. Descriptive names are better. That said, you *can* do it by double-quoting each. SELECT "SELECT" FROM "FROM" WHERE "WHERE" = "="; Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!

Re: [GENERAL] Playing with set returning functions in SELECT list - behaviour intended?

2009-06-17 Thread David Fetter
ies(1,3) AS j; i | j ---+--- 1 | 1 2 | 2 1 | 3 2 | 1 1 | 2 2 | 3 (6 rows) Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Remember to vote! Consider donating to Postgres: http:

Re: [GENERAL] Custom Fields Database Architecture

2009-06-17 Thread David Fetter
gt; For all David's dogma there are use cases where EAV is the best fit. Sure there are, just not until every other option has been exhausted. The amount of maintenance needed for EAV always increases, usually with quite nasty complexity terms, which means you need to budget resources

[GENERAL] connecting to a remote pq always require a password

2009-06-18 Thread David Shen
n the pg_hba.conf file, I even change the host access control to this: hostall all 127.0.0.1/32 trust but it still does not work. What I missed? -- Best Regards, David Shen -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chan

Re: [GENERAL] default data sort

2009-06-21 Thread David Fetter
r and a more useful sort is the name column. How can I > have it default to sort by name rather than primary key? Whatever tool you're using for visualization can sort for you. In SQL, tables don't have an ordering, so any ordering is the responsibility of external tools. Cheers, Davi

Re: [GENERAL] [BUGS] Integrity check

2009-06-23 Thread David Fetter
cle does. We get it right in the first place. The existence of "integrity checking" tools means the DBMS is done with high incompetence. > * how do we confirm that dump file is proper data? See above. > * do you any doc to check the integrity of psql db? See above. Ch

Re: [GENERAL] [BUGS] Integrity check

2009-06-23 Thread David Fetter
On Tue, Jun 23, 2009 at 02:00:51PM +0100, Dave Page wrote: > On Tue, Jun 23, 2009 at 1:38 PM, David Fetter wrote: > > On Tue, Jun 23, 2009 at 03:38:35PM +0800, Prasad, Venkat wrote: > > >> * do you any tool to check postgreSQL database integrity check? > > > > No

Re: [GENERAL] [BUGS] Integrity check

2009-06-23 Thread David Fetter
On Tue, Jun 23, 2009 at 02:17:02PM +0100, Dave Page wrote: > On Tue, Jun 23, 2009 at 2:11 PM, David Fetter wrote: > > > There is no general way to do that, apart from creating a test suite > > specific to your scenario and hoping it doesn't have more bugs that > > the

Re: [GENERAL] [BUGS] Integrity check

2009-06-23 Thread David Fetter
On Tue, Jun 23, 2009 at 02:30:50PM +0100, Dave Page wrote: > On Tue, Jun 23, 2009 at 2:26 PM, David Fetter wrote: > > >> Auditors can be a funny breed. > > > > They can, at that, but in this case, they're simply doing the > > normal human thing of tryi

Re: [GENERAL] question about frequency of updates/reads

2009-06-23 Thread David Wilson
x27;d probably want to script the ramdisk and db setup since you'll have to recreate after a crash. (Alternately, create on disk somewhere; then put a copy on the ramdisk and start a postgres instance pointed at it. Then after a restart you just need to copy over from disk and start up the postgre

Re: [GENERAL] horizontal sharding

2009-06-25 Thread David Fetter
k, consider hiring one of the PostgreSQL consulting outfits like Command Prompt, Endpoint, OmniTI, or the one I work for, PostgreSQL Experts <http://www.pgexperts.com/> Cheers, David. > On Mon, Jun 15, 2009 at 8:07 AM, David Fetter > wrote: > > > On Mon, Jun 15, 2009

Re: [GENERAL] masking the code

2009-06-26 Thread David Fetter
get) database super-user access. If you don't wish to expose this to clients, don't ship it to them. If you wish to restrict clients' use of what you do ship them, the appropriate place to do so is in the license and/or contract. Cheers, David. -- David Fetter http://fetter.org/ P

Re: [GENERAL] Optimal values for 500 connections

2009-06-27 Thread David Fetter
ry settings or see about a connection pooler such as pgbouncer. The latter will be lighter on your system at the cost of maintaining another component. Cheers, David. > > The values I had in 8.2.13 conf file worked without a problem but with > the new 8.3.7 postmaster simply refuses t

Re: [GENERAL] Replication and coding good practices

2009-06-28 Thread David Fetter
e DDL from both of the above. * Make DDL changes part of your deployment process and only allow them in files which track in your SCM system. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: davi

Re: [GENERAL] Replication and coding good practices

2009-06-29 Thread David Fetter
On Mon, Jun 29, 2009 at 07:11:43PM +0800, Craig Ringer wrote: > On Sun, 2009-06-28 at 09:01 -0700, David Fetter wrote: > > > Are there any rules of thumb to consider for making an application > > > easier to work with a "general" replication solution? > > &g

Re: [GENERAL] Switching from MySQL: ON DUPLICATE KEY UPDATE, plpgsql function

2009-06-29 Thread David Kerr
On Sat, Jun 27, 2009 at 08:23:26PM -0400, APseudoUtopia wrote: - Hey list, - - I'm migrating my site away from MySQL to PostgreSQL. So far, it's been - going great. However, there's one problem I've been having trouble - solving. - - I have a query which allows users to "Catch up" on read posts o

Re: [GENERAL]

2009-06-30 Thread David Fetter
On Tue, Jun 30, 2009 at 10:22:23AM -0700, Erik Jones wrote: > > postgres=# select null = null; > ?column? > -- > > (1 row) Actually, it's NULL. shac...@postgres:5432=# SELECT (NULL = NULL) IS NULL; ?column? -- t (1 row) Cheers, David. -- David Fe

Re: [GENERAL] Q: data modeling with inheritance

2009-07-03 Thread David Fetter
u send along your DDL? Just generally, I've only found table inheritance useful for partitioning. "Polymorphic" foreign key constraints can be handled other ways such as the one sketched out below. http://archives.postgresql.org/sfpug/2005-04/msg00022.php Cheers, David. > >

Re: [GENERAL] Q: data modeling with inheritance

2009-07-03 Thread David Fetter
On Fri, Jul 03, 2009 at 05:37:20PM -0700, Reece Hart wrote: > On Fri, 2009-07-03 at 11:29 -0700, David Fetter wrote: > > > I'm missing what you're doing here that foreign keys don't cover. > > Could you send along your DDL? > > No DDL yet... I'm just i

Re: [GENERAL] combine multiple row values in to one row

2009-07-07 Thread David Fetter
tring() around it and get pretty formatting, as in: SELECT idn, array_to_string(array_agg(code),', ') AS codes FROM tbl; If you're not on 8.4 yet, you can create a similar aggregate with CREATE AGGREGATE. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778

Re: [GENERAL] combine multiple row values in to one row

2009-07-07 Thread David Fetter
On Tue, Jul 07, 2009 at 08:40:06AM -0700, David Fetter wrote: > On Tue, Jul 07, 2009 at 01:59:35AM +0430, Lee Harr wrote: > > > > Is there a generic way to do this? An aggregate maybe? > > The aggregate is called array_agg() and it's in 8.4. You can then > wrap ar

[GENERAL] Re: [BUGS] BUG #4916: wish: more statistical functions (median, percentiles etc)

2009-07-12 Thread David Fetter
useful, as an explicit function, though we can get it > easily enough using count(1) order by count desc]. You can get that with windowing functions, too. :) > According to google, this has been a wish since at least year 2000 > for various people, but doesn't seem to be implemented.

Re: [GENERAL] Start With... Connect By?

2009-07-13 Thread David Fetter
ns the lack of availability of CTEs in Oracle. Once you get used to CTEs, you'll wonder how you ever programmed in SQL without them :) Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com

[GENERAL] UUID datatype question

2009-07-13 Thread David Kerr
In the docs for the uuid datatype it states: (http://www.postgresql.org/docs/8.4/static/datatype-uuid.html) PostgreSQL also accepts the following alternative forms for input: use of upper-case digits, the standard format surrounded by braces, omitting some or all hyphens, adding a hyphen after an

Re: [GENERAL] UUID datatype question

2009-07-13 Thread David Kerr
On Mon, Jul 13, 2009 at 03:28:09PM -0400, Tom Lane wrote: - David Kerr writes: - > Tried w/o escaping: - > insert into testuuid values ('{a0eebc99-9c0b4ef8-bb6d6bb9-bd380a11}'); - > ERROR: invalid input syntax for uuid: "{a0eebc99-9c0b4ef8-bb6d6bb9-bd380a11}" - -

Re: [GENERAL] PostgreSQL-License

2009-07-14 Thread David Fetter
lecting funds, etc. The only way you would lose the rights to your license to use the code would be by violating the terms of that license. http://www.postgresql.org/about/licence.html Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skyp

Re: [GENERAL] Request for features

2009-07-14 Thread David Fetter
ncline everyone else favorably toward setting your ideas at a higher priority, even if some of them don't fly :) Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com

Re: [GENERAL] problem with pg_restore?

2009-07-14 Thread David Wilson
7;re going to have better luck finding a decent editor than finding someone to rewrite pg_dump and pg_dumpall just for you. -- - David T. Wilson david.t.wil...@gmail.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] A powerful feature for easier error finding

2009-07-19 Thread David Andersen
My scenario was the following. I got the following error message: postgres=# create trusted language plpythonu; ERROR: could not load library "C:/Program Files/PostgreSQL/lib/plpython.dll": unknown error 126 I had Python 3.1 installed and I did not know that PostgreSQL does not support this. The

[GENERAL] killing processes

2009-07-20 Thread David Kerr
What's the generally accepted method for killing processes that went 'all wacky' in postgres? I think i've seen in this group that kill -INT would be the way to go. I'm playing around with different options for a median function. this one got out of hand and was taking too long, so i wanted to

Re: [GENERAL] killing processes

2009-07-20 Thread David Kerr
On Mon, Jul 20, 2009 at 07:18:07PM -0400, Merlin Moncure wrote: - On Mon, Jul 20, 2009 at 6:48 PM, Scott Marlowe wrote: - > On Mon, Jul 20, 2009 at 4:44 PM, David Kerr wrote: - > What's most likely happening is that it's stuck in a tight loop that - > doesn't check for inte

Re: [GENERAL] killing processes

2009-07-21 Thread David Kerr
On Mon, Jul 20, 2009 at 11:14:22PM -0400, Tom Lane wrote: - David Kerr writes: - > But, i don't see any coded loop or way for me to insert a signal check. (I'm not much of a - > programmer) the function was just: - - > CREATE OR REPLACE FUNCTION array_median(anyarray) - >

Re: [GENERAL] killing processes

2009-07-21 Thread David Kerr
On Tue, Jul 21, 2009 at 01:13:18PM -0400, Tom Lane wrote: - David Kerr writes: - I tried it on a table with 81 random values. It took frickin' - forever, but seemed to be willing to respond to cancels anywhere - along the line. I'm not sure why you're seeing differently. Heh

Re: [GENERAL] general question on two-partition table

2009-07-27 Thread David Wilson
eq scans, but if most of the queries are done on small subsets of the tuples which meet the "good" criteria, it could be a big win that's very easy to implement. -- - David T. Wilson david.t.wil...@gmail.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] general question on two-partition table

2009-07-27 Thread David Wilson
On Mon, Jul 27, 2009 at 8:24 PM, Greg Stark wrote: > I think it would be even more interesting to have partial indexes -- > ie specified with "WHERE rbscore < cutoff". Yes- that's what I actually meant. Word got scrambled between brain and fingers... -- - Dav

Re: [GENERAL] Video available for PGDay SJC '09

2009-07-28 Thread David Fetter
videos in flv > format in a player in this page. Since I have a MAC, I have no problems > viewing the videos. But with my Linux box and FF 3.5 I can't. You can use xine on your Linux box :) Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666

Re: [GENERAL] Can I add a super table to existing tables?

2009-08-01 Thread David Fetter
On Sat, Aug 01, 2009 at 06:28:54PM -0700, Jun Yang wrote: > Hi all, > > I want to add some common columns to all of my tables. Your case may be very special, but offhand, this sounds like a very bad idea. What task is it you're trying to accomplish? Cheers, David. -- Davi

Re: [GENERAL] Can I add a super table to existing tables?

2009-08-01 Thread David Fetter
On Sat, Aug 01, 2009 at 08:10:02PM -0700, Jun Yang wrote: > On Sat, Aug 1, 2009 at 7:53 PM, David Fetter wrote: > > On Sat, Aug 01, 2009 at 06:28:54PM -0700, Jun Yang wrote: > > > Hi all, > > > > > > I want to add some common columns to all of my tables. > &

Re: [GENERAL] Refer to another database

2009-08-03 Thread David Fetter
chemas and I have simply created an own > schema for every database with the same name, but it still does not > work. Is there anything plain and simple? SELECT f.one, b.two FROM one_schema.foo AS f JOIN other_schema.bar AS b ON (f.id = b.foo_id) WHERE... Cheers, David. --

Re: [GENERAL] JOIN a UNION

2009-08-06 Thread David Fetter
On Thu, Aug 06, 2009 at 08:33:57PM +0200, Pavel Stehule wrote: > Hello > > SELECT ... FROM > (SELECT ... FROM A >UNION ALL >SELECT FROM B) s1 > JOIN C IN C.z = s1.z; That last line should read: JOIN C ON C.z = s1.z; Cheers, David. -- David Fetter http://

Re: [GENERAL] Accessing a database form another database

2009-08-10 Thread David Fetter
te a schema each for Spacely and Cogswell, then one for WorldMap. http://www.postgresql.org/docs/current/static/sql-createschema.html Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.co

Re: [GENERAL] Need help with libpq and PQexec

2009-08-11 Thread David Wilson
On Tue, Aug 11, 2009 at 3:35 AM, Juan Backson wrote: > PGRES_COMMAND_OK You want PGRES_TUPLES_OK for a select statement. You're not getting an actual failure- you're checking for the wrong status. -- - David T. Wilson david.t.wil...@gmail.com -- Sent via pgsql-general mailin

[GENERAL] Looping through string constants

2009-08-12 Thread David Kerr
I'd like to loop through a group of constant string values using plpgsql The best analog i can think of would be in a shell script #!/usr/bin/ksh for a in a b c d e; do echo $a done ./a.ksh a b c d e Is there some tricky way I can make that happen in postgres? (I don't want to put the values

Re: [GENERAL] Looping through string constants

2009-08-12 Thread David Kerr
On Wed, Aug 12, 2009 at 07:10:16PM -0400, Tom Lane wrote: - David Kerr writes: - > I'd like to loop through a group of constant string values using plpgsql - > The best analog i can think of would be in a shell script - > #!/usr/bin/ksh - - > for a in a b c d e; do - - Use VA

Re: [GENERAL] plpgsql function to validate e-mail

2009-08-16 Thread David Fetter
return 'true' > } > elog(WARNING, "address failed $Email::Valid::Details check."); > return 'false'; > $$ LANGUAGE plperlu IMMUTABLE STRICT; If the network interface can ever be down, this function is not in fact immutable, as it will fail on data that it

Re: [GENERAL] plpgsql function to validate e-mail

2009-08-16 Thread David Fetter
On Mon, Aug 17, 2009 at 07:50:14AM +0200, Pavel Stehule wrote: > 2009/8/17 David Fetter : > > On Mon, Aug 17, 2009 at 06:43:54AM +0200, Pavel Stehule wrote: > >> Hello > >> > >> 2009/8/16 Andre Lopes : > >> > Hi, > >> > > >> &g

Re: [GENERAL] Postgre RAISE NOTICE and PHP

2009-08-19 Thread David Fetter
; simple, elegant and incorrect solution. That's from H. L. Mencken. For every complex problem, there is an answer which is clear, simple, and wrong. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter X

[GENERAL] "Number of columns exceed limit" on a hierarchy of views

2009-08-21 Thread David Waller
it's only "select * from top_view" that produces this error. "select column_name from top_view" is fine. Does anyone have any ideas as to how I could avoid this error? I've hit the same problem on both Postgres 8.1 and 8.3. Thanks, David -- Sent via pgsql-gener

[GENERAL] "Number of columns exceed limit" on a hierarchy of views

2009-08-21 Thread David Waller
it's only "select * from top_view" that produces this error. "select column_name from top_view" is fine. Does anyone have any ideas as to how I could avoid this error? I've hit the same problem on both Postgres 8.1 and 8.3. Thanks, David -- Sent via pgsql-

Re: [GENERAL] New database or New Schema?

2009-08-21 Thread David Fetter
've described. If you were even vaguely contemplating queries that touched both that database and others you already have, it becomes much easier: use a schema. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter X

[GENERAL] Schema diff tool?

2009-08-21 Thread David Kerr
Is there a default/standard (free) schema diff tool that's in use in the community? I'd like to be able to quickly identify new columns, data changes, new indexes, etc between 2 schema versions. (and then create an alter script for the original) We're using ERWin as our modeling tool, but it

Re: [GENERAL] Schema diff tool?

2009-08-21 Thread David Kerr
we're on v7.2.8 there's no pg specific option so we've been using ODBC as the "database" type and the alter's it generates are just ugly. Dave Boyd, Craig wrote: What version of ERwin are you using? Thanks, Craig Boyd David Kerr wrote: Is there a default/st

[GENERAL] export a schema / import as new schema

2009-08-21 Thread David Kerr
Is there an easy way, that I'm missing, where I can export a schema from database A and then rename it on load into database B? I use similar functionality in oracle all the time and it's great for development environments when you're making schema changes or updating a lot of data. You can me

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

2009-08-21 Thread David Kerr
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 into database B? - - pg_dump -s foo|psql ba

Re: [GENERAL] Schema diff tool?

2009-08-21 Thread David Kerr
On Fri, Aug 21, 2009 at 01:59:43PM -0500, Boyd, Craig wrote: - We are on 7.3.0.1666. - - ODBC alter scripts do tend to be, um, ugly. - When you do the CC are restricting the objects you CC? Try to keep it - as minimal as possible. If I get some time over the weekend I will see - what I can do.

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

2009-08-21 Thread David Kerr
Thanks. Yeah, if it's not free i'll just write my own if it becomes too much of a pain =) Dave Boyd, Craig wrote: Look here: http://sqlmanager.net/en/products/postgresql They aren't cheap, but they seem to work well. Thanks, Craig Boyd David Kerr wrote: On Fri, Aug 21

Re: [GENERAL] Schema diff tool?

2009-08-21 Thread David Kerr
thanks that seems to do the trick! Dave Miroslav S wrote: Some time ago, i created this tool: http://apgdiff.sourceforge.net/ Miroslav David Kerr napsal(a): Is there a default/standard (free) schema diff tool that's in use in the community? I'd like to be able to quickly id

Re: [GENERAL] Figuring out relationships between tables.

2009-08-23 Thread David Fetter
e.boss_id = t.employee_id AND e.employee_id <> ANY(t."path") /* Prevent loops */ ) ) SELECT REPEAT('--', array_upper(t."path")-1) || employee_id as employee_id, t.first || ' ' || t.last AS "Name" FROM t; Cheers, Da

Re: [GENERAL] How to simulate crashes of PostgreSQL?

2009-08-24 Thread David Fetter
production since 7.0 came out. zero server > crashes. In my experience, OS crashes are much more common than PostgreSQL crashes. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.co

[GENERAL] Audit Trigger puzzler

2009-08-28 Thread David Kerr
all of my tables have 4 fields edited_by edited_date created_by created_date Most of the time, my application will set the edited_by field to reflect an application username (i.e., the application logs into the database as a database user, and that's not going to be the application user) So I lo

Re: [GENERAL] Connecting to Teradata via Postgresql

2009-08-30 Thread David Fetter
ly in the form of examples. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate -- Sent via pgsql-gen

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 C

Re: [GENERAL] Using WITH queries on VIEWs

2009-08-30 Thread David Fetter
go anywhere any other read-only (for now) row-returning query can, so top-level SELECTs, sub-selects, etc. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Remember to vote! Consider

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$$

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? C

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 http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!

Re: [GENERAL] Audit Trigger puzzler

2009-08-31 Thread David Kerr
On Fri, Aug 28, 2009 at 08:07:40PM +0100, Simon Riggs wrote: - - On Fri, 2009-08-28 at 08:50 -0700, David Kerr wrote: - - > so, is there a way in a trigger to know if edited_by is expressly - > being set in the update statement? it seems like if I can know that, - > then i should b

Re: [GENERAL] [Q] optmizing postgres for 'single client' / many small queries

2009-09-02 Thread David Fetter
e to get out of your way. Properly used, it can keep completely out of the business of making (wrong) guesses based on DDL, which is what ORMs often do. DBIx::Class <http://search.cpan.org/dist/DBIx-Class/> has gone a long way in the right direction. Ones which (attempt to) dictate decisions a

Re: [GENERAL] Add a serial column to a table based on a sort clause

2009-09-02 Thread David Fetter
omly put the sequence numbers. "Random" is how you should think of them. Sequences guarantee only uniqueness. Neither order nor gap-less numbers, nor any other property apply to them. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yah

Re: [GENERAL] Audit Trigger puzzler

2009-09-03 Thread David Kerr
On Wed, Sep 02, 2009 at 11:44:20PM -0500, Adam Rich wrote: - In Oracle, the way we handle audit triggers is by using Package - Variables. We emulate some of that functionality in postgresql by - adding a custom variable to the configuration file: - - custom_variable_classes = 'mysess' - - Then

Re: [GENERAL] [Q] optmizing postgres for 'single client' / many small queries

2009-09-03 Thread David Fetter
On Thu, Sep 03, 2009 at 07:24:50AM -0700, Richard Broersma wrote: > On Wed, Sep 2, 2009 at 4:35 PM, David Fetter wrote: > > > Hibernate has the very nice feature of being able to get out of > > your way.  Properly used, it can keep completely out of the > > business o

Re: [GENERAL] column level, uid based authorization to update columns

2009-09-03 Thread David Fetter
KE in 8.4. http://www.postgresql.org/docs/current/static/sql-grant.html Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Remember to vote! Consider donating to Postgres: http://www.postg

Re: [GENERAL] Regex substring help

2009-09-03 Thread David Fetter
either use a non-greedy regex like this: SELECT substring('onetwothree','(^.*?).*$'); Note the '?' after the '*'. That makes it non-greedy. Another way to do this would be with string_to_array: SELECT (string_to_array('onetwothree',''))[1

Re: [GENERAL] where clause question

2009-09-04 Thread David Fetter
;m using. AFAIK, I've only got access to where ... Sounds like a great reason to modify, or if you can't modify, replace, that application toolkit. This won't be the last time it will get in your way. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM

Re: [GENERAL] Order By Date Question

2009-09-08 Thread David Fetter
ed to tread carefully, as casting is full of scare. One way to tread carefully is to ORDER BY date_trunc('day', "Event_Date"), "Name" Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfe

Re: [GENERAL] [sfpug] Statistics and PostgreSQL: Streaming Webcast tonight

2009-09-08 Thread David Fetter
On Tue, Sep 08, 2009 at 10:30:21AM -0700, David Fetter wrote: > Folks, > > For those of you who can't attend in person, we'll be streaming audio > and video and having a chat for tonight's SFPUG meeting on how the > planner uses statistics. > > Video: &g

[GENERAL] Statistics and PostgreSQL: Streaming Webcast tonight

2009-09-08 Thread David Fetter
Folks, For those of you who can't attend in person, we'll be streaming audio and video and having a chat for tonight's SFPUG meeting on how the planner uses statistics. Video: http://media.postgresql.org/sfpug/streaming Chat: irc://irc.freenode.net/sfpug Cheers, David. -- Dav

Re: [GENERAL] [sfpug] Statistics and PostgreSQL: Streaming Webcast tonight

2009-09-08 Thread David Fetter
On Tue, Sep 08, 2009 at 10:32:53AM -0700, David Fetter wrote: > On Tue, Sep 08, 2009 at 10:30:21AM -0700, David Fetter wrote: > > Folks, > > > > For those of you who can't attend in person, we'll be streaming audio > > and video and having a chat for tonight&#

[GENERAL] Unable to drop a table due to seemingly non-existent dependencies

2009-09-10 Thread David Brain
known-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42) Thanks, David. -- 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] Unable to drop a table due to seemingly non-existent dependencies

2009-09-10 Thread David Brain
ssue, once the ownership was switched to the new tables I was able to drop the old ones. That's certainly something I've learned about Postgres today. David -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] SAS70 audit + postgres

2009-09-14 Thread David Kerr
anyone pass a SAS70 audit with postgres? Our security expert has a lot of concerns due to the lack of user audit logging that's provided. especally for logging superuser / DBA actions. Of course, my stance is that you need to trust your DBAs, but I don't know if SAS70 shares my belief. Thanks

Re: [GENERAL] SAS70 audit + postgres

2009-09-14 Thread David Kerr
u to setup non-superuser roles - to do other stuff, I can understand, but there are some things only - the superuser can do, and for that, you gotta trust them. - - On Mon, Sep 14, 2009 at 1:17 PM, David Kerr wrote: - > anyone pass a SAS70 audit with postgres? - > - > Our security exp

Re: [GENERAL] SAS70 audit + postgres

2009-09-14 Thread David Kerr
. - - On Mon, Sep 14, 2009 at 1:45 PM, David Kerr wrote: - > Right, I agree there are things I can do to minimize impact, - > but If SAS70 or similar comes in and says w/o superuser auditing - > we're not giving you the certification, then that still causes us a - > problem. - &g

[GENERAL] PostgreSQL + 64 bit + performance

2009-09-14 Thread David Kerr
Are there any links to benchamrks between 32 and 64 bit postgres? My oracle experience tells me that I want to go with 64 bit postgres so that i can have faster disk and memory access. Has anyone run the numbers? Thanks Dave -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] Non-check constraint def for a static list ?

2009-09-15 Thread David Fetter
other fields, "gender" can take many values. If you wish to make the table immutable, revoking all write permissions, and as a backstop, adding RULEs that say DO INSTEAD NOTHING for data-changing operations, which would then require that someone changing it have DDL permission, a much higher

Re: [GENERAL] postgresql.key secure storage

2009-09-15 Thread David Fetter
any kind of guru to use something someone else has written, as rootkits and other malware amply demonstrate. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Remember to vote!

Re: [GENERAL] Unicode normalization

2009-09-16 Thread David Fetter
ttp://wiki.postgresql.org/wiki/Strip_accents_from_strings%2C_and_output_in_lowercase Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Remember to vote! Consider donating to Postgres: http://ww

Re: [GENERAL] Return 30% of results?

2009-09-18 Thread David Fetter
- > 1 > HTH > Martin Gainty That's Oracle, not PostgreSQL. Are you really trying to help here? Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Rememb

Re: [GENERAL] Return 30% of results?

2009-09-19 Thread David Fetter
cription:http://www.postgresql.org/mailpref/pgsql-general > > Yeah, im actually not using 8.4. Any other alternatives? The easiest way would be to upgrade to 8.4 because the workarounds for previous versions are complicated and bug-prone. Cheers, David. -- David Fetter http://fetter.

Re: [GENERAL] 8.4 installer

2009-09-21 Thread David Spadea
ectory of C: This behavior seems wrong to me, and I think this could be a bug in initdb on Windows. The current behavior seems to work fine for full path names, or relative names without a drive specifier, but handling of relative paths containing a drive specifier seems to be incorrect. I'd be

Re: [GENERAL] Advance SQL subquery

2009-09-23 Thread David Fetter
, you'll be able to use sum() and parameterize it like this: SELECT "date", SUM (value) OVER w FROM your_log WINDOW w AS ( ORDER BY "date" ROWS BETWEEN 2 PRECEDING AND CURRENT ROW ) ORDER BY "date"; Cheers, David. -- Davi

[GENERAL] The password specified does not meet the local or domain policy during install.

2009-09-25 Thread David Chell
complexity requirements: disabled Store password using reversible encryption: disabled Thanks for your help. David

Re: [GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-26 Thread David Fetter
few prototypes of your schema, get them together again, etc. Cheers, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.

Re: [GENERAL] generic modelling of data models; enforcing constraints dynamically...

2009-09-27 Thread David Fetter
On Sun, Sep 27, 2009 at 08:26:27PM +0200, InterRob wrote: > Dear David, dear all, > I very well understand what you are saying... Clearly you do not. What you are proposing has been tried many, many times before, and universally fails. That your people are failing to get together and agre

Re: [GENERAL] Query not using the indexes properly.

2009-10-01 Thread David Wilson
it's not going > to help. > If you try the multi-column index (which is a good idea), be sure that "id" is the last of the three columns, since that's the column on which you have an inequality test rather than an equality test; eg, (company_id,source_model_name,id). -- - David T. Wilson david.t.wil...@gmail.com

<    5   6   7   8   9   10   11   12   13   14   >