Re: [GENERAL] array_agg + limit

2010-11-27 Thread Lew
11,952549,129124,446671,476345,168905,308274,404812,501024,738098,636071} (1 row) I now [know] why it happens an[d] how [to] avoid it, but it's ok? Must work like this? Yes and yes. LIMIT applies to the number of rows, and that's how it's documented. http://www.postgresql.org/docs/9.0/interactive/queries-limit.html -- Lew -- Sent via pgsql

Re: [GENERAL] could you tell me this..?

2010-08-08 Thread Lew
Please do not top-post. On 08/05/2010 09:42 AM, Ketema Harris wrote: Never kill -9. Use kill -INT, whatever signal num that is, 11? man kill INT2 SEGV 11 -- Lew -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] Insert and Retrieve unsigned char sequences using C

2010-07-19 Thread Lew
be at the same address, if anywhere. That's because a C pointer doesn't represent a struct, or anything else other than an address. It *points to* the struct. You need to serialize the struct itself then allocate the pointer when you deserialize the struct. -- Lew -- Sent via pgsql-general mailing

Re: [GENERAL] moderninzing/upgrading mail list format

2010-07-06 Thread Lew
of the google groups email system. Thomas Kellerer wrote: I read it through the gmane newsreader, so I get threaded display and can easily scan the subjects. Ditto Thunderbird's news reader. Google Groups is not a very good news reader. -- Lew -- Sent via pgsql-general mailing list (pgsql

Re: [GENERAL] A thought about other open source projects

2010-06-21 Thread Lew
to encourage the use of databases that don't support relational integrity? Really? I think that is a simply terrible idea. -- Lew -- 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] A thought about other open source projects

2010-06-21 Thread Lew
, particularly as such an LCD is nonexistent. -- Lew -- 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] Best way to store case-insensitive data?

2010-06-13 Thread Lew
international text there are some corner cases where lower( upper( val )) != val or upper( lower( val )) != val. Or there should be, because that's what happens in certain languages. For example, upper-case 'ß' should be 'SS' in German. Lower-case 'SS' is 'ss'. -- Lew -- Sent via pgsql-general

Re: [GENERAL] Cognitive dissonance

2010-06-09 Thread Lew
generate pretty much any format you want, right? -- Lew -- 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] Cognitive dissonance

2010-06-08 Thread Lew
as part of the PostgreSQL source download available in the FTP area. -- Lew -- 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] Random Weighted Result Ordering

2010-06-07 Thread Lew
in a relational database have no inherent order. You took no steps whatsoever to guarantee the order of rows returned by the SELECT, so you should not be surprised at any order that comes back. -- Lew -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] UPDATE ... RETURNING atomicity

2010-05-27 Thread Lew
On 05/23/2010 02:15 AM, rihad wrote: In this query: UPDATE foo SET allocated_to=? WHERE id=(SELECT MIN(id) FROM foo WHERE allocated_to IS NULL) AND allocated_to IS NULL RETURNING id Isn't the AND allocated_to IS NULL clause redundant? -- Lew -- Sent via pgsql-general mailing list (pgsql

Re: [GENERAL] 'Infinity' in date columns?

2010-05-17 Thread Lew
-time data types. But I can’t get ‘infinity’ to work for columns of type “date”. Shoaib Mir wrote: I don't have version 8.3 with me right now but I just gave it a try with 8.4 and it gave me the expected output: As Tom Lane points out, that's a difference between 8.3 and 8.4. -- Lew -- Sent

Re: [GENERAL] Notification of Limited Account Access

2010-05-06 Thread Lew
should be followed regardless. -- Lew -- 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] Avoiding surrogate keys

2010-05-01 Thread Lew
or OpenJPA (for Java applications), natural keys are sufficient and far more straightforward than surrogate keys. -- Lew -- 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] Connection Pooling

2010-04-03 Thread Lew
or even the deployer's part. So to what coding changes do you refer? -- Lew -- 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] Licence

2010-03-21 Thread Lew
from the other party, that allows the other party to impose any reasonable interpretation on the wording. IOW, ambiguity is resolved in favor of the party who had no choice in the wording. That would mean the licensee gets to determine what without fee means, not the licensor. -- Lew

