Re: [SQL] Trace for postgreSQL

2004-02-17 Thread Andrew Sullivan
Sure. Alter your configuration to echo queries, and then watch your log file. Alternatively, you can enable the command string statistics function, and then you get the queries in near to real time in pg_stat_activity. A -- Andrew Sullivan | [EMAIL PROTECTED] The plural of anecdote

Re: [SQL] pg_restore - don?t restore. Why?

2004-02-20 Thread Andrew Sullivan
On Fri, Feb 20, 2004 at 12:24:46AM -0300, 2000info wrote: > pg_dump, ok. > pg_restore, don?t restore. Why? If you didn't use a non-ASCII format from pg_dump, you don't need pg_restore. Just use psql. A -- Andrew Sullivan ---(

Re: [SQL] Import from Ms Excel

2004-03-16 Thread Andrew Sullivan
On Tue, Mar 16, 2004 at 03:13:38PM +0530, Kumar wrote: > Dear Friends, > > Is possible to import data from MS Excel sheet into postgres > database 7.3.4 running on Linux 7.2 Yes. I find the easiest way is to export a delimited file from Excel and use the \copy command in psql. A

Re: [SQL] Import from Ms Excel

2004-03-16 Thread Andrew Sullivan
this sort of thing, as you can easily run into its limitations. I suppose it depends on how big your resulting spreadsheets are going to be. In my experience, though, the first thing that happens when you deliver someone a summary spreadsheet is, they ask you for the raw data so they can doubl

Re: [SQL] conversion of postgres database to oracle

2004-03-16 Thread Andrew Sullivan
On Tue, Mar 16, 2004 at 02:13:57PM +0200, cristi wrote: > How should I convert a postgres database to oracle? Send it out to ASCII and then import it to Oracle. But if you want support for going _to_ Oracle, you probably ought to get support from Oracle people, right? A -- Andrew Sulli

Re: [SQL] transaction

2004-04-21 Thread Andrew Sullivan
On Tue, Apr 20, 2004 at 09:14:48PM +0200, H.J. Sanders wrote: > > - BEGIN WORK > > - INSERT ROW > > - IF FAILED THEN UPDATE ROW > > - COMMIT WORK You can do it the other way. Begin, update; if 0 rows are updated then insert. A -- Andrew Sull

Re: [SQL] EXPORT / IMPORT

2004-05-07 Thread Andrew Sullivan
n). pg_dump -d or -D. Note that restoring from this is going to be a whole lot slower than restoring from a COPY based dump. A -- Andrew Sullivan | [EMAIL PROTECTED] ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please s

Re: [SQL] not really SQL but I need info on BLOBs

2004-05-06 Thread Andrew Sullivan
ages, then you can end up with references in the database to files that don't exist, because the filesystem operations can't be made subject to the transactions of the database. A -- Andrew Sullivan | [EMAIL PROTECTED] ---(end of broadcast)---

Re: [SQL] typecasting numeric(18,4) to varchar/text

2004-05-04 Thread Andrew Sullivan
a (a numeric(18,4)); CREATE TABLE andrewtest=# create table b (b varchar(25)); CREATE TABLE andrewtest=# insert into a values(12000.43); INSERT 17168 1 andrewtest=# insert into b select (a.a)::varchar; INSERT 17169 1 That's on 7.4.2. You might want to try casting to text first. A -- And

Re: [SQL] feature request ?

2004-06-24 Thread Andrew Sullivan
On Thu, Jun 24, 2004 at 12:32:59PM -0500, Jaime Casanova wrote: > > Why not disallow the ability of boolean fields to be null? Why not do it yourself? That's what the NOT NULL constraint is for. A -- Andrew Sullivan | [EMAIL PROTECTED] I remember when computers were frustrat

Re: [SQL] Preserving column order when recreating table.

2004-09-15 Thread Andrew Sullivan
names to get everything in the order you like, of course), and then rename the old table, rename the new table to the old table name, and drop the old table if you like. A -- Andrew Sullivan | [EMAIL PROTECTED] The fact that technology doesn't work is no bar to success in the market

Re: [SQL] Preserving column order when recreating table.

2004-09-15 Thread Andrew Sullivan
On Wed, Sep 15, 2004 at 04:22:01PM +0200, Stef wrote: > Andrew Sullivan mentioned : > => I'm not sure why you want to do the former, but in any case, it's > Because lazy people write inserts without specifying column names. Ugh. Sorry to say so, but this sounds to me real

