Re: [SQL] surrogate vs natural primary keys

2008-09-16 Thread Andrew Sullivan
the identifier is assigned. ISO, for instance, is willing to re-use country codes (even though the specification never suggested they were). So if you expect to use the ISO 2-letter codes over time, you may get a nasty surprise. (For an example, in 2003 CS became historically ambiguous.) A -- Andrew

Re: [SQL] How long - Vacumm full - 10 million to 90,000

2008-05-29 Thread Andrew Sullivan
really long time. You might actually be better off to dump the table and restore it from that. A -- Andrew Sullivan [EMAIL PROTECTED] +1 503 667 4564 x104 http://www.commandprompt.com/ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] Get the last inserted id

2008-04-11 Thread Andrew Sullivan
On Fri, Apr 11, 2008 at 07:23:04PM +0200, Nacef LABIDI wrote: Hi all, I was wondering if postgres can return the last ID inserted for a table which the primary key is autoincremented. I need to retrieve this ID in my code to continue processing on that inserted row. Use select currval() on

Re: [SQL] duplicate key violates unique constraint

2008-02-26 Thread Andrew Sullivan
On Tue, Feb 26, 2008 at 05:05:01PM +0100, Shavonne Marietta Wijesinghe wrote: Thank you. I tried as you said. But i get a ERROR: syntax error at or near INSERT at character 9 I don't see anything wrong with the code.. Well, except that there's no EXCEPTION statement in SQL? I think your

Re: [SQL] Cheers for DISTINCT ON

2008-01-07 Thread Andrew Sullivan
On Mon, Jan 07, 2008 at 05:02:27PM +0100, Peter Kovacs wrote: I just wanted to give my cheers for DISTINCT ON. It is a great feature, I've just found a really good use for it. I am just wondering why it didn't make it into the standards. Likely because neither Oracle Corp nor IBM nor (at the

Re: [SQL] Cheers for DISTINCT ON

2008-01-07 Thread Andrew Sullivan
On Mon, Jan 07, 2008 at 12:51:19PM -0500, Chris Browne wrote: I have heard that Gabriel has, at different conferences at different times, taken and argued opposite positions on this; he has both argued Worse is Better and that Worse isn't Better. Yes. That history is actually outlined by him

Re: [SQL] case sensitivity for tables, columns, and constraint names

2007-12-11 Thread Andrew Sullivan
On Tue, Dec 11, 2007 at 11:05:25AM -0600, Ertel, Steve wrote: is wrapped in quotes. Is there a setting to allow upper case and mixed case names for database tables, fields, etc, without having to wrap each in quotes? No, sorry. The always-one-case rule for unquoted identifiers is ANSI

Re: [SQL] Is there anything special about pg_dump's compression?

2007-11-15 Thread Andrew Sullivan
recall correctly. So probably not. A -- Andrew Sullivan Old sigs will return after re-constitution of blue smoke ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL

Re: [SQL] Backup Database

2007-10-31 Thread Andrew Sullivan
7.4 database? You can do this with Slony, assuming nothing else needs to be written (on the replicated tables) into the 7.4 system. A -- Andrew Sullivan | [EMAIL PROTECTED] Never get involved in litigation. Your hair will fall out, your bones will turn to sand. And it will still be going

Re: [SQL] request for help with COPY syntax

2007-10-23 Thread Andrew Sullivan
. 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)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose

Re: [SQL] Extracting hostname from URI column

2007-09-17 Thread Andrew Sullivan
, and it's sometimes terrifically important not to make that mistake. A -- Andrew Sullivan | [EMAIL PROTECTED] The plural of anecdote is not data. --Roger Brinner ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Database normalization

2007-08-28 Thread Andrew Sullivan
IS NULL and col2 IS NULL). 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] Database normalization

2007-08-28 Thread Andrew Sullivan
this in to consideration when deciding whether to split the tables? In terms of searching speed that is. I'd put it in its own table, probably, unless you're going to use it frequently. A -- Andrew Sullivan | [EMAIL PROTECTED] Everything that happens in the world happens at some place

Re: [SQL] Sequences problem

2007-08-17 Thread Andrew Sullivan
nextval() before a currval(). This is documented behaviour. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern prose is away from concreteness. --George Orwell ---(end of broadcast)--- TIP 1: if posting/reading