Re: [GENERAL] typecaste object to array

2010-02-23 Thread Lew
looking for here.) For a Java 'PreparedStatement' you can set a parameter to a SQL ARRAY value only if it's of type 'java.sql.Array' but I don't know offhand how to construct such an object other than to retrieve it from the database, a chicken-and-egg problem. GIYF there, I suppose. -- Lew

Re: [GENERAL] GROUP BY column alias?

2010-02-18 Thread Lew
. -- Lew -- 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] Shall I apply normalization in the following case?

2010-02-04 Thread Lew
activity, it's impossible to know whether the cost outweighs the benefit. -- Lew -- 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] PostgreSQL licence

2010-02-02 Thread Lew
but as an indicative one. The actual license offered by the actual copyright holder always trumps. Anyone who disbelieves the official site in favor of Wikipedia has a fool as a researcher and a bigger one as a client. -- Lew -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

Re: [GENERAL] Mapping Java BigDecimal

2010-01-23 Thread Lew
values differs between the JDBC for Oracle and that for PG? -- Lew -- 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] Config help

2009-11-16 Thread Lew
with unusually large numbers of connections and/or unusually large working sets, I'm guessing as you approach terabyte-scale dbs and up, it pays to go to even larger shared_buffers and work_mem and do other arcane tuning magic. -- Lew -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] Procedure for feature requests?

2009-10-31 Thread Lew
location. Here in the U.S., tomorrow (November 1, 2009) will be 25 hours long in most, but not all, jurisdictions. -- Lew -- 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] Emal reg expression

2009-10-31 Thread Lew
the intended party. Often I'll send a courtesy reply informing the sender that they have not reached the correct party and advising them to fix their address lists. -- Lew -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] Absolute value of intervals

2009-10-31 Thread Lew
different signs, so should abs('-1 day 1 hour') be '1 day -1 hour' or '1 day 1 hour'? Or what about corner cases like '1 day -25 hours'? I'm writing this at about 8:35 p.m. New York time on October 31, 2009. From now, adding interval '1 day -25 hours' yields right now, New York time. -- Lew

Re: [GENERAL] Absolute value of intervals

2009-10-31 Thread Lew
day for months with 31 days and subtracts 2 days for February. or 1 day for February, 2012. -- Lew -- 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] is postgres a good solution for billion record data.. what about mySQL?

2009-10-24 Thread Lew
tuning, PG will happily deal with large volumes of data; and 300kb a minute isn't really very much by any standards. You can get a few numbers here: http://www.postgresql.org/about/ I know folks who've successfully worked with multi-terabyte databases with PG. -- Lew -- Sent via pgsql-general

Re: [GENERAL] interface for non-SQL people

2009-10-10 Thread Lew
email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Confidentiality disclaimers on messages posted to a public forum are rather pointless, especially if in languages other than the /lingua franca/ of the forum. -- Lew

Re: [GENERAL] Best data type to use for sales tax percent

2009-10-08 Thread Lew
be 9.241%, and equal or exceed 10%, as in Alabama, Arizona, California and Illinois. http://en.wikipedia.org/wiki/Sales_taxes_in_the_United_States It's a good idea to research the domain before deciding on the representation. -- Lew -- Sent via pgsql-general mailing list (pgsql-general

Re: [GENERAL] What is the difference of foreign key?

2009-09-24 Thread Lew
sheepjxx wrote: To be precise, The difference between create table a ( foreign key (id) referenced by b(name), ); create table b( id integer referenced by b(name), ); They're just two different forms of invalid SQL. The difference between them makes no difference. -- Lew

Re: [GENERAL] Storage of Foreign Keys

2009-09-22 Thread Lew
. There are some instances where the referencing table only ever has a few rows in it, and in those cases, you likely don't need an index. And it is likely that the referenced table has an index since foreign keys reference a primary key or unique-constrained (combination of) column(s). -- Lew -- Sent

Re: [GENERAL] ETL software and training