Re: [SQL] Preserving column order when recreating table.

2004-09-15 Thread Andrew Sullivan
why I didn't use this solution originally. But I figured out a way to > modify pieces of the "create table" statement to drop all the indexes > and constraints first. > > Is there an easier way around this? I doubt it. A -- Andrew Sullivan

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Andrew Sullivan
On Sun, Sep 19, 2004 at 12:25:00PM -0400, Tom Lane wrote: > ps aux | grep postmaster | grep -v grep > (or use "ps -ef" if using a SysV-ish ps). Except that on Solaris, ps -ef _always_ shows "postmaster", even for the individual back ends. A -- Andrew Sullivan

Re: [SQL] How to check postgres running or not ?

2004-09-19 Thread Andrew Sullivan
se, on Solaris you also have the ucb ps, so it makes no difference.) A -- Andrew Sullivan | [EMAIL PROTECTED] The fact that technology doesn't work is no bar to success in the marketplace. --Philip Greenspun ---(end of broadcast)--

Re: [SQL] vacuum analyze slows sql query

2004-11-03 Thread Andrew Sullivan
ooking for locks here, though. That makes no sense, given that you've only 78 rows being returned. BTW, this topic should probably be better pursued on -performance. A -- Andrew Sullivan | [EMAIL PROTECTED] I remember when computers were frustrating because they *did* exactly what y

Re: [SQL] vacuum analyze slows sql query

2004-11-03 Thread Andrew Sullivan
don't know if you looked at my stored function, but there are > no locks in it (no explicit ones anyway). Foreign keys are one well-known area of locking surprises. A -- Andrew Sullivan | [EMAIL PROTECTED] This work was visionary and imaginative, and goes to show that visio

Re: [SQL] Move table between schemas

2004-11-16 Thread Andrew Sullivan
le oughta work. A -- Andrew Sullivan | [EMAIL PROTECTED] When my information changes, I alter my conclusions. What do you do sir? --attr. John Maynard Keynes ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ?

Re: [SQL] Move table between schemas

2004-11-16 Thread Andrew Sullivan
#x27;m afraid. I don't know of a way to move tables from one schema to another otherwise. You could do all the dependencies with a pg_dump -t, I suspect. Not tested that, though. A -- Andrew Sullivan | [EMAIL PROTECTED] A certain description of men are for getting out of debt, yet are

Re: [SQL] Way to stop recursion?

2004-11-26 Thread Andrew Sullivan
gt; thing, though I understand they would run recursively too. Here's the > table structure in question: You have to do this with a trigger. The problem is that the rule is expanded inline like a macro, so you can't prevent the behaviour you're seeing. A -- Andrew Sullivan

Re: [SQL] Way to stop recursion?

2004-11-26 Thread Andrew Sullivan
ly in the parent. Tom's answers always make me realise that I should think harder before I talk. He's right, of course: one common value means store it once. A -- Andrew Sullivan | [EMAIL PROTECTED] I remember when computers were frustrating because they *did* exactly what you told th

Re: [SQL] Failed system call was shmget(key=1, size=1155072, 03600).

2004-12-03 Thread Andrew Sullivan
? What are you trying to run this on? It might be that you need to alter your kernel settings. A -- Andrew Sullivan | [EMAIL PROTECTED] In the future this spectacle of the middle classes shocking the avant- garde will probably become the textbook definition of Postmoder

Re: [SQL] failed to find conversion function from "unknown" to text

2005-01-12 Thread Andrew Sullivan
ELECT case 'a'::text. . .) A -- Andrew Sullivan | [EMAIL PROTECTED] Information security isn't a technological problem. It's an economics problem. --Bruce Schneier ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Syntax error while altering col-type

2005-01-13 Thread Andrew Sullivan
f decisions that need to be made about what to do with incompatible types. What if you change from int8 to int4? What about varchar(4) to char(4)? Just to name two simple-minded examples. See the -general and -hackers archives for plenty of previous discussion of this stuff. A -- Andrew Su

Re: [SQL] Syntax error while altering col-type