Re: [SQL] Connection Limit

2007-07-30 Thread Andrew Sullivan
[local] means UNIX domain socket. As to your other question, either ps or pg_stat_activity is your friend. A -- Andrew Sullivan | [EMAIL PROTECTED] The very definition of news is something that hardly ever happens. --Bruce Schneier ---(end of broadcast

Re: [SQL] Database Synchronization

2007-07-23 Thread Andrew Sullivan
be able to get this to work by installing whatever extra bits the YAST installation tool offers (probably something with -dev- or -src- in it). A -- Andrew Sullivan | [EMAIL PROTECTED] Users never remark, Wow, this software may be buggy and hard to use, but at least there is a lot of code

Re: [SQL] data dependent sequences?

2007-07-17 Thread Andrew Sullivan
, then? If they're just there to preserve order, one sequence will work just fine. Otherwise, I think you have a normalisation problem. 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

Re: [SQL] data dependent sequences?

2007-07-17 Thread Andrew Sullivan
or whatever for your ORDER BY clause, and not store data that you actually don't care about. A -- Andrew Sullivan | [EMAIL PROTECTED] The plural of anecdote is not data. --Roger Brinner ---(end of broadcast)--- TIP 9: In versions below

Re: [SQL] data dependent sequences?

2007-07-17 Thread Andrew Sullivan
_really_ is, and then you won't have to implement what sounds like a bad idea. A -- Andrew Sullivan | [EMAIL PROTECTED] However important originality may be in some fields, restraint and adherence to procedure emerge as the more significant virtues in a great many others. --Alain de Botton

Re: [SQL] using EXECUTE on Selects

2007-07-11 Thread Andrew Sullivan
to select data using EXECUTE? You missed the opening sentence of the previous paragraph: The INTO clause specifies where the results of a SELECT command should be assigned. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern prose is away from concreteness

Re: [SQL] select from table and add rows.

2007-07-06 Thread Andrew Sullivan
want ot set up a PHP array with values from your table, without using PHP. Which would of course make no sense. Do you mean, how do you populate an array data type with data from individual database columns? A -- Andrew Sullivan | [EMAIL PROTECTED] However important originality may be in some

Re: [SQL] select from table and add rows.

2007-07-06 Thread Andrew Sullivan
sometable WHERE [criteria] The casts might not be needed, of course. A -- Andrew Sullivan | [EMAIL PROTECTED] The plural of anecdote is not data. --Roger Brinner ---(end of broadcast)--- TIP 1: if posting/reading through Usenet

Re: [SQL] record fields as columns in reports

2007-06-28 Thread Andrew Sullivan
I think this should be possible with the crosstab functionality delivered in Joe Conway's tablefunc package, in contrib/. 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

Re: [SQL] NO DATA FOUND Exception

2007-06-25 Thread Andrew Sullivan
, and the trapping errors section for the latter. 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] joining a table whose name is stored in the primary record

2007-06-19 Thread Andrew Sullivan
On Tue, Jun 19, 2007 at 02:02:46PM -0400, John Gunther wrote: Well, Andrew, you're certainly right but I made an exception because of the data needs. Ah, well, in that case, you'll need something other than SQL for sure. A function as suggested is probably your friend. A -- Andrew Sullivan

Re: [SQL] joining a table whose name is stored in the primary record

2007-06-17 Thread Andrew Sullivan
-form thing to do, because the data has been broken into pieces dependent on the data itself, rather than the kind of data it is. A -- Andrew Sullivan | [EMAIL PROTECTED] In the future this spectacle of the middle classes shocking the avant- garde will probably become the textbook definition

Re: [SQL] Versionning (was: Whole-row comparison)

2007-06-04 Thread Andrew Sullivan
reason, no. But why couldn't you change your query to issue the SRF directly, with the parameter: SELECT * FROM some_srf(param1, param2)? 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] current_date / datetime stuff

2007-06-04 Thread Andrew Sullivan
possible Monday. 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 6: explain analyze is your friend

Re: [SQL] Versionning (was: Whole-row comparison)