2009-08-25 Thread Lew
name. Pentaho looks good based on their website, though. I bookmarked them. -- Lew -- 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] Generating random unique alphanumeric IDs

2009-08-16 Thread Lew
. Substitute 33 million for 365 for the OP's problem. -- Lew -- 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] plpgsql function to validate e-mail

2009-08-16 Thread Lew
England whose email address is similar to mine, but has a zero where mine has an o (letter oh). In both cases the email address is valid in and of itself, but is not valid for the purpose intended. -- Lew -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

Re: [GENERAL] Daylight saving time question

2009-05-23 Thread Lew
show us Java code? Is this a flaw in the JDBC driver or is that the expected behavior? In either case I do now have a workaround but would like to know. It is not a flaw in the JDBC driver. -- Lew -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Code tables, conditional foreign keys?

2009-05-23 Thread Lew
some cause to trust Mr. Celko's opinion on the matter. -- Lew -- 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] I don't want to back up index files

2009-03-21 Thread Lew
, silly. -- Lew -- 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] open up firewall from anywhere to postgres ports?

2009-03-09 Thread Lew
to vet the access. There certainly are dangers to letting the world in to your network. There are a lot of ways to mitigate the risk. A firewall blockade in conjunction with pg_hba.conf rules is one standard, relatively simple and fairly effective tactic. -- Lew -- Sent via pgsql-general

Re: [GENERAL] Need schema design advice

2008-10-30 Thread Lew
Martin Gainty wrote: could you provide a brief explanation of EAV ? Please avoid HTML and eschew top-posting. The post from Jeff Soules in this thread included the advice: See e.g. http://en.wikipedia.org/wiki/Entity-Attribute-Value_model which points to an explanation. -- Lew -- Sent

Re: [GENERAL] Oracle and Postgresql

2008-09-02 Thread Lew
Print action on one of their workstations. (Binding extra.) -- Lew -- 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] integer values in conf file

2008-08-31 Thread Lew
for memory units is 1024, not 1000. -- Lew -- 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] ERROR: relation . . . does not exist

2008-08-31 Thread Lew
the application domain, not lucky guesses about a limited sample of inputs. -- Lew -- 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] DUPS in tables columns ERROR: column . . . does not exist

2008-08-31 Thread Lew
BY md5cnt DESC; Use HAVING instead of WHERE. -- Lew -- 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] can't get UPDATE ... RETURNING ... INTO ... to compile successfully

2008-08-19 Thread Lew
, and when you think about it, indeed such a clause doesn't make sense. -- Lew -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] [OT] newsreader issue? (Was: bytea encode performance issues)

2008-08-03 Thread Lew
newsreader. Who wrote the message you quoted (you failed to cite the source)? -- Lew -- 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] Quick way to alter a column type?

2008-07-08 Thread Lew
with a little extra just in case the future brings more. It's a question of what represents the data most accurately and completely. -- Lew -- 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] timestamp with time zone output incorrect

2008-04-28 Thread Lew
as GMT+12, plus one more for Daylight Saving Time. Likewise, http://en.wikipedia.org/wiki/Wellington lists Wellington's time zone as Time zone NZST (UTC+12) - Summer (DST) NZDT (UTC+13) -- Lew -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] reindexing

2008-02-27 Thread Lew
Oracle 8, or Java 1.3, for example, to see how conservative many shops are with respect to upgrades. I'm not saying they should be that conservative, but many organizations are and we must be ready to deal with that. -- Lew ---(end of broadcast

Re: [GENERAL] reindexing

2008-02-27 Thread Lew
, and that these organizations should upgrade. -- Lew ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Auto incrementing primary keys

2008-02-19 Thread Lew
it is. Chances are good that the auto-genned sequence will work for you, if you think about it. If not, would you share why you anticipate that gaps will cause trouble for you? -- Lew ---(end of broadcast)--- TIP 4: Have you searched our list archives

Re: [GENERAL] advanced database design (long)

2008-02-12 Thread Lew
structure wound up with a non-EAV description. -- Lew ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Postgresql 8.2.4 on linux-sparc problem