2005-01-13 Thread Andrew Sullivan
On Thu, Jan 13, 2005 at 01:30:21PM +0100, KÖPFERL Robert wrote: > but that's the reason, the USING clause exists. It however still remains a Right. Please see the archives about how this was hammered out. A -- Andrew Sullivan | [EMAIL PROTECTED] A certain description of men are for

Re: [SQL] Column with recycled sequence value

2005-01-13 Thread Andrew Sullivan
NO CYCLE. One potential problem, of course, are collisions on the table, because some value wasn't cleared out. It sounds like you don't have that problem though. A -- Andrew Sullivan | [EMAIL PROTECTED] The plural of anecdote is not data. --Roger Brinner

Re: [SQL] Column with recycled sequence value

2005-01-13 Thread Andrew Sullivan
On Thu, Jan 13, 2005 at 03:31:54PM -0600, Scott Marlowe wrote: > Any method that tries to reuse sequence numbers is a bad idea (TM) and Why? I can think of a dozen cases where it can be useful. It just depends on the application. A -- Andrew Sullivan | [EMAIL PROTECTED] In the future t

Re: [SQL] Column with recycled sequence value

2005-01-13 Thread Andrew Sullivan
and retraining 100 people. Is it a pretty design? Probably not. Is it something that is, of all the compromises available, the best one under the circumstances? I dunno; I'd have to look at the circumstances. I think it's probably usually a good idea to avoid this, sure, but I'm n

Re: [SQL] SQL design question: null vs. boolean values