2007-06-01 Thread Andrew Sullivan
but would definitely be ugly. Can someone think of a better way to do that ? I sort of don't see how that hack would be any different from a SRF. You'd lose the planner benefits anyway, I think, because you'd have to plan for the generic case where the data could be anything, no? A -- Andrew Sullivan

Re: [SQL] Versionning (was: Whole-row comparison)

2007-06-01 Thread Andrew Sullivan
the first time you execute it. (I could be wrong about this; I suppose the only way would be to try it.) A -- Andrew Sullivan | [EMAIL PROTECTED] However important originality may be in some fields, restraint and adherence to procedure emerge as the more significant virtues in a great many others

Re: [SQL] slow query execution

2007-05-30 Thread Andrew Sullivan
not surprised it takes a long time -- you have to join the whole table to itself and then do a lot of counting. Are you just trying to get the row number for your query answer? You can do this with a temporary sequence, among other approaches, more cheaply. A -- Andrew Sullivan | [EMAIL PROTECTED] Users

Re: [SQL] slow query execution

2007-05-30 Thread Andrew Sullivan
generate_series to do this too, but I don't know it offhand (generating row numbers sounds to me like a bad idea, so I don't do it). A -- Andrew Sullivan | [EMAIL PROTECTED] ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] slow query execution

2007-05-30 Thread Andrew Sullivan
come back. Are you doing this all in one serialisable transaction, though? If not, what guarantee will you have that new data won't mess up your row numbering from query to query? A -- Andrew Sullivan | [EMAIL PROTECTED] The plural of anecdote is not data. --Roger Brinner

Re: [SQL] pg_dump?

2007-05-15 Thread Andrew Sullivan
)--- TIP 5: don't forget to increase your free space map settings -- 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

Re: [SQL] Serial number of a record

2007-05-15 Thread Andrew Sullivan
. Does the record have a serialno field? If not, you can do it with a temporary sequence. But you should be aware that this serial number as you call it changes from result to result in that case. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern prose is away from

Re: [SQL] Sequence vs. Index Scan

2007-05-07 Thread Andrew Sullivan
if that helps. 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 4: Have you

Re: [SQL] Sequence vs. Index Scan

2007-05-05 Thread Andrew Sullivan
why the optimizer is looking at these differently. In fact, the table the branch_id comes from has the exact same indices and foreign keys on both schemas. Different data? Different statistics? Different numbers of (possibly dead) rows? A -- Andrew Sullivan | [EMAIL PROTECTED] Everything

Re: [SQL] Sequence vs. Index Scan

2007-05-05 Thread Andrew Sullivan
up with dead tuples. I'd look at the output of VACUUM VERBOSE to make sure you don't have a lot of dead tuples. That said, I wonder if fiddling with the statistics on your tables might help. A -- Andrew Sullivan | [EMAIL PROTECTED] In the future this spectacle of the middle classes shocking

Re: Fwd: Re[2]: [SQL] We all are looped on Internet: request + transport = invariant

2007-04-26 Thread Andrew Sullivan
, but is instead some sort of veneer over the face of it? In that case, why not just write some user-space application that takes this (IMO useless) TML and translates it into proper SQL? You don't need to make any changes to Postgres at all, it seems. A -- Andrew Sullivan | [EMAIL PROTECTED] Information

Re: [SQL] We all are looped on Internet: request + transport = invariant

2007-04-20 Thread Andrew Sullivan
a bit about XML, Perl, and Pg.pm. Anyway, I've said enough on this topic. When you have the start of a user library that implements your proposal, perhaps you can post it to -hackers for the response you'll get there. A -- Andrew Sullivan | [EMAIL PROTECTED] When my information changes, I

Re: [SQL] We all are looped on Internet: request + transport = invariant

2007-04-19 Thread Andrew Sullivan
, a really bad idea. A -- Andrew Sullivan | [EMAIL PROTECTED] Users never remark, Wow, this software may be buggy and hard to use, but at least there is a lot of code underneath. --Damien Katz ---(end of broadcast)--- TIP 3: Have you

Re: [SQL] Doing a conditional insert/update