2008-01-16 Thread Lew
Lew wrote: Tom Lane wrote: Before you get into that, try reducing these parameters: maintenance_work_mem = 1572864 work_mem = 1048576 They are way too high, especially the second one. So if 1.5 MB maintenance_work_mem and 1 MB work_mem are way too high, why are the default values

Re: [GENERAL] Postgresql 8.2.4 on linux-sparc problem

2008-01-16 Thread Lew
in the postgresql.conf on installation 16 MB and 1 MB, respectively? -- Lew ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] 8.2.4 serious slowdown

2008-01-16 Thread Lew
want to know the times when I haven't gotten the complete order yet. If we get more then we ordered, I don't want it to be in this query. Huh? How does that relate to the suggestion? The suggested expression is mathematically equivalent to and perfectly substitutable for the original. -- Lew

Re: [GENERAL] Need efficient way to do comparison with NULL as an option

2008-01-08 Thread Lew
WHERE COALESCE( folder_id, 0 ) = 0; -- Lew ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] top posting

2007-12-17 Thread Lew
, and the question isn't really related to the content of the email. Strictly speaking, then, that isn't top-posting but inline posting, where in line is position 0, with trim, where the amount trimmed is none. -- Lew ---(end of broadcast)--- TIP 1

Re: [GENERAL] top posting

2007-12-14 Thread Lew
in such convention-picking (because by choosing English, we surely discriminate against the unilingual Latin speakers). De mortuis nil nisi bonum dicendum est. -- Lew ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Hijack!

2007-12-14 Thread Lew
as a scolding and take offense. -- Lew ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] Hijack!

2007-12-14 Thread Lew
). From http://en.wiktionary.org/wiki/forum -- Lew You want picky? I got picky! ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your

Re: [GENERAL] Hijack!

2007-12-14 Thread Lew
? IANAL, but as I understand it from /The Hacker Crackdown/ by Bruce Sterling, it figured into the defense of a BBS operator accused of disseminating confidential ATT information in the U.S. ca. 1990. -- Lew ---(end of broadcast)--- TIP 2: Don't

Re: [GENERAL] Hijack!

2007-12-14 Thread Lew
to read it on the list; why in the world would I want that clutter in my inbox? That's why my email address here is a separate one just for Usenet; I can pretty much ignore replies that come directly to it. -- Lew ---(end of broadcast)--- TIP 6

Re: [GENERAL] top posting

2007-12-14 Thread Lew
was the problem with my post? -- Lew ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Simple math statement - problem

2007-12-02 Thread Lew
%ROWTYPE; begin rec.s_val = 100; rec.e_val = 101; retval = (rec.s_val - rec.e_val) / rec.s_val; return retval; end Also, one wonders why you need to do the calculation via a row or record at all, when it would seem so easy just to plug in the values. -- Lew

Re: [GENERAL] Simple math statement - problem

2007-12-02 Thread Lew
Lew wrote: Postgres User wrote: The problem turned out to be related to my function.. Given this table: CREATE TABLE table2 ( s_val numeric(6,2), e_val numeric(6,2) ) WITH OIDS; The following functions of code will set retval = NULL; declare retval numeric(6,2); rec record; begin

Re: [GENERAL] \copy ... with null as '' csv doesn't get nulls

2007-11-29 Thread Lew
Lew wrote: Try eliminating the double quotes in the CSV file. Wannabe NULL would then be ,, (consecutive commas) in the CSV. From the docs, you don't even need the NULL AS clause in your COPY statement. Ivan Sergio Borgonovo wrote: Exactly what I did because fortunately there weren't too

Re: [GENERAL] Error while compiling PostgreSQL with Java

2007-11-27 Thread Lew
/tutorial/jdbc/index.html SunIYF, PGIYF (in this case, jdbc.postgresql.org IYF) and GIYF. -- Lew ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] \copy ... with null as '' csv doesn't get nulls

2007-11-27 Thread Lew
eliminating the double quotes in the CSV file. Wannabe NULL would then be ,, (consecutive commas) in the CSV. From the docs, you don't even need the NULL AS clause in your COPY statement. -- Lew ---(end of broadcast)--- TIP 9: In versions