2005-01-15 Thread Andrew Sullivan
(field_foo in 'y', > 'n') I'd use "boolean not null default 'f'", myself. But in any case, this is _not_ a use for NULL, because you know absolutely what the deal was: either the user selected, or else it didn't. A -- Andrew Sullivan | [EMAIL PR

Re: [SQL] PostgreSQL ignores my indexes

2005-02-23 Thread Andrew Sullivan
. But that's what you're doing, and using the index would be more expoensive than this. A -- Andrew Sullivan | [EMAIL PROTECTED] Information security isn't a technological problem. It's an economics problem. --Bruce Schneier --

Re: [SQL] Postgres performance

2005-03-02 Thread Andrew Sullivan
t file writing. A -- Andrew Sullivan | [EMAIL PROTECTED] A certain description of men are for getting out of debt, yet are against all taxes for raising money to pay it off. --Alexander Hamilton ---(end of broadcast)--- TIP 3:

Re: [SQL] Question on triggers and plpgsql

2005-04-08 Thread Andrew Sullivan
gger puts the mail content into a table of mails to be sent, and wakes up the mail-sender client with the NOTIFY; the NOTIFY and the commit to the mail-it table only happen in that case if the transaction commits. And since mail is async anyway, the extra few seconds shouldn't make any diff

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Andrew Sullivan
> get a case insensitive search? I could use ~* or perhaps do an > UPPER(firstname) in the select etc? The upper() (or lower() -- whatever) stragegy is what I'd use. In any case, you want to make sure you put functional indexes on all such columns, because otherwise you'll never g

Re: [SQL] Question on triggers and plpgsql

2005-04-08 Thread Andrew Sullivan
painful start-up possibilities with the server, you might well get a duplicate copy of a mail transmitted later. (In the present age, given the remarkable quality of networks and mail servers everyone has, you almost never have this happen any more. But it's still strictly speaking possible.)

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Andrew Sullivan
On Fri, Apr 08, 2005 at 04:17:45PM +, Ragnar Hafstað wrote: > On Fri, 2005-04-08 at 11:07 -0400, Andrew Sullivan wrote: > > > > SELECT count(*) FROM tablename WHERE condition LIMIT n; > the LIMIT clause limits the number of rows returned by the select, > in this c

Re: [SQL] getting count for a specific querry

2005-04-08 Thread Andrew Sullivan
to get some EXPLAIN ANALYSE results for the offending queries in order to help you (where "handy" is read as "necessary"). A -- Andrew Sullivan | [EMAIL PROTECTED] Information security isn't a technological problem. It's an economics problem. --Bruce

Re: [SQL] Update aborted if trigger function fails?

2005-04-12 Thread Andrew Sullivan
ptional", > and that can be reconstructed easily after discovering > that the trigger function had been failing). But in If you can do some things asynchronously, and you don't care about them very much, then you can use LISTEN/NOTIFY to do such processing. A -- Andrew Sulli

Re: [SQL] row-attribute in EXPLAIN-output doesn't match count(*)

2005-04-14 Thread Andrew Sullivan
et." > mean? It means that those rows were marked invalidated after some existing transaction started. A -- Andrew Sullivan | [EMAIL PROTECTED] The plural of anecdote is not data. --Roger Brinner ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] row-attribute in EXPLAIN-output doesn't match count(*)

2005-04-14 Thread Andrew Sullivan
on. What's keeping open the transaction? A -- Andrew Sullivan | [EMAIL PROTECTED] The fact that technology doesn't work is no bar to success in the marketplace. --Philip Greenspun ---(end of broadcast)--- TIP 9: the

Re: [SQL] row-attribute in EXPLAIN-output doesn't match count(*)

2005-04-14 Thread Andrew Sullivan
your pool software. It's no doubt issuing "BEGIN;" as soon as it connects. It's BAD (broken as designed) in that case. You need to convince it not to do that, or else you need to go around and kill -2 such connections from time to time. A -- Andrew Sullivan | [EMAIL PR

Re: [SQL] row-attribute in EXPLAIN-output doesn't match count(*)

2005-04-14 Thread Andrew Sullivan
away if we did > that. Yeah; I seem to remember Tom Lane suggesting such an approach at one point. I had the vague idea it might happen in 8.0, but for some reason I think it didn't. (Anyway, that's probably off topic for this list.) A -- Andrew Sullivan | [EMAIL PROTECTED] When

Re: [SQL] row-attribute in EXPLAIN-output doesn't match count(*)

2005-04-14 Thread Andrew Sullivan
SIGINT. I don't know of any systems where that's not 2, but I suppose it's logically possible. As for the reconnection, it'll depend entirely on what your pool does when its connections are closed. You'll have to test it. A -- Andrew Sullivan | [EMAIL PROTECTED] Informati

Re: [SQL] Nested Sets

2005-04-16 Thread Andrew Sullivan
Everything in Postgres is always inside a transaction (although it might be a transaction of a single statement). You shouldn't need to do anything special around table locking. A -- Andrew Sullivan | [EMAIL PROTECTED] The fact that technology doesn't work is no bar to su

Re: [SQL] Query about SQL in PostgreSQL

2005-04-19 Thread Andrew Sullivan
ble-quote identifiers. I sort of don't believe exactly the original poster's report, however, because the error message wasn't right no matter what. I'd like to see a real session transcript. Also, this probably belongs on -general. A -- Andrew Sullivan | [EMAIL PROTECTED]

Re: [SQL] Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?

2005-05-17 Thread Andrew Sullivan
u want. I think. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern prose is away from concreteness. --George Orwell ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate

Re: [SQL] Does Postgresql have a similar pseudo-column "ROWNUM" as

2005-05-17 Thread Andrew Sullivan
my primary reason for > joining this list ;-) Well, then, table schemas, data distribution, EXPLAIN and EXPLAIN ANALYSE output, and some statement of what you're trying to get out is likely what we need to see. A -- Andrew Sullivan | [EMAIL PROTECTED] This work was visionary and imaginat

Re: [SQL] cursor "" does not exist

2005-06-16 Thread Andrew Sullivan
th autocommit off, I think what you get is no COMMIT, but you still get the bald transaction. What you really need is to make sure you're starting a multi-statement transaction every time. A -- Andrew Sullivan | [EMAIL PROTECTED] The plural of anecdote is not data. --Roger Brinner

Re: [SQL] Make COUNT(*) Faster?

2005-07-08 Thread Andrew Sullivan
st the idea of what tuple visibility. For a little more, you might want to look at the presentation Tom Lane made for this: http://www.postgresql.org/files/developer/transactions.pdf A -- Andrew Sullivan | [EMAIL PROTECTED] A certain description of men are for getting out of debt, y

Re: **SPAM** [SQL] Faster count(*)?

2005-08-10 Thread Andrew Sullivan
FWIW, this was another one of those things I must have heard a dozen times at OSCON. I suspect the simpler API would be popular, particularly since post-8.0 the estimates are more reliable than they used to be. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern pros

Re: [SQL] DATESTYLE and 0000-00-00

2005-10-06 Thread Andrew Sullivan
and coerce them to dates when you select (but be prepared for the errors you'll get). But my suggestion is that if you really think you have to have such dates, you should redesign (which might mean "replace") your application. Anything that uses dates with a year 0 is so fundamenta

Re: [SQL] pg, mysql comparison with "group by" clause

2005-10-13 Thread Andrew Sullivan
B2 have that we don't?") A -- Andrew Sullivan | [EMAIL PROTECTED] This work was visionary and imaginative, and goes to show that visionary and imaginative work need not end up well. --Dennis Ritchie ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Update timestamp on update

2005-10-13 Thread Andrew Sullivan
xamples there that may be easier for you to understand. To use a procedural language for a trigger, you will need to install that language; see the relevant chapter for instructions on how to do so. It is not currently possible to write a SQL-language trigger function. --snip-- A -- Andrew

Re: [SQL] pg, mysql comparison with "group by" clause

2005-10-13 Thread Andrew Sullivan
it sounds like you're actually arguing for "the optimiser needs to get better". Special-purpose, formally wrong syntax is surely not better than making the optimiser get the right syntax right every time, is it? A -- Andrew Sullivan | [EMAIL PROTECTED] When my infor

Re: [SQL] cast

2005-10-14 Thread Andrew Sullivan
On Fri, Oct 14, 2005 at 01:08:43PM -0500, Judith Altamirano Figueroa wrote: > Hello I have a query that ran in 7.0.2, but in 8.0.1 does not, the query > is the next: It'd help if we could see the table schema and the error message. A -- Andrew Sullivan | [EMAIL PROTECTED] When my

Re: [SQL] why vacuum

2005-10-27 Thread Andrew Sullivan
to package it up for others, or write a proof-of-concept outline for the lists or General Bits or something like that? This is a different sort of replication people are asking for. Note that you get 2PC in the next Postgres release. A -- Andrew Sullivan | [EMAIL PROTECTED] When

Re: [SQL] why vacuum

2005-10-27 Thread Andrew Sullivan
did, how it worked, design and limitations, &c. Post it to the lists (uh, -general or maybe -hackers, I suppose), or put it on a web page or whatever. General Bits is a fairly regular column that Elein Mustain puts out. I bet she'd include a submission on this topic, although you'd

Re: [SQL] why vacuum

2005-10-28 Thread Andrew Sullivan
everyone contributes their discoveries and improvements, we all benefit. A -- Andrew Sullivan | [EMAIL PROTECTED] When my information changes, I alter my conclusions. What do you do sir? --attr. John Maynard Keynes ---(end of broadcast)---

Re: [SQL] how to do a find and replace

2005-11-18 Thread Andrew Sullivan
the last entry doesn't get pulled out. These functions work on the first hit, so this is as expected. But if you have something like '/v.0/v.myimage.jpeg' you'll not lose the 'v.' you want, I expect. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendenc

Re: [SQL] idea for a geographically distributed database: how best to implement?

2005-11-18 Thread Andrew Sullivan
ly like to hear about it (especially if you can provide details of how you did it). If you get this working in a production system, I can think of more than one conference that would _also_ like a paper on it. A -- Andrew Sullivan | [EMAIL PROTECTED] A certain description of men are for getting

Re: [SQL] does indexes need statistics?

2005-11-25 Thread Andrew Sullivan
stics" section of the configuration file? If that's what you mean, then no. Those aren't the same thing as the statistical data used by the planner; the latter is updated when you run "analyse". A -- Andrew Sullivan | [EMAIL PROTECTED] "The year's penultim

Re: [SQL] Does VACUUM reorder tables on clustered indices

2005-12-19 Thread Andrew Sullivan
ially the same thing? A -- Andrew Sullivan | [EMAIL PROTECTED] I remember when computers were frustrating because they *did* exactly what you told them to. That actually seems sort of quaint now. --J.D. Baldwin ---(end of broadcast)---

Re: [SQL] How to Force Transactions to Process Serially on A Table

2005-12-19 Thread Andrew Sullivan
P 2: Don't 'kill -9' the postmaster > > > > -- > -Achilleus > > > > ---(end of broadcast)--- > TIP 9: In versions below 8.0, the planner will ignore your desire to >choose an index scan if your

Re: [SQL] Does VACUUM reorder tables on clustered indices

2005-12-22 Thread Andrew Sullivan
Given what Tom Lane recently reported (and assuming I understood his remarks), I think it's a Mighty Bad Idea to CLUSTER sl_log_1. A -- Andrew Sullivan | [EMAIL PROTECTED] In the future this spectacle of the middle classes shocking the avant- garde will probably become the te

Re: [SQL] INSERT waiting under heavy load

2006-01-08 Thread Andrew Sullivan
umber of updates, the planner always assumes an indexscan (correctly), but you end up scanning megabytes of dead tuples. With a large number of open transactions, most of the time VACUUM can't recover the space. I agree with what Tom said earlier in this thread: the design is guaranteed to lose.

Re: [SQL] Changing the transaction isolation level within the stored

2006-01-26 Thread Andrew Sullivan
ppose these are concurrent. The problem here is that each transaction need something in the other transaction either to complete or rollback before the work can proceed. So one of them has to lose. A -- Andrew Sullivan | [EMAIL PROTECTED] This work was visionary and imaginative, and goes to show

Re: [SQL] Changing the transaction isolation level within the stored

2006-01-26 Thread Andrew Sullivan
posite order, you are all but guaranteed a deadlock. MVCC helps, but it can't avoid locking the same data when that data is being updated. A -- Andrew Sullivan | [EMAIL PROTECTED] In the future this spectacle of the middle classes shocking the avant- garde will probably become the textb

Re: [SQL] Does PostgreSQL support job?

2006-02-01 Thread Andrew Sullivan
ron" (since you mention it). Yes, use that. A -- Andrew Sullivan | [EMAIL PROTECTED] The plural of anecdote is not data. --Roger Brinner ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Syntax for "IF" clause in SELECT

2006-02-09 Thread Andrew Sullivan
rum end), > > ... > > > > or if you are just trying to replace nulls, then try COALESCE > > > > ---(end of broadcast)--- > > TIP 1: if posting/reading through Usenet, please send an appropriate > >subscribe-nomail command to [EMAIL PROTECTED] so that your > >message can get through to the mailing list cleanly -- Andrew Sullivan | [EMAIL PROTECTED] It is above all style through which power defers to reason. --J. Robert Oppenheimer ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] Modifying postgresql.org file