2007-04-19 Thread Andrew Sullivan
design is right if this is the approach you're trying to take (it's not impossible that it's the right way, just that this is often a workaround for a dodgy data model in the first place). What is the conflict you're trying to avoid? A -- Andrew Sullivan | [EMAIL PROTECTED] The fact

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Andrew Sullivan
). The question is: how accurate is floating point numbers in Postgres. We As accurate as they are in the underlying C implementation, which is to say not accurate enough for financial data. A -- Andrew Sullivan | [EMAIL PROTECTED] A certain description of men are for getting out of debt, yet

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Andrew Sullivan
quick primer that can help you understand this is at http://www2.hursley.ibm.com/decimal/decifaq1.html.) A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern prose is away from concreteness. --George Orwell ---(end of broadcast

Re: [SQL] A long-running transaction

2007-04-13 Thread Andrew Sullivan
of it, so it fits the idea of a single transaction. It might be that my demands exceed Postgresql's current capabilities, but by itself it doesn't make what I'm trying to do unreasonable. No, it's not unreasonable, but it happens to be a pessimal case under Postgres. A -- Andrew Sullivan

Re: [SQL] We all are looped on Internet: request + transport = invariant

2007-04-13 Thread Andrew Sullivan
fantastically hard that you can't learn it. Indeed, I'm pretty sure that if someone as foolish as I can learn it, anyone can. A -- Andrew Sullivan | [EMAIL PROTECTED] If they don't do anything, we don't need their acronym. --Josh Hamilton, on the US FEMA

Re: [SQL] A long-running transaction

2007-04-13 Thread Andrew Sullivan
On Fri, Apr 13, 2007 at 07:49:19AM -0400, Andrew Sullivan wrote: On Fri, Apr 13, 2007 at 09:02:58AM +0800, John Summerfield wrote: 1. For the first day or so, my observation was that the disk was not particularly busy. That's completely consistent with the theory I have. As the number

Re: [SQL] A long-running transaction

2007-04-13 Thread Andrew Sullivan
contributed was both somewhat controversial and somewhat limited in its application. 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

Re: [SQL] ERROR: column crc does not exist

2007-04-12 Thread Andrew Sullivan
the identifier when you create the table. 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] A long-running transaction

2007-04-11 Thread Andrew Sullivan
this is your problem -- the update pattern is. 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 3: Have you checked our

Re: [SQL] A long-running transaction

2007-04-10 Thread Andrew Sullivan
buffers? If you haven't given very much, there won't be much in the way of buffers used, of course. Note that there's a much earlier diminishing return on the size of shared buffers in Postgres than in many systems. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern prose

Re: [SQL] new idea

2007-04-09 Thread Andrew Sullivan
this do that inheritance doesn't already do? I don't think I see anything. A -- Andrew Sullivan | [EMAIL PROTECTED] Everything that happens in the world happens at some place. --Jane Jacobs ---(end of broadcast)--- TIP 2: Don't

Re: [SQL] slow query

2007-04-05 Thread Andrew Sullivan
with a table that was updated _very very_ often. The answer turned out to be to update less often. Aggregating queries that could use an index over a large number of expired rows worked better than seqscans over large numbers of dead tuples.) A -- Andrew Sullivan | [EMAIL PROTECTED] Information

Re: [SQL] Update problem.

2007-04-03 Thread Andrew Sullivan
might be better to try another method.) A -- Andrew Sullivan | [EMAIL PROTECTED] Everything that happens in the world happens at some place. --Jane Jacobs ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] A long-running transaction

2007-04-03 Thread Andrew Sullivan
field in another table; the source data for that other table is less than a megabyte. this is a real issue. Basically, you're constrained at the rotation speed of your disk, because for each record, you have to first find then update one row somewhere else. A -- Andrew Sullivan | [EMAIL

Re: [SQL] Update problem.

2007-04-02 Thread Andrew Sullivan
it. I'd lock the table in question while you did all this. 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 Morris ---(end

Re: [SQL] Track query status

2007-03-28 Thread Andrew Sullivan
is the query i've ran 48 million records is a lot. You oughta see activity with iostat or something. A -- Andrew Sullivan | [EMAIL PROTECTED] When my information changes, I alter my conclusions. What do you do sir? --attr. John Maynard Keynes ---(end

Re: [SQL] Regular Expressions