Re: [GENERAL] Why LIMIT and OFFSET are commutative

2007-11-27 Thread Lew
, and accept it. -- Lew ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] Why LIMIT and OFFSET are commutative

2007-11-27 Thread Lew
, then OFFSET rows are skipped *before starting to count the LIMIT rows that are returned.* (emphasis added) That's SQL, my friend. OFFSET first, then LIMIT. Irrespective of the order in the query statement. It is what it is. SQL doesn't depend on LINQ for its semantics. -- Lew

Re: [GENERAL] Why LIMIT and OFFSET are commutative

2007-11-27 Thread Lew
operator, so the term commutative has to be understood metaphorically at best. What exactly do you mean by commutative? -- Lew This post contained three requests for answers. ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Error while compiling PostgreSQL with Java

2007-11-27 Thread Lew
was made an external project instead of bundled with the server source code. The JDBC driver is available from http://jdbc.postgresql.org/download.html Cross-posted to correct the OP's multi-post, so that pgsql.admin will also contain the response(s). -- Lew ---(end

Re: [GENERAL] Error while compiling PostgreSQL with Java

2007-11-27 Thread Lew
be looking for the JDBC driver. If so, see http://jdbc.postgresql.org/. Yes, this answer has been provided to the OP already. -- Lew ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] md5() sorting

2007-11-17 Thread Lew
representation) of it is a mistake. Hashes are not strings and shouldn't be treated as such. -- Lew ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's

Re: [GENERAL] float to int

2007-11-17 Thread Lew
) expression::type Incidentally, float is about the worst data type to represent monetary amounts that one can choose. -- Lew ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] update record with two-column primary key

2007-11-17 Thread Lew
for dependent columns. What you want to do is literally remove the old record and insert a new one. The duplicate key violation is the purpose of having a primary key, after all. Otherwise you'd create two rows where you should only have one. -- Lew ---(end of broadcast

Re: [GENERAL] Query Performance Test

2007-11-17 Thread Lew
deviation of your k runs. Compare with and without anti-virus running. How much control do you have over the test machine's operating profile, i.e., what services and background tasks are running, network I/O, other factors that can influence timing? -- Lew ---(end

Re: [GENERAL] young guy wanting (Postgres DBA) ammo

2007-11-06 Thread Lew
, but almost as fast as Oracle (since the hardware platforms are different, it's hard to compare directly). This is something we've been saying for the last 2 years, and now we can prove it. There are links to the SPEC site which shows the tuning parameters. -- Lew

Re: [GENERAL] What makes a Postgres DBA?

2007-11-06 Thread Lew
experience, but somewhat more limited PG-specific knowledge, or, I've been honing my PG DBA skills, and I have a solid but basic competence, and the like. Chances are you will be able to make such judgments with much more confidence than claiming to be or not to be a DBA. -- Lew

Re: [GENERAL] young guy wanting (Postgres DBA) ammo

2007-11-01 Thread Lew
to handle these tasks, and if the workload is high enough, that needs to be someone's primary duty. Unless, of course, you simply don't care about your data. The lifeblood of your enterprise. -- Lew ---(end of broadcast)--- TIP 2: Don't 'kill -9

[GENERAL] Re: Best practice for: ERROR: invalid byte sequence for encoding UTF8

2007-08-17 Thread Lew
invalid input without regard for their intent. Calling rejection of invalid input puritanical is not an engineering evaluation. -- Lew ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Bytea question with \208

2007-08-17 Thread Lew
responsibility that the byte sequences you create are valid characters in the server character set encoding.) http://www.postgresql.org/docs/8.2/static/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS Amazing how useful the docs are. -- Lew ---(end of broadcast

Re: [GENERAL] Compound Indexes

2007-08-17 Thread Lew
, but sometimes it's better to create separate indexes and rely on the index-combination feature. The selectivity of each column is also relevant. If you have ten million rows with s_id values of only either 0 or 1, an index on s_id is not going to help much. -- Lew