2006-02-15 Thread Andrew Sullivan
mbering, the work_mem setting isn't in 7.4. You can check the docs on postgresql.org. There's a whole section on the configuration variables, and manuals are available for several releases back. A -- Andrew Sullivan | [EMAIL PROTECTED] Information security isn'

Re: [SQL] Modifying postgresql.org file

2006-02-15 Thread Andrew Sullivan
be under /usr/share/doc/. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern prose is away from concreteness. --George Orwell ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Andrew Sullivan
it thinks it knows about your environment. A -- Andrew Sullivan | [EMAIL PROTECTED] If they don't do anything, we don't need their acronym. --Josh Hamilton, on the US FEMA ---(end of broadcast)--- TIP 9: In versions below 8.0,

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Andrew Sullivan
is is to fiddle with the SET STATISTICS settings on the column(s) in question. You might find that as the samples get better, your index turns out to be usefully selective, and it gets chosen. But to answer your question, no, you can't tell it "use index foo". A -- Andrew Sul

Re: [SQL] Using EXPLAIN-ANALYZE

2006-02-16 Thread Andrew Sullivan
hdocs.postgresql.org/oscon2005/robert.treat/OSCON_Explaining_Explain_Public.sxi>) A -- Andrew Sullivan | [EMAIL PROTECTED] In the future this spectacle of the middle classes shocking the avant- garde will probably become the textbook definition of Postmodernism. --Brad Holland

