Re: [SQL] rows equal

2001-03-24 Thread Richard H
On 3/20/01, 7:23:04 PM, Marios Moutzouris <[EMAIL PROTECTED]> wrote regarding [SQL] rows equal: > Hello > I need a sql query to a postgresql database which can tell me whether the > rows returned ar equal. > i.e > --- > Status > --- > Order > --- > Collected > -- > This

Re: [SQL] Serials.

2001-03-24 Thread D'Arcy J.M. Cain
Thus spake Grant > Please see below for my table schema. I have two questions. > > (1) Why is a sequence limited to 2147483647, it seems very small? Yikes! What are you counting? :-) The value 2147483647 is the largest value that can fit into an int. It is equal to 0x7fff in hex. If you

Re: [SQL] Serials.

2001-03-24 Thread Richard Huxton
Grant wrote: > > Please see below for my table schema. I have two questions. > > (1) Why is a sequence limited to 2147483647, it seems very small? That's 2 billion(ish) - the largest signed 32 bit integer. > (2) If I reset the sequence, then try another insert. It will not insert > anything u

Re: [SQL] how do I check if a temporary table exists?

2001-03-24 Thread D'Arcy J.M. Cain
Thus spake datactrl > How do I check if a temporary table exists? Searching pg_tables with a > temporary table name we chose always fails. What do you mean? You know that it exists because you just created it and the create succeeded. Can you describe a situation where you need to know about a

Re: [SQL] Serials.

2001-03-24 Thread Mathijs Brands
On Sat, Mar 24, 2001 at 03:55:09PM +1000, Grant allegedly wrote: > Please see below for my table schema. I have two questions. > > (1) Why is a sequence limited to 2147483647, it seems very small? This is the maximum value a signed integer (32-bit) can contain. If this really is a problem for yo

Re: [SQL] Serials.

2001-03-24 Thread Peter Eisentraut
Grant writes: > (1) Why is a sequence limited to 2147483647, it seems very small? Because that's what a four-byte signed integer takes. No one has stepped forward to implement 8-byte sequence counters, yet. > (2) If I reset the sequence, then try another insert. It will not insert > anything u

[SQL] all views in database broken at once

2001-03-24 Thread Andrew Perrin
Greetings- I'm in a bit of a pickle. I rebuilt a big query on top of which lots of little queries rest, so as to use some new columns in the query. Now, I get error messages when trying to access any view that SELECTs from the rebuilt query: fgdata=# \d sx_l_m_r_a ERROR: cache lookup of attrib

Re: [SQL] how do I check if a temporary table exists?

2001-03-24 Thread Tom Lane
[EMAIL PROTECTED] (D'Arcy J.M. Cain) writes: > Thus spake datactrl >> How do I check if a temporary table exists? Searching pg_tables with a >> temporary table name we chose always fails. > What do you mean? You know that it exists because you just created it > and the create succeeded. Can you

Re: [SQL] how do I check if a temporary table exists?

2001-03-24 Thread Bruce Momjian
Multiple backends can create temp tables with the same name and each person will see their own version. > Thus spake datactrl > > How do I check if a temporary table exists? Searching pg_tables with a > > temporary table name we chose always fails. > > What do you mean? You know that it exists

Re: [SQL] all views in database broken at once

2001-03-24 Thread Tom Lane
Andrew Perrin <[EMAIL PROTECTED]> writes: > fgdata=# \d sx_l_m_r_a > ERROR: cache lookup of attribute 197 in relation 47074 failed > fgdata=# select * from pg_views; > ERROR: cache lookup of attribute 317 in relation 48494 failed > A SELECT from the rebuilt query itself works fine, so I know it

Re: [SQL] Serials.

2001-03-24 Thread Grant
> > (1) Why is a sequence limited to 2147483647, it seems very small? > > Yikes! What are you counting? :-) I have a message board. Where users can send each other messages. I doubt I will ever get 2147483647 messages, but I want to make sure I never get an error where the message isn't sent.

Re: [SQL] all views in database broken at once

2001-03-24 Thread Andrew Perrin
Thanks - I appreciate the quick reply. As it turns out, I was able to find the original SQL I used to generate (most of) the queries, so I'm okay. But I'm intrigued: what is it that causes this? Is it *my* recreating the view on which the other views depend, or is it some internal glitch? Thanks

Re: [SQL] all views in database broken at once

2001-03-24 Thread Tom Lane
Andrew Perrin <[EMAIL PROTECTED]> writes: > But I'm intrigued: what is it that causes this? Is it *my* > recreating the view on which the other views depend, Yes. You dropped and recreated the view --- the new version may have the same name but it's not the same OID, so it isn't the same object.

Re: [SQL] all views in database broken at once

2001-03-24 Thread Mathijs Brands
On Sat, Mar 24, 2001 at 07:50:00PM -0500, Tom Lane allegedly wrote: > Andrew Perrin <[EMAIL PROTECTED]> writes: > > But I'm intrigued: what is it that causes this? Is it *my* > > recreating the view on which the other views depend, > > Yes. You dropped and recreated the view --- the new version

Re: [SQL] Serials.

2001-03-24 Thread Dan Lyke
Grant writes: > I have a message board. Where users can send each other messages. I > doubt I will ever get 2147483647 messages, but I want to make sure I > never get an error where the message isn't sent. Think about loads. If your users are going to be posting 10 messages/second, that's 864000

Re: [SQL] all views in database broken at once

2001-03-24 Thread Tom Lane
Mathijs Brands <[EMAIL PROTECTED]> writes: > How about being able to recompile them (keeping the SQL around in the > system catalogs)? Doesn't Oracle allow you to do something like that? That's another possibility. It's not real clear that there's any advantage to storing rules in preparsed form