Re: [GENERAL] Writing most code in Stored Procedures

2007-08-17 Thread Lew
. As Richard metioned, there are plenty of boundary cases that require a judgment call. Try to analyze which approach will have more risk in such cases; sometimes that helps discriminate. It ain't always easy; that's why they pay us the big bucks. -- Lew ---(end of broadcast

Re: [GENERAL] Trigger Procedure Error: NEW used in query that is not in a rule

2007-08-17 Thread Lew
as flexible as possible (I have several tables to audit). Somebody has any suggestion? You got some suggestions in response to your multipost of this question in pgsql.sql. -- Lew ---(end of broadcast)--- TIP 1: if posting/reading through Usenet

Re: [GENERAL] query to match '\N'

2007-08-04 Thread Lew
NULL, doesn't that mean that the imported data still differ from the exported? -- Lew ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Foreign key constraint question

2007-07-21 Thread Lew
set to Company but that seems like a waste. I tried the above and I got a syntax error. Can there be more than one row in item_bases with the same item_id but different item_types? -- Lew ---(end of broadcast)--- TIP 4: Have you searched our list

Re: [GENERAL] CASE in ORDER BY clause

2007-07-09 Thread Lew
will appear, in start_date ascending order. Is CURRENT_DATE evaluated once for the query or twice for each row? -- Lew ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] NULLS and User Input WAS Re: multimaster

2007-06-07 Thread Lew
. -- Lew ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] High-availability

2007-06-03 Thread Lew
Relativity of information. -- Lew ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Multiple customers sharing one database?

2007-06-03 Thread Lew
database in the cluster. Sharing of user names means that there cannot be different users named, say, joe in two databases in the same cluster; but the system can be configured to allow joe access to only some of the databases. In the OP's case, some of the databases is one of the databases. -- Lew

Re: [GENERAL] Delete with subquery deleting all records

2007-06-03 Thread Lew
Francisco Reyes wrote: Lew writes: Strange? Why? Did you expect a particular statistical distribution? Perhaps The impression was that one query was returning everything.. and the other only the records that did not exist in the one table. you were surprised by the extent

Re: [GENERAL] High-availability

2007-06-03 Thread Lew
prefer Postgre, I really do.) -- Lew ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Faster data type for one-length values

2007-06-03 Thread Lew
aligning indexes on one-byte data. The OP didn't say one-byte data, they said one-char data. -- Lew ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] There can be only one! How to avoid the highlander-problem.

2007-06-03 Thread Lew
, nation_id ) ); The circular foreign-key relationships might be problematic - would someone comment on that? To handle that I would ensure that any transaction that updates nations (king) checks that the pretender's man_id is already correctly entered in nations. -- Lew

Re: [GENERAL] problems with SELECT query results

2007-05-30 Thread Lew
to each group separately) is frustrating because it fragments the conversation. -- Lew ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] optimisation for a table with frequently used query

2007-05-29 Thread Lew
two indexes, one on each column? I am guessing that changes to the table are slower with two indexes. How could it affect queries? What if the typical query pattern was more balanced among constraints on one column, on the other, and on both? -- Lew ---(end

Re: [GENERAL] Integrity on large sites

2007-05-28 Thread Lew
. One assumes you mean implicit foreign key relations, since MyISAM doesn't enforce them (hence the reason they're broken, potentiated by the lack of transaction support). Sadly, there is a market for wrong answers faster. -- Lew ---(end of broadcast

Re: [GENERAL] Delete with subquery deleting all records

2007-05-28 Thread Lew
export_messages WHERE export_id NOT IN ( SELECT export_id FROM exports ); -- Lew ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] are foreign keys realized as indexes?

2007-05-10 Thread Lew
. Just use the syntax that best expresses your structure: PRIMARY KEY and FOREIGN KEY. -- Lew ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Temporal Units

2007-05-03 Thread Lew
I've encountered so far to this type of problem is to have a table of days with columns like isWeekday, isHoliday, julianDay, otherTidbit, ... Then you select or join the days within the interval of interest and factor out weekdays, or holidays, or whatever. -- Lew

  1   2   >