Re: [SQL] Using EXPLAIN-ANALYZE

2006-02-16 Thread Andrew Sullivan
ery plan is affected by the nature of your data. That's what the ANALYZE command (on its own, or with VACUUM) is for. A > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Sullivan > Sent: Thursday, February 16, 2006 12:39 PM

Re: [SQL] Update in all tables

2006-02-22 Thread Andrew Sullivan
have to update more than one table (which is why there isn't a way to do this automatically). A -- Andrew Sullivan | [EMAIL PROTECTED] Unfortunately reformatting the Internet is a little more painful than reformatting your hard drive when it gets out of whack. --Scott Mo

Re: [SQL] Question about index scan vs seq scan when using count()

2006-02-23 Thread Andrew Sullivan
is that? How many rows? EXPLAIN ANALYSE will tell you if you have the right plan (estimate vs. actual). The real question is, are you sure an indexscan is faster? A -- Andrew Sullivan | [EMAIL PROTECTED] It is above all style through which power defers to reason.

Re: [SQL] Question about index scan vs seq scan when using count()

2006-02-23 Thread Andrew Sullivan
e 600 rows is so small that a seqscan's just as fast. A -- Andrew Sullivan | [EMAIL PROTECTED] "The year's penultimate month" is not in truth a good way of saying November. --H.W. Fowler ---(end of broadcast)-

Re: [SQL] Can't connect to the db

2006-02-24 Thread Andrew Sullivan
: 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 -- Andrew Sullivan | [EMAIL PROTECTED] A certain description of men are for getting out of debt, yet are against all t

Re: [SQL] Help with trigger that updates a row prior to a potentially aborted deletion?

2006-03-01 Thread Andrew Sullivan
llow you to rollback at that point and still leave the UPDATE in place. A -- Andrew Sullivan | [EMAIL PROTECTED] The fact that technology doesn't work is no bar to success in the marketplace. --Philip Greenspun ---(end of broadcast)

Re: [SQL] Replication - state of the art?

2006-03-01 Thread Andrew Sullivan
> Anyone here using replication or transaction journaling? Has it proved > reliable, easy to maintain? Define "easy". Every possible replication system is going to have slightly grotty corners into which you find yourself wandering. The question is merely whether the room is octa

Re: [SQL] Change date format through an environmental variable?

2006-03-01 Thread Andrew Sullivan
an environment variable. You can alter the postgresql.conf file, though. A -- Andrew Sullivan | [EMAIL PROTECTED] When my information changes, I alter my conclusions. What do you do sir? --attr. John Maynard Keynes ---(end of broadcast)-

Re: [SQL] Change date format through an environmental variable?

2006-03-01 Thread Andrew Sullivan
t modifying for other clients, AFAIK, just for you. (If that's what you want, well, good, but it's important to know what it does.) The list for 8.1 is in the docs: http://www.postgresql.org/docs/8.1/interactive/libpq-envars.html A -- Andrew Sullivan | [EMAIL PROTECTED] A certain des

Re: [SQL] Replication - state of the art?

2006-03-01 Thread Andrew Sullivan
onds). But > risk -- of data corruption -- > and time --too much-- will can the project. Another big reason to use a live-standby system like Slony is that once you have the extra database online, you suddenly think of all sorts of nifty queries you can move there without destroying your producti

Re: [SQL] Replication - state of the art?

2006-03-01 Thread Andrew Sullivan
backup > machine. Do the sync once a minute, and at most you lose 60 seconds of > data. Right. But you have to write all of that, and write the failover scripts, and such like. And the OP suggested that there wasn't time budget for that. But it'd work. A -- Andrew Sullivan |

Re: [SQL] Help with trigger that updates a row prior to a potentially aborted deletion?

2006-03-02 Thread Andrew Sullivan
ASCADE. My suggestion won't work for that, I don't think (but it might be worth a try). The only other thing I can think of is just flag everything, and use a daemon to go around and perform the actual deletes for you. A -- Andrew Sullivan | [EMAIL PROTECTED] The plural of anecdote i

Re: [SQL] Help with trigger that updates a row prior to a potentially aborted deletion?

2006-03-03 Thread Andrew Sullivan
On Fri, Mar 03, 2006 at 12:19:22AM -, Simon Kinsella wrote: > Hi Andrew, > > I think I may have cracked this problem by combining a RULE ON DELETE which > calls a function instead of the standard DELETE op. No triggers. It was a Ah. Yes, likely. Yeah, you can't do tha

Re: [SQL] Sequential scan where Index scan expected (update)

2006-03-03 Thread Andrew Sullivan
CC) 3.2.3 ^ you need to upgrade PostgreSQL Right Now. There are serious problems with earlier 7.4 releases. Get the latest, or risk data corruption. A -- Andrew Sullivan | [EMAIL PROTECTED] When my information changes, I alter my conclusions. What do you d

Re: [SQL] Sequential scan where Index scan expected (update)

2006-03-03 Thread Andrew Sullivan
ble statistics? I turn them on, in a session, as > user postgres, but get nothing: You have to SIGHUP to get those to take effect, IIRC. A -- Andrew Sullivan | [EMAIL PROTECTED] Information security isn't a technological problem. It's an economics problem. --Bruce

Re: [SQL] "could not open file" issue

2006-04-24 Thread Andrew Sullivan
oughta take this over to -general to see if the wizards can identify your problem. (But check your hardware first.) A -- Andrew Sullivan | [EMAIL PROTECTED] "The year's penultimate month" is not in truth a good way of saying November. --H.W. Fowler

Re: [SQL] any one can help me how to get multiple rows in postgresql using arrays in functions

2006-04-27 Thread Andrew Sullivan
On Thu, Apr 27, 2006 at 04:57:26PM +0530, Penchalaiah P. wrote: > any one can help me how to get multiple rows in postgresql using arrays > in functions What is it you are trying to do? A -- Andrew Sullivan | [EMAIL PROTECTED] Information security isn't a technological proble

Re: [SQL] ERROR: plan should not reference subplan's variable

2006-05-03 Thread Andrew Sullivan
uld get it directly from CVS and build it yourself. Directions for doing this are on the website (possibly in the developer's section, note). A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern prose is away from concreteness. --George Orwell --

Re: [SQL] i am getting error when i am using copy command

2006-05-03 Thread Andrew Sullivan
machine you're running psql from. If you want local files, you need to use \copy instead. A -- Andrew Sullivan | [EMAIL PROTECTED] It is above all style through which power defers to reason. --J. Robert Oppenheimer ---(end of broadcast)-

Re: [SQL] is an explicit lock necessary?

2006-05-04 Thread Andrew Sullivan
). The docs explain how this works. A -- Andrew Sullivan | [EMAIL PROTECTED] A certain description of men are for getting out of debt, yet are against all taxes for raising money to pay it off. --Alexander Hamilton ---(end of broadcast)-

Re: [SQL] Help with a seq scan on multi-million row table

2006-05-11 Thread Andrew Sullivan
e statistics target value for this > column? > > Ah, I think I found the place: No. Just ALTER TABLE [name] ALTER [column] SET STATISTICS. See http://www.postgresql.org/docs/8.1/interactive/sql-altertable.html for more. You'll need to ANALYSE afterwards. A -- Andrew Sullivan | [

Re: [SQL] Add column and specify the column position in a table

2006-05-18 Thread Andrew Sullivan
al layout of the columns should not be of concern to the developer, who should be naming the columns anyway. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern prose is away from concreteness. --George Orwell ---(end of broadcas

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-24 Thread Andrew Sullivan
. Note that the sequence does not guarantee no gaps, however. A -- Andrew Sullivan | [EMAIL PROTECTED] The fact that technology doesn't work is no bar to success in the marketplace. --Philip Greenspun ---(end of broadcast)--

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-26 Thread Andrew Sullivan
empseq; SELECT nextval('tempseq') as rank, testeridpk, tester_name FROM testers ORDER BY testeridpk; ROLLBACK; which, I _think_, will get you what you want (i.e. that's not tested). The ROLLBACK is just there to clean up the sequence. A -- Andrew Sullivan | [EMAIL PRO

Re: [SQL] hi how to use encryption for incomtax in postgresql

2006-05-26 Thread Andrew Sullivan
On Fri, May 26, 2006 at 04:01:47PM +0530, Penchalaiah P. wrote: > hi sir > > > > how to use encryption to password in postgresql with examples I guess you want to read this: http://www.postgresql.org/docs/8.1/interactive/client-authentication.html ? A -- Andrew Sul

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-26 Thread Andrew Sullivan
t also starts at 1. I don't actually know what this ranking is useful for, to be honest, but people ask for it, and this is a stupid Postgres trick that can make it happen. A -- Andrew Sullivan | [EMAIL PROTECTED] The plural of anecdote is not data. --Ro

Re: [SQL] hi still i am unable to provide encryption to a particular table....

2006-05-29 Thread Andrew Sullivan
d5 for that. If you want something more, use the pgcrypto contrib/ items. A -- Andrew Sullivan | [EMAIL PROTECTED] "The year's penultimate month" is not in truth a good way of saying November. --H.W. Fowler ---(end of broadcast)

  1   2   3   >