[SQL] left and outer joins?
I see in the TODO that left and outer joins are supposedly a priority. I do wonder what the status is, since the email correspondence shows the most recent email as being from something like march or july of 1999. what is the status on left and outer joins? thanks michael __ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/
[SQL] get table schema in psql?
how can I get the schema of a table in psql? in oracle I would do "desc tablename". I remember sql server and ingres having a similar facility. right now the only way I seem to be able to get the information is by using pgaccess. I realize the definition of the table is probably spread across the various pg_ system tables, but I'm thinking there must be some easier way to get the info. in particular, I'm after the list of columns, their data types and lengths, null/non-null, default values, and table indices. thanks, michael __ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/
Re: [SQL] get table schema in psql?
doh! thanks so much. somehow I thought \h and \? were the same, and I've only been doing \h :) no wonder I couldn't find it. michael --- Patrik Kudo <[EMAIL PROTECTED]> wrote: > Hi! > > I think what you're looking for is > > \d > > and > > \d name_of_table > > You might also want to try > > \? > > for a list of all psql commands > > Regards, > Patrik Kudo > > ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo > un\2\1 is xg'`ol > Känns det oklart? Fråga på! > > On Fri, 15 Sep 2000, Michael Teter wrote: > > > how can I get the schema of a table in psql? > > > > in oracle I would do "desc tablename". I remember > sql > > server and ingres having a similar facility. > > > > right now the only way I seem to be able to get > the > > information is by using pgaccess. > > > > I realize the definition of the table is probably > > spread across the various pg_ system tables, but > I'm > > thinking there must be some easier way to get the > > info. > > > > in particular, I'm after the list of columns, > their > > data types and lengths, null/non-null, default > values, > > and table indices. > > > > thanks, > > michael > > > > __ > > Do You Yahoo!? > > Yahoo! Mail - Free email you can access from > anywhere! > > http://mail.yahoo.com/ > > > __ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/
[SQL] renaming columns... danger?
hi. I just discovered that doing an alter table ... alter column (to rename a column) does not do a complete rename throughout the database. for example, say you have table a, with columns b and c. b is your primary key. now rename b to new_b. if you do a dump of the schema after you rename, you'll find that you can't reload that schema because at the bottom of the definition of table a you have PRIMARY KEY ("b"). shouldn't rename update any index and key definitions? also, and this may actually the source of the problem, while scanning my full (schema and data) dump, I noticed that the contents of table pga_layout also had the old values of columns that I have renamed. I'm very frightened right now, because I'm rather dependent upon my database right now. I don't like the thought that my database is corrupt at the schema level. michael __ Do You Yahoo!? Yahoo! Messenger - Talk while you surf! It's FREE. http://im.yahoo.com/
Re: [SQL] shared memory problem
I'm not sure if this is related, and unfortunately I don't have the specific error in front of me, but on occasion when I restart postgresql, using $ /etc/rc.d/init.d/postgresql restart I'll see the shutdown message, then I'll see a shared memory creation error, which I think looked similar to the one below. In the past I would just boot the box, and postgresql naturally would start up just fine. But last time it happened I waited a minute, then attempted the restart again (which obviously would just do a start, as postgresql wasn't running because of previous failure.) It started up fine that time. Perhaps there's some issue with the shared memory not being freed quickly enough by the kernel? michael --- Tom Lane <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> writes: > > /usr/local/pgsql/bin/postmaster -B 1000 -o "-S > 2000" -S -D > > /usr/local/pgsql/data > > > and it says: > > IpcMemoryCreate: shmget failed (Invalid argument) > key=5432001, > > size=8899584,permission=600 > > This type of erro is usually caused by an improper > shared memory or System V > > IPC semaphore configuration. Form more > information > > Most likely your kernel isn't set to allow shared > memory blocks as > large as 8M. > > regards, tom lane __ Do You Yahoo!? Yahoo! Calendar - Get organized for the holidays! http://calendar.yahoo.com/
Re: [SQL] Using a postgres table to maintain unique id?
> Can someone show me how to create (and use) an int8 > sequence? >From what I can tell (both from docs and doing a describe on sequences in my database), a postgresql sequence is an int4, not an int8, and thus you are limited to a max of 2.1 billion values. If you require an int8 sequence, you'll probably have to manage your own and just use an int8 column. > Fortunately, I don't want any number to ever get > recycled - the id needs to > be unique throughout the 25+ year lifetime of the > project. The table > would have a single row with a single column. > Selecting that table cell > would return the current value, but leave the value > incremented in the > table cell (it's ok if it increments the value > before returning). If 2.1 billion unique values is enough, then a sequence will work fine. Performance of sequence should be ok. An alternative you might consider is creating your own "sequence server" external to the database. Michael __ Do You Yahoo!? Yahoo! Calendar - Get organized for the holidays! http://calendar.yahoo.com/