[SQL] Problem with pg_index.
Hi the list ! I'm new to this list. I've tried to write a sql query to get all the fields of a table and to have mentionned is a field can be null or not, and if a field is a key or not. Before showing the query I send, let me tell you that I'm running postgre v7.1.2 on a SuSE Linux 6.4 box, and that everything works fine but this query. Here it is : select pg_class.oid, pg_attribute.attname, pg_attribute.attbyval, pg_attribute.attnotnull from pg_class, pg_attribute, pg_index where relname='essai2' and pg_attribute.attrelid=pg_class.oid and pg_attribute.attnum >0 and pg_index.indrelid=pg_class.oid and pg_index.indkey[0] = pg_attribute.attnum This query doesn't work, the back-end answers Error : Invalid Command name "0"... What now ? I've checked out the online doc, and the archives of this list (that's where I got pg_index.indkey[0] from), but nothing seems to work, since pg_index.indkey seems to be an int2vector, and I found no integrated function to check if a value is in this vector... Thanks for your ideas and//or help. -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[Fwd: [SQL] Problem with pg_index.]
-- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 Tom Lane wrote: You are totally right ! > > I don't think so: there is no such error string anywhere in the PG > sources. (Also, when I try the query, it seems to work fine.) > > However, I find the following possibly relevant match in the PGAccess FAQ: > > 8. I am receiving the following error: message invalid command > name "namespace" while executing "namespace eval Mainlib ..." > That means 100% that you have an older version of Tcl/Tk that > don't recognize namespaces command. Please upgrade to Tcl/Tk 8.0.x >minimum > > Are you using Tcl? If so, I'd bet the problem is on the client side. Indeed I use pgaccess, and when I type the query under psql, it works fine, so I'm downloading the sources of tcl8.3.3 and upgrade as soon as possible. Yet, I have a problem with complex keys, I can't check pg_index[0] on every row fetched, so, how can I do ? I've tried to add arrays extentions, but the *= operator doesn't work with int2vector How can I do then ? Thanks anyway ! Have a nice week-end. -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl
[SQL] How to use the type int2vector ?
Hi the list ! How can I make a test on a int2vector ? If I have a vector that contains (1, 2, 5, 9), how can I check these values incivicually ? Thanks by advance for your help. -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl
Re: [SQL] How to use the type int2vector ?
David BOURIAUD wrote: > > Hi the list ! > How can I make a test on a int2vector ? If I have a vector that contains > (1, 2, 5, 9), how can I check these values incivicually ? Thanks by > advance for your help. I answer myself by posting another question... Is there a way to know from the system tables the keys of a table ? If there is only one key, it is not hard to know, but when there are more than one, how can I do ? Thanks by advance. -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
[SQL] About i8n
Hi the list ! I principally use postgres with php, but I think that for my question, it remains the same... Is there a way to have all error messages returned by the back-end translated into french or another language ? If so, how to set it up ? Thanks by advance. -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
[SQL] About table column names.
Hi the list ! As far as I know, column names for a table can't contain any space, tabs, and other sort of "exotic" characters. Is there a way to add a description of a table column anywhere in postgres tables, or does it have to be handled manually by creating a custum table handling this kind of datas ? Thanks by advance for any suggestion. -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [SQL] Re: About i8n
"J.H.M. Dassen (Ray)" wrote: > > David BOURIAUD <[EMAIL PROTECTED]> wrote: > > Is there a way to have all error messages returned by the back-end > > translated into french or another language ? > > http://www.de.postgresql.org/devel-corner/docs/postgres/nls.html Thanks, but it doesn't help in any way ! It tells how to have a client program have nls support, but not postgres ! I'm running postgreSQL v7.1.2, and neither found any *.po, *.mo or *.mk files in the tree directory of either the sources or the bianries. Furthermore, when I type gmake init-op, gmake complains that there is no rule to make init-po. Well, well, well, not so good. By the way, I can speak english, so it's not a problem for me, but I think of my users ! Thanks again, for I learned something consulting theses pages anyway. -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [SQL] graphical interface - admin
Le Jeudi 27 Juin 2002 13:50, q u a d r a a écrit : > What's the best open source GUI for DB administration? (postgres) Why ? Mine of course ! Noway for this stupid answer ! Well, I would say that you have at least two choices amongst those I know : phpPgAdmin, which works as it's name says with php, and one that is called pgaccess and which is brought along with the sources of postgreSQL, and which is written in tcl/tk (as far as I know). Anyway, neither of them fits my needs. You also have commercial solutions, like creating a linked db with msAccess (using ODBC), or BO (orientated for editions). Anyway, you've got many choices. As for what I first said in this mail, I'll launch the development of a Kde application (I think called KPostgreSQL...), which will have to fit the following : -Ability to open as many DB connections as possible in one MDI frame (as you can open many documents in KAte). -Graphical interface for all the administrative tasks (tables creations, permissions...) nearly as Access does. -Intelligent queries (at requests), which are able to do autimatic joins (as far as they are created at table creation time). -Nice editions made with LaTeX, providing there are classes made. -etc... In the future, when I get a full comprention of KParts, it may be integrated with KWords and all the Koffice suite (I mean, you could embed a query in KSpread, and so on...). That's what I plan to do, all in C++, and only for Kde. When the project will be far enough, I'll open the sources, using CVS I think, and enjoy my time coding and maybe recieving help. Whatever happens in the future, I WANT to code this, and will work on it since I need it. > > > > > ---(end of broadcast)--- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 ---(end of broadcast)--- TIP 3: 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
[SQL] SQL problem with aggregate functions.
Hi the list ! I've got a table in which there is a field that can have one amongst 3 possible values : D, R, X. Is it possible to get in one query the count of this different values.Please, note that I don't want to have a querry like this : "select count (*) from tab group by f1;", cause i want to get all the possible count values in one row (these data are already grouped on another field). To give a more accurate example, here is what I want to retrieve : Field group | count of D | count of R | count of X. Any clues ? -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [SQL] query/transaction history/logs
Le Mercredi 10 Juillet 2002 10:34, q a écrit : > Is there anyway we can track queries entered? > Is there a table that stores all the actions that a user entered? (history) > Is there such a feature? > For both of your problems, see the way you can launch the postmaster. For example, I use to launch it this way : postmaster -i -d2 &> /var/log/postmaster.log & Thus, you get all you want in the log file /var/log/postmaster.log Now, you can get as much infos as you want according to the level of debug you want (from 1 to 9 as far as I remember, the greater, the more speech you get from the postmaster). > ---(end of broadcast)--- > TIP 4: Don't 'kill -9' the postmaster -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]