2007-03-21 Thread Andrew Sullivan
%' or ~ 'blahblah.*', they're AFAIK about the same. When you have a more complicated RE, though, it might turn out to be a win. A -- Andrew Sullivan | [EMAIL PROTECTED] Information security isn't a technological problem. It's an economics problem. --Bruce Schneier

Re: [SQL] triple self-join crawling

2007-03-19 Thread Andrew Sullivan
---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq -- Andrew Sullivan | [EMAIL PROTECTED] Unfortunately reformatting the Internet is a little more painful than reformatting your hard drive when

Re: [SQL] import CSV file

2007-03-14 Thread Andrew Sullivan
On Tue, Mar 13, 2007 at 11:52:17PM +, T E Schmitz wrote: Also, it's nopt happy about the date format : 2007/02/09 You may need to fiddle with your date style. It works for me on 8.1: SELECT '2007/02/09'::date; date 2007-02-09 (1 row) A -- Andrew Sullivan | [EMAIL

Re: Fw: [SQL] CREATE TABLE

2007-03-09 Thread Andrew Sullivan
for that environment. 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)--- TIP 3: Have you checked our extensive FAQ

Re: [SQL] best index for ~ ordering?

2007-03-07 Thread Andrew Sullivan
(). 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] SHA-1 vs MD5

2007-03-07 Thread Andrew Sullivan
plan to introduce it on PostgreSQL. What is the problem you're trying to solve? Md5 is probably good enough for many cases, but for long-term use, you're right that sha-1 is what you need. Actually, you need sha-256, quite frankly. a -- Andrew Sullivan | [EMAIL PROTECTED] I remember when

Re: [SQL] [Fwd: View Vs. Table]

2007-03-06 Thread Andrew Sullivan
of rules in the manual (views are basically just an automatic application of certain rules). A -- Andrew Sullivan | [EMAIL PROTECTED] Information security isn't a technological problem. It's an economics problem. --Bruce Schneier ---(end of broadcast

Re: [SQL] best index for ~ ordering?

2007-03-06 Thread Andrew Sullivan
of match are you doing? If you're doing left-anchored searches (LIKE 'blah%') then your standard btree is good. If you're doing unanchored searches (LIKE '%blah%' or similar) you're best doing tsearch. If it's right-anchored, you can do an index on the reverse of the string. A -- Andrew Sullivan

Re: [SQL] Case with Char(1)

2007-02-28 Thread Andrew Sullivan
On Wed, Feb 28, 2007 at 10:02:38AM -0300, Ezequias Rodrigues da Rocha wrote: Hi list, it is possible to use case with character (1) ? I am having problems to formate the SQL statement. Your example looked like it worked. A -- Andrew Sullivan | [EMAIL PROTECTED] Users never remark, Wow

Re: [SQL] pg_dump fails (timestamp out of range)

2007-02-26 Thread Andrew Sullivan
up in the same place next time. 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 6: explain analyze is your

Re: [SQL] Problems with temp table and PL

2007-02-21 Thread Andrew Sullivan
the docs. 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)--- TIP 6

Re: [SQL] Uppercase and Lowercase

2007-02-19 Thread Andrew Sullivan
On Mon, Feb 19, 2007 at 04:22:06PM +0100, Shavonne Marietta Wijesinghe wrote: Hello In my PostgreSQL database i have records inserted in Uppercase. For example: VIA SENATO What i want is to change them to Via Senato. Have a look at the initcap() function. A -- Andrew Sullivan

Re: [SQL] ordering of selected rows from an ordered subselect

2007-02-17 Thread Andrew Sullivan
something that alters it, no? All things considered, it's a pretty good _bet_ it will be ordered as you wish, though. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern prose is away from concreteness. --George Orwell ---(end

Re: [SQL] Open a Transaction

2007-02-08 Thread Andrew Sullivan
On Thu, Feb 08, 2007 at 03:13:16PM -0200, Ezequias Rodrigues da Rocha wrote: Any suggestion instead of change my max_stack_depth ? Well, I suppose you could put the numbers in a temp table an NOT IN on that. A -- Andrew Sullivan | [EMAIL PROTECTED] The fact that technology doesn't work

Re: [SQL] Removing duplicate rows

2007-02-06 Thread Andrew Sullivan
. . . WHERE 1=0. You get a table with no rows. (WHERE FALSE and similar constructs all work equally well.) 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

Re: [SQL] Duplicate records

2007-02-02 Thread Andrew Sullivan
ps: I just think postresql could make this easyly. Don't you think ? Any function or anything else. What's hard about the self-join? That's how SQL works. A -- Andrew Sullivan | [EMAIL PROTECTED] When my information changes, I alter my conclusions. What do you do sir

Re: [SQL] Nocount and scope_identity()

2007-02-02 Thread Andrew Sullivan
wondering if the SCOPE_IDENTITY() method is going to work or not. I doubt it. What does it do? 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

Re: [SQL] Nocount and scope_identity()

2007-02-02 Thread Andrew Sullivan
are sharing a pooled connection (and if transactions mean anything to you, you'd better not be doing). A -- Andrew Sullivan | [EMAIL PROTECTED] The fact that technology doesn't work is no bar to success in the marketplace. --Philip Greenspun ---(end

Re: [SQL] Compilation Error AIX

2007-02-01 Thread Andrew Sullivan
address or mailto:[EMAIL PROTECTED] Thank you. -- 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

Re: [SQL] Insert Data and autonumeric field

2007-02-01 Thread Andrew Sullivan
the docs. A -- Andrew Sullivan | [EMAIL PROTECTED] Information security isn't a technological problem. It's an economics problem. --Bruce Schneier ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your

Re: [SQL] Differentiate Between Zero-Length String and NULLColumn Values

2007-02-01 Thread Andrew Sullivan
to put words in his mouth, but I think you missed the bit where Peter said the result is not what some people expect. Hint: 'somevalue = NULL' is not a violation of SQL in that you don't get an ERROR. A -- Andrew Sullivan | [EMAIL PROTECTED] The year's penultimate month is not in truth a good way

Re: [SQL] Index Anding

2007-01-31 Thread Andrew Sullivan
hints about this in the FAQ_AIX. 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 3: Have you checked our

Re: [SQL] Differentiate Between Zero-Length String and NULL Column Values

2007-01-30 Thread Andrew Sullivan
to be NULL, use the traditional \N to signify NULL on your way in, or define null some other way. A -- Andrew Sullivan | [EMAIL PROTECTED] Users never remark, Wow, this software may be buggy and hard to use, but at least there is a lot of code underneath. --Damien Katz

Re: [SQL] Differentiate Between Zero-Length String and NULLColumn Values

2007-01-30 Thread Andrew Sullivan
' ' and NULL are not. But since I'm not an Oracle user, people should feel free to ignore me :) A -- Andrew Sullivan | [EMAIL PROTECTED] Everything that happens in the world happens at some place. --Jane Jacobs ---(end of broadcast

Re: [SQL] Differentiate Between Zero-Length String and NULLColumn Values

2007-01-30 Thread Andrew Sullivan
it's like that. I do recall hearing a lot about how stupid Postgres was because it didn't like something that worked perfectly well on Oracle, which I was assured was the most SQL-compliant system on the planet. Happily, I no longer work with any of those people :) A -- Andrew Sullivan

Re: [SQL] Log, Logs and more Logs

2007-01-30 Thread Andrew Sullivan
-logging.html 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 7: You can help support the PostgreSQL project by donating

Re: [SQL] Log, Logs and more Logs

2007-01-30 Thread Andrew Sullivan
as the thing that caused the error. 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 Morris ---(end of broadcast

Re: [SQL] Very strange postgresql behaviour

2007-01-29 Thread Andrew Sullivan
was a long time ago, and I dimly remember something about data corruption early in the 7.4 series. It could be the source of your problem. 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

Re: [SQL] LEFT Join Question

2007-01-26 Thread Andrew Sullivan
OUTER JOIN the table you just LEFT JOINed to to the next table using a different column. A -- Andrew Sullivan | [EMAIL PROTECTED] Information security isn't a technological problem. It's an economics problem. --Bruce Schneier ---(end of broadcast

Re: [SQL] Using Temporary Tables in postgres functions

2007-01-25 Thread Andrew Sullivan
the statement. The problem is that the plan is cached for later re-use. Since the cached plan has the id of a table that no longer exists, you get this error. See the PL/pgSQL part of the manual for more on this. A -- Andrew Sullivan | [EMAIL PROTECTED] Unfortunately reformatting the Internet

Re: [SQL] select based on multi-column primary keys

2007-01-21 Thread Andrew Sullivan
, but an artificial one. The OP already has a real primary key. SQL purists think artificial primary keys mean that you haven't done enough normalisation. I'm going to remain silent on that topic, though, so that we don't get a Thread That Does Not End :) A -- Andrew Sullivan | [EMAIL PROTECTED

Re: [SQL] Permissions Query?

2007-01-19 Thread Andrew Sullivan
/functions-info.html#FUNCTIONS-INFO-ACCESS-TABLE 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 2: Don't 'kill -9

Re: [SQL] Update query by joining multiple tables.

2007-01-17 Thread Andrew Sullivan
to appear in the WHERE condition and the update expressions. a -- Andrew Sullivan | [EMAIL PROTECTED] Users never remark, Wow, this software may be buggy and hard to use, but at least there is a lot of code underneath. --Damien Katz ---(end of broadcast

Re: [SQL] Postgresql Oracle Heteregenous services - strange behaviour

2007-01-17 Thread Andrew Sullivan
is persistent, so the information gets cached. /speculation A -- Andrew Sullivan | [EMAIL PROTECTED] Everything that happens in the world happens at some place. --Jane Jacobs ---(end of broadcast)--- TIP 2: Don't 'kill -9

Re: [SQL] vacuum process taking more than 33 hours

2007-01-15 Thread Andrew Sullivan
you the space back. 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 3: Have you checked our extensive FAQ

Re: [SQL] vacuum process taking more than 33 hours

2007-01-15 Thread Andrew Sullivan
. 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 7: You can help support the PostgreSQL project by donating

Re: [SQL] deleting records from a table

2007-01-12 Thread Andrew Sullivan
that has a number of now-empty slots can actually be a performance advantage, because new rows don't need to increase the size of the table's on-disk file (so you incur slightly less I/O). There's a sweet spot for this that you can discover by testing. A -- Andrew Sullivan | [EMAIL PROTECTED

Re: [SQL] [SQL NOTIFY Help] sending NOTIFY to the external program

2007-01-03 Thread Andrew Sullivan
On Wed, Jan 03, 2007 at 07:47:34PM +0530, [EMAIL PROTECTED] wrote: Yes, our application is supposed to know *immediately* that a change in the database has occurred since, NOTIFY doesn't get you that anyway. It's _close_ to immediately, but it's still asynchronous. A -- Andrew Sullivan

Re: [SQL] Index + View Question

2006-11-03 Thread Andrew Sullivan
on several tables simply won't work -- if the condition is such that all the tables need to be compared to one another, for instant, no index will help you, because you'll end up pulling everything into memory before anything else can happen. A -- Andrew Sullivan | [EMAIL PROTECTED] When my

Re: [SQL] hi i am getting error...can u solve this

2006-11-02 Thread Andrew Sullivan
On Thu, Nov 02, 2006 at 06:19:45PM +0530, Penchalaiah P. wrote: This is the table it contains some sample data.. but I want to see difference between Between what? A -- Andrew Sullivan | [EMAIL PROTECTED] The year's penultimate month is not in truth a good way of saying November

Re: [SQL] record datatype comparisons

2006-11-01 Thread Andrew Sullivan
always work: because what a record is is not pre-determined, you can't have determinate rules for comparing one record to another. And without determinate rules, you can't have an equality operator. A -- Andrew Sullivan | [EMAIL PROTECTED] This work was visionary and imaginative, and goes to show

Re: [SQL] record datatype comparisons

2006-11-01 Thread Andrew Sullivan
. You can see this from the error message when you do this: testing=# SELECT ROW(1,2) is distinct from ROW ('a','b'); ERROR: invalid input syntax for integer: a This is part of the subtle difference between the record and row datatypes. A -- Andrew Sullivan | [EMAIL PROTECTED] The plural

Re: [SQL] record datatype comparisons

2006-11-01 Thread Andrew Sullivan
at this point, because even if I looked at the code that supports the record type, I wouldn't understand it. A -- Andrew Sullivan | [EMAIL PROTECTED] The whole tendency of modern prose is away from concreteness. --George Orwell ---(end of broadcast

  1   2   3   >