Re: [SQL] Programatically switching database

2003-11-15 Thread Peter Eisentraut
PostgreSQL has schemas, that's the same thing. PostgreSQL's "databases" are not the same thing as MySQL's "databases". -- Peter Eisentraut [EMAIL PROTECTED] ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Multicolum index and primary key

2003-11-17 Thread Peter Eisentraut
ll do it ;-) You could also have read the documentation about multicolumn indexes, because it contains exactly this example. -- Peter Eisentraut [EMAIL PROTECTED] ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] multiple function declarations

2003-11-17 Thread Peter Eisentraut
ere is usually no reason not to do that. -- Peter Eisentraut [EMAIL PROTECTED] ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [SQL] Permissions problem on 7.4

2003-12-01 Thread Peter Eisentraut
lem with my application, so I downloaded > postgresql_autodoc (http://www.rbt.ca/autodoc/) in order to check the > permissions better. > It also claims that group salesmen has the right to SELECT, INSERT and > DELETE on table clients. Report a bug to the authors of that program. -- Peter Eisentraut

Re: [SQL] How Do I Toggle Quoted Identifiers?

2003-12-04 Thread Peter Eisentraut
ow do I turn case-sensitivity off? There is no setting for that either. -- Peter Eisentraut [EMAIL PROTECTED] ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Values like ''

2003-12-09 Thread Peter Eisentraut
Elielson Fontanezi wrote: > Why does the following query work on pgsql 7.2.3 and not in pgsql > 7.3.4? Please be more detailed on your idea of "works" and "does not work". ---(end of broadcast)--- TIP 7: don't forget to increase your free space

Re: [SQL] Fetch a single record

2003-12-09 Thread Peter Eisentraut
David Shadovitz wrote: > I'm looking for the fastest way to fetch a single record from a > table. I don't care what record it is. > > Here are two techniques I've explored: > > 1. Use LIMIT > SELECT * FROM myTable LIMIT 1 > > 2. Get a valid OID and then get the record. > SELECT MIN(oid) AS anOID FR

Re: [SQL] Faster performance when using where cust_id = '123' vs cust_id = 123. Does 7.4 fix this??

2003-12-09 Thread Peter Eisentraut
David B wrote: > We have got used to the problem that queries of the format: > > select * > from customer > where cust_id = '123' are much much faster than > > select * > from customer > where cust_id = 123 > > (where cust_id is defined as bigint). > > a. Why is this. Because in the second case, t

Re: [SQL] dump and schema

2003-12-16 Thread Peter Eisentraut
Olivier Hubaut wrote: > I think this won't get the same result he expects. As I know, the > CURRENT_DATE will always give the current day, not the day you > inserted the row. Your knowledge is incorrect. ---(end of broadcast)--- TIP 8: explain anal

Re: [SQL] failed to build any 5-way joins

2003-12-16 Thread Peter Eisentraut
Alessandro Depase wrote: > The query generating the error is: This is useless unless we know table schema, what data is in the tables, and what software version you use. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Calendar Scripts - Quite a complex one

2004-01-06 Thread Peter Eisentraut
Kumar wrote: > I am working on Postgres 7.3.4 on RH Linux . For our application, we > are in a position to give calendar function (appointments and > scheduling) with our application. Can somebody suggest me links or > sample scripts for developing the calendar function. You can probably lift out

Re: [SQL] Notation of index

2004-01-07 Thread Peter Eisentraut
Andreas wrote: > Why can['t] we use INDEX the same way as UNIQUE ? > Perhaps even as in > ... > numba INT4NOT NULLINDEX > ... If the choice were just index or no index, then this might be ok, but when you create an index you can choose the index type, the operator class, a partial in

Re: [SQL] Importation wtih copy generated some wrong registers..

2004-01-07 Thread Peter Eisentraut
Rodrigo Sakai wrote: > I did some importation from a .csv file to a table > > (this is a very small piece of the csv file, but i think its good for > the exemple. the pipe "|" is the delimiter for this file) > 001|002|3041300045027612|002 > 001|002|3041000218146611|002 > 001|002|3040600

Re: [SQL] Left outer join on multiple tables

2004-01-11 Thread Peter Eisentraut
David Witham wrote: > Is there a way to do left outer joins on more than 2 tables at once > (3 in my case)? Or do I have to do the first join into a temp table > and then another join from the temp table to the third table? I can't > seem to work out the syntax from the User Guide. SELECT * FROM a

Re: [SQL] Triggers

2004-01-12 Thread Peter Eisentraut
beyaRecords - The home Urban music wrote: > does postgresql support the ability to email as in SQL Server? I want > to create a trigger which on input of a record will send out an > email. Is this possible? Write a trigger function in, say, PL/PerlU or PL/sh and have it send the email with the us

Re: [SQL] Problems with postgresql 7.4.1 configuration - URGENT

2004-01-13 Thread Peter Eisentraut
beyaRecords - The home Urban music wrote: > this all started because I wanted to install pltclu so that I could > gain access to pgmail using tcl. I have re-run the build and even > though I have specified --with-tcl as one of the components of the > build, tcl is not installed in the /lib director

Re: [SQL] Configure issues

2004-01-13 Thread Peter Eisentraut
beyaRecords - The home Urban music wrote: > I am in the process of re-building postgresql 7.4.1, and on running > configure I get the following output, of interest to me is the error > message about ant even though it is installed in /library/ant, so i > don't know why it is complaining. Any ideas?

[SQL] techniques for manual ordering of data ?

2004-02-07 Thread Peter Galbavy
y "prior art" or suggestions on how they acheive this ? Note that I am NOT including ordering based on an photograph specific metadata like time or location. That's another story and another interface. rgds, -- Peter ---(end of broadcast)---

Re: [SQL] [pgsql-advocacy] SQL Spec Compliance Questions

2004-04-03 Thread Peter Eisentraut
Josh Berkus wrote: > > 4.16.2 Referenceable tables, subtables, and supertables > > A table BT whose row type is derived from a structured type > > ST is called a typed table. Only a base table or a view can be a > > typed table. A typed table has columns corresponding, in name and > > decla

Re: [SQL] SQL Spec Compliance Questions

2004-04-03 Thread Peter Eisentraut
Josh Berkus wrote: > Just got this "do we support it" questionnaire from a signficant > commercial entity vaguely interested in supporting PostrgreSQL. > Since I'm often foggy on the differences between the SQL99 and SQL92 > spec definitions of things, I thought I'd post it for feedback here: T

Re: [SQL] Server Side C programming Environment Set up

2004-04-21 Thread Peter Eisentraut
Kemin Zhou wrote: > IN chapter 33 Extending SQL > 33.7.5 Writing Code > when run pg_config --includedir-server > I got /usr/local/pgsql/include/server but my machine does have this > directory make install-all-headers It's explained in the installation instructions. ---

Re: [SQL] Server Side C programming Environment Set up

2004-04-22 Thread Peter Eisentraut
Am Donnerstag, 22. April 2004 15:58 schrieb Rod Taylor: > > make install-all-headers > > > > It's explained in the installation instructions. > > That doesn't happen on most platforms in the standard package. It certainly happens in all the packages that have ever come by me (maybe after a little

Re: [SQL] Server Side C programming Environment Set up

2004-04-22 Thread Peter Eisentraut
Am Donnerstag, 22. April 2004 07:59 schrieb Tom Lane: > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > make install-all-headers > > That's not a complete solution though; the headers are only half the > problem. Makefiles are the other half, and our story on them i

Re: [SQL] Server Side C programming Environment Set up

2004-04-23 Thread Peter Eisentraut
Am Donnerstag, 22. April 2004 18:07 schrieb Tom Lane: > I agree with the suggestion elsewhere in the thread about generalizing > the contrib Makefile framework to the point that it could be installed > as part of the -devel RPM, and then used to build user-written backend > functions. It seems to

Re: [SQL] Record Lock details

2004-04-23 Thread Peter Eisentraut
Am Freitag, 23. April 2004 10:43 schrieb Denis P Gohel: > Is there a data dictionary in Postgres from where i can get the info about > locked rows of any table ? If possible the value of those locked record ? No, this information is not available for end users. > I have an ODBC application workin

Re: [SQL] a wierd query

2004-05-13 Thread Peter Childs
esired result >b) if so what would it be. > > 4) remarks > > i can get the solution using a temporary table and with repeated > "insert into temporary select $column from main_table" > > select distinct t from (select string_A as t from main_table union

Re: [SQL] SELECT - ORDER BY Croatian characters ....

2004-05-07 Thread Peter Eisentraut
Kornelije wrote: > I'm using PostgreSQL and my database contains Croatian Characters > (ccz...) so when I pose a query, and I use order by clause, the > result is not sorted properly. You need to initdb your database with the proper locale (hr_HR, probably). Also, choose the right encodi

Re: [SQL] Permissions not working

2004-05-01 Thread Peter Eisentraut
Pallav Kalva wrote: > Also here is the privileges information from information_schema > tables. Is there a way to REVOKE these > privileges ? You need to log in as the user that has granted the privilege you want to revoke. In this case, log in as postgres and do REVOKE ALL FROM PUBLIC;.

Re: [SPAM] Re: [SQL] Permissions not working

2004-05-03 Thread Peter Eisentraut
Pallav Kalva wrote: > I tried both database privileges and table privileges (all and > select) it still doesnt work. Not sure > what is wrong here, I tried logging in as both postgres and usps user > and both them doesnt work. What about all those groups that have privileges? Please post the

Re: [SQL] start

2004-05-03 Thread Peter Eisentraut
H.J. Sanders wrote: > I have difficulties starting the postmaster automatically at boot > time (everything I tried is done by 'root'). > > Can someone give me an example for LINUX (SUSE 8). Maybe you would rather want to download the binary packages, which take care of that. RPMs for SuSE are av

Re: [SQL] Getting FK relationships from information_schema

2004-06-08 Thread Peter Eisentraut
Tom Lane wrote: > Kyle <[EMAIL PROTECTED]> writes: > > I think this is only an issue when the user relies on postgres to > > choose a constraint name automatically. Seems like a reasonable > > approach would be to have postgres choose a name for the constraint > > that happens to be unique in the

Re: [SQL] In 7.4 ensure you have DEFAULT now () with no spaces

2004-06-19 Thread Peter Eisentraut
bles > contained now () > as in: > > created_timestamp timestamp DEFAULT now () -- note the space > between now and () > > Most had correctly been defined without the space - as in now() Whatever it was, that was not the problem. With 7.4.1: peter=# create table test1 (foo tex

Re: FW: [SQL] "=" operator vs. "IS"

2004-06-29 Thread Peter Eisentraut
Rich Hall wrote: > My question is why is the form > > "(anything) = NULL" > > allowed? > > Since > > "(anything) = NULL" is always Null, this cannot be what the coder > intended. Using that same line of argument, why is 1+1 allowed? The coder clearly knows that it is 2, so why is he writing that

Re: [SQL] Custom type where not all elements are comparable

2004-07-05 Thread Peter Eisentraut
Markus Bertheau wrote: > Is it possible to define or implement a type in PostgreSQL not all > values of which are comparable to each other? In particular I'm > thinking of a duration type similar to the XML Schema duration > type[1]. For example P2D (2 days) is less than P4D (4 days), but P1M > (1

[SQL] BYTEA output presentation

2004-07-16 Thread Peter Wang
tal format ? If you can, how ? Or do you know any third party tool or script which can output the hexadecimal or octal format for PostgreSQL's BYTEA datatype ? Your help is appreciated. Thank you. Peter Wang, ---(end of broadcast)---

Re: [SQL] BYTEA output presentation

2004-07-16 Thread Peter Eisentraut
Peter Wang wrote: > The BYTEA data look like "/031/024/001/003?/022/". > How can I use some PostgreSQL function to remove "/" when I use > select statement ? What type of format is the BYTEA datatype? Can I > output it to hexadecimal or octal format ? If you

Re: [SQL] [JDBC] [ADMIN] Migrate postgres databases from SQL_ASCII to UNICODE

2004-07-18 Thread Peter Eisentraut
supported encoding. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

[SQL] fail to compare between bytea output in plpgsql

2004-07-20 Thread Peter Wang
I have a function and am using cursor. All the columns I select in the cursor clause are BYTEA datatype. I need to compare the after-fetch-value for two BYTEA columns which is temp2 and temp3 shown as below. I don't think I can compare it because there is no record in temp table which I use f

Re: [SQL] LIKE on index not working

2004-07-22 Thread Peter Eisentraut
o be a different kind of index, as explained here: http://www.postgresql.org/docs/7.4/static/indexes-opclass.html -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] Inserts with incomplete rows... NOT NULL constraints

2004-08-11 Thread Peter Eisentraut
ult value is inserted, which in turn is null if you didn't specify one. You might find it odd that default values that are inconsistent with constraints are allowed, but I don't see any reasonable alternative. -- Peter Eisentraut http://developer.postgresql.org/~petere/

Re: [SQL] any chance SQL ASSERTIONS will be implemented?

2004-08-16 Thread Peter Eisentraut
there is no telling when it will happen. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] casting BOOL to somthng

2004-08-31 Thread Peter Eisentraut
least not nearly as universal and obvious as the well-known correspondence between character strings and numbers. We could pick one arbitrary correspondence and implement it, and if we did we would probably pick one that is consistent with the mapping used by libpq and other frontends. But d

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

2004-09-20 Thread Peter Eisentraut
?00:00:00 postgres: stats buffer process postgres 1178 1177 0 1826 2048 0 09:14 ?00:00:00 postgres: stats collector process postgres 9935 1172 0 4443 2848 0 13:46 ?00:00:00 postgres: pei template1 [local] idle -- Peter Eisentraut http://developer.post

Re: [SQL] Information about the command SQL " create synonym".

2004-10-12 Thread Peter Eisentraut
[EMAIL PROTECTED] wrote: > Could you say if this command will be implemanted in a future version > of a postgres database ? I'm not currently aware of any concrete proposals to implement this feature, but previous discussion has not shown any strong resistance against the concept.

Re: [SQL] A transaction in transaction? Possible?

2004-11-10 Thread Peter Eisentraut
Achilleus Mantzios wrote: > Wouldn't make more sense to allow nested begin/commit/rollback > blocks? Possibly. But that consideration would have been more relevant about 6 years ago when they wrote the SAVEPOINT syntax into the SQL standard. :) -- Peter Eise

Re: [SQL] A transaction in transaction? Possible?

2004-11-10 Thread Peter Eisentraut
n commit is useful. But that behavior violates the isolation criterion of transactions and therefore needs additional facilities to behave tolerably. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Table definition

2004-11-16 Thread Peter Eisentraut
Am Dienstag, 16. November 2004 15:04 schrieb Bruno Prévost: > Anybody know how to obtain the table definition in text. Use pg_dump. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 6: Have you searched

Re: [SQL] Table definition

2004-11-16 Thread Peter Eisentraut
Am Dienstag, 16. November 2004 16:40 schrieb Bruno Prévost: > I need to use it in sql. There is no direct way to do this in SQL, but I can offer you the following alternative: CREATE FUNCTION get_table_definition(text) RETURNS text AS ' #!/bin/sh pg_dump -t $1 ' LANGUAGE plsh;

Re: [SQL] HowTo change encoding type....

2004-11-25 Thread Peter Eisentraut
Andrew M wrote: > how do I change the encoding type in postgreSQL (8) from UTF-8 to > ISO-8859-1? Dump your database, drop your database, recreate your database with the different encoding, reload your data. Make sure the client encoding is set correctly during all this. -- Peter Eise

Re: [SQL] case sensitive/insensitive confusion

2005-02-01 Thread Peter Eisentraut
check the documentation there. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

[SQL] plpgsql functions to 'C' functions

2005-02-02 Thread Peter Manchev
I would like to convert all my plpgsql functions to their 'C' equivalent coded functions. Does anyone have experience in this matter? Thank you, Peter ---(end of broadcast)--- TIP 6: Have you searched our list archives?

Re: [SQL] plpgsql functions to 'C' functions

2005-02-03 Thread Peter Manchev
x27;C' functions :/ Here is where I'd like to get your expert opinions (thank you very much in advance for all your efforts), so I can get started fast. Thanks, Peter From: Michael Fuhr <[EMAIL PROTECTED]> To: Peter Manchev <[EMAIL PROTECTED]> CC: pgsql-sql@postgresql.org

Re: [SQL] No triggers visible for different user in information_schema.triggers

2005-02-18 Thread Peter Eisentraut
le to" is defined by other information schema tables where superuserdom cannot be represented. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Multiples schemas

2005-03-02 Thread Peter Eisentraut
Am Mittwoch, 2. MÃrz 2005 12:30 schrieb [EMAIL PROTECTED]: > Could I create a multi schema into another schema ??? or is there only one > level for schema sctructs? No and yes. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of bro

Re: [SQL] lower and unicode

2005-03-17 Thread Peter Eisentraut
pginfo wrote: > I am uusing pg 8.0.1 on FreeBSD 5.3 but I am ready t use the version > taht supports correct unicode. FreeBSD doesn't support Unicode, so you need to use something else. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end o

Re: [SQL] encoding

2005-05-07 Thread Peter Eisentraut
sion that has the --enable-locale option then you rather need to upgrade. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] Help with views/rules...

2005-05-18 Thread Peter Bense
SET post_rc_date=new.date_received, post_rc_id=new.staff_id, post_is_blank=new.is_blank WHERE new.ppt_id IN (SELECT ppt_id FROM tblpis_survey_receipt WHERE ppt_id=new.ppt_id AND survey_type=2

[SQL] INVESTMENT

2005-05-31 Thread peter nkosi
for this project and will be made available after all negotiations are completed and Agreement signed. Looking forward for your positive response and counting on Your anticipated co-operation. Thanks and best regards, Peter Nkosi

Re: [SQL] ENUM like data type

2005-06-29 Thread Peter Eisentraut
ike. I suppose in practice this won't matter too much, but it can't be called a clean design. What you'd really need is a way to create a distinct type. SQL has a feature for that, but PostgreSQL hasn't implemented it. -- Peter Eisentraut http://deve

Re: [SQL] ENUM like data type

2005-06-30 Thread Peter Eisentraut
something like that. Might be worth looking into. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining

Re: [SQL] SQL Query question

2005-06-30 Thread Peter Eisentraut
HERE > clause parameters - obviously! The condition (tbl2."StockID" = 1) will remove all rows that have null values in the tbl2 fields, thus making your left join useless. Perhaps you should change that to (tbl2."StockID" = 1 OR tbl2."StockID" IS NULL) -- or use your first version. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] bug in information_schema?

2005-08-01 Thread Peter Eisentraut
linking the same entities. That would have been my guess, but it seems that even if a column or table is used multiple times, a dependency is recorded only once, as it should be. It might have been related to the duplicate pg_user mention. -- Peter Eisentraut http://developer.postg

Re: [SQL] POSIX Regular Expression question

2005-09-05 Thread Peter Eisentraut
to enumerate all the letters instead of using a range specification. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail comman

Re: [SQL] POSIX Regular Expression question

2005-09-05 Thread Peter Eisentraut
Am Montag, 5. September 2005 17:10 schrieb A. Kretschmer: > > colname ~ '^[A-Za-z]*$' > > This match also a empty string. An empty string also fulfulls the condition "only with characters A-Za-z". Or maybe not. :-) -- Peter Eisentraut http://

Re: [SQL] POSIX Regular Expression question

2005-09-05 Thread Peter Eisentraut
alvherre=# select 'á' ~ '[[:alpha:]]'; > ?column? > -- > t > (1 fila) I don't think this addresses the concern I intended to raise. The first query should succeed for all letters between a and z, the second should succeed for all letters. Neither i

Re: [SQL] POSIX Regular Expression question

2005-09-05 Thread Peter Eisentraut
than 26 letters? Well, it seems that our regexp library interprets [a-z] as exactly 26 letters, but that seems to be a lack of locale support rather than a feature. There are statements in the documentation of other regexp libraries that directly contradict this behavior. --

Re: [SQL] a "catch all" type ... such a thing?

2005-09-10 Thread Peter Eisentraut
case, the UTF-8 encoding in PostgreSQL is probably your best choice, unless you want to dig into the weirdness that is MULE_INTERNAL. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 3: Have

Re: [SQL] What should this query match?

2005-09-14 Thread Peter Eisentraut
se a pattern matching operator, so I'd go back and check if your queries really are what you think they should be. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the plann

Re: [SQL] What should this query match?

2005-09-14 Thread Peter Eisentraut
nd one for LIKE. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

[SQL] delete item[5] from varchar[] array???

2005-09-21 Thread Matthew Peter
How is it possible to delete an item from a single dimension varchar[] array? Lets say it has the values {1,2,3,4,5,6}... how do i delete at position [4]? Could this be done in a SQL statement or a function? I appreciate any help. Thank you MP _

Re: [SQL] delete item[5] from varchar[] array???

2005-09-21 Thread Matthew Peter
Ya. I didn't see any in the \df. If it's so simple could you show me one? PLEEEASE Thanks MP --- Tom Lane <[EMAIL PROTECTED]> wrote: > Matthew Peter <[EMAIL PROTECTED]> writes: > > How is it possible to delete an item from a single > > dimension va

Re: [SQL] delete item[5] from varchar[] array???

2005-09-23 Thread Matthew Peter
--- Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Wed, Sep 21, 2005 at 06:56:36PM -0700, Matthew > Peter wrote: > > How is it possible to delete an item from a single > > dimension varchar[] array? Lets say it has the > values > > {1,2,3,4,5,6}... how do i del

Re: [SQL] delete item[5] from varchar[] array???

2005-09-23 Thread Matthew Peter
--- Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Fri, Sep 23, 2005 at 10:02:44AM -0700, Matthew > Peter wrote: > > --- Michael Fuhr <[EMAIL PROTECTED]> wrote: > > > test=> UPDATE foo SET a = a[1:3] || a[5:6]; > > > > I sure hope there is a better w

Re: [SQL] add column if doesn't exist

2005-09-26 Thread Peter Eisentraut
Brandon Metcalf wrote: > Is there a way to check for the existence of a column in a table > other than, say, doing a SELECT on that column name and checking the > output? SELECT * FROM information_schema.columns; Customize to taste. -- Peter Eisentraut http://developer.postgresql.or

Re: [SQL] problems with array

2005-10-18 Thread Matthew Peter
Not sure if you got this figured out but I think SELECT * from tb_cat WHERE id IN (SELECT array_to_string(cat,',') as cat FROM tb_array WHERE id=1); is what your looking for? --- paperinik 100 <[EMAIL PROTECTED]> wrote: > PostgreSQL is 7.4.7. > > My first table > CREATE TABLE tb_cat ( > id I

Re: [SQL] problems with array

2005-10-18 Thread Matthew Peter
Ya, I didn't test it. The error message was expecting an integer not an array, so coverting it to a list crossed my mind 'assuming' the subselect 'could' return a string of integers for the IN clause. Oh well. I'm glad there's people like you test it. --- Michael Fuhr <[EMAIL PROTECTED]> wrote:

Re: [SQL] Is it possible to redirect an update/insert/delete to a different table?

2005-11-20 Thread Peter Eisentraut
nd, no matter what the > command looks like. You can write a couple of rules for that. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] Trigger / rule question

2005-11-20 Thread Peter Eisentraut
r or rule fails, does the insert, update or delete > statement (transaction) fail? Yes -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate

[SQL] update question

2005-12-05 Thread Matthew Peter
I need a throw away value for an insert statement... example...update table set value = 1, value = 2, throw_away_value -- so i don't break the query where id = 1; Thanks Yahoo! Personals Let fate take it's course directly to your email. See who's waiting for you Yahoo! Personals

Re: [SQL] update question

2005-12-05 Thread Matthew Peter
it's in a loop so there's an extra comma at the end so i was thinking i could put in a throw away value to keep the update from breaking if there's an additional commaJaime Casanova <[EMAIL PROTECTED]> wrote: On 12/5/05, Matthew Peter wrote:> I need a throw away value

Re: [SQL] update question

2005-12-05 Thread Matthew Peter
Like WHERE 1 = 1, but in UPDATE table SET value = 1, 1 = 1; Yahoo! Personals Single? There's someone we'd like you to meet. Lots of someones, actually. Try Yahoo! Personals

Re: [SQL] Locale and pattern matching

2005-12-08 Thread Peter Eisentraut
s impossible to achieve. > Until now, I've been selecting LATIN1 encoding, but after a few > tests, I came to think that LATIN9 is a better option (the euro > sign...). For those who regularly use LATIN9, what is your opinion ? > Is it indeed a better option ? Yes. -- Peter Eise

[SQL] delete from a using b in postgres 8.1.

2006-01-02 Thread Peter Childs
rs are going to miss it before it goes back to the end user. I also don't think  this has been made particularly clear in changes. Peter Childs

Re: [SQL] filtering after join

2006-01-25 Thread Peter Eisentraut
=B.b; What makes you think that the filtering happens before the join here? And why would it matter? The results should be all the same. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 4: Have you searc

Re: [SQL] filtering after join

2006-01-26 Thread Peter Eisentraut
andrew wrote: > Sorry for the confusion. This is what i meant. Thanks, Michael. > > select * > from (select * from A, B where A.a = B.b) as s > where foo(s) < 2; > > On 1/25/06, Peter Eisentraut <[EMAIL PROTECTED]> wrote: > > andrew wrote: > > > I

Re: [SQL] filtering after join

2006-01-26 Thread Peter Eisentraut
the record type of A and B into one. Then the proposed solution is right. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an i

Re: [SQL] filtering after join

2006-01-26 Thread Peter Eisentraut
andrew wrote: > How will the query planner do for a nesting query? Treat the > subqueries as multiple queries and then link them together? > where can I find the information (codes or documents)? Look at the execution plan using the EXPLAIN command. -- Peter Eisent

Re: [SQL] Very slow updates when using IN syntax subselect

2006-02-11 Thread Peter Eisentraut
eeze, can't > postgres figure this out for itself? I'm sure you wouldn't appreciate it if PostgreSQL did a full table scan before each query to figure out the total size of the involved tables. -- Peter Eisentraut http://developer.postgresql.org/~petere/

Re: [SQL] Modifying postgresql.org file

2006-02-15 Thread Peter Eisentraut
Ken Hill wrote: > Can someone point me in a > direction as to where I can learn how to modify the postgresql.org > file to increase work_mem? RTFM -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)---

Re: [SQL] Feature, my misconception or bug??

2006-02-22 Thread Peter Eisentraut
1 > has no bits set to right of > 8 LSB ^ I'm sure you are aware that "1" is a set bit, so which part are you not understanding? -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)

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

2006-03-02 Thread Peter Eisentraut
sed there, only by initdb. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's da

[SQL] unsubscribe

2006-03-04 Thread Peter Ivarsson
  

Re: [SQL] PostgreSQL Handling of Special Characters

2006-03-19 Thread Peter Eisentraut
Christian Paul B. Cosinas wrote: > My Database uses SQL_ASCII encoding. Do yourself a favor and use something else. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the plan

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Peter Eisentraut
gainst or for any brandname: not Mesql nor > postgres. > > just sed 's/MySQL/SomeDBMS/g' and concentrate on the fact: > that even so stupid DBMS handling NULs properly. :-) So printing a space is "properly"? Curious ... -- Peter Eisentraut http://developer.postgres

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Peter Eisentraut
ytes in unambigious form. Note that printing out a space will lose the null byte on restore, so that solution does not seem satisfactory. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 5: don't forg

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Peter Eisentraut
Eugene E. wrote: > the bytea does not output NULs at all. > don't mock me. peter=# create table test (a bytea); CREATE TABLE peter=# insert into test values ('a\\000b'); INSERT 0 1 peter=# select * from test; a ---- a\000b -- Peter Eisentraut http://developer.p

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Peter Eisentraut
nary form you need to select it. Then you can pass the exact bytes back and forth. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Peter Eisentraut
Eugene E. wrote: > input. then what a difference bitween those types except strlen() ? bytea does not consider character set encodings and locales, and it handles null bytes. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadc

Re: [SQL] Bitfields always atomic? Other way to store attributes?

2006-03-27 Thread Peter Eisentraut
x27;)? Or > must I wrap things in > explicit transactions? Each of these commands will be its own transaction if you don't explicitly start one. > My application is to give attributes to an address table. But maybe > there is a better way? Create 5 bo

[SQL] Compute hash of a table?

2006-05-02 Thread Peter Manchev
Hi All I need to determine whether the content of a given table has changed from the previous time I've checked it. so, my initial idea is to calculate a hash value of the content of the whole table, may be with custom aggregate function or something. My question is: Is it possible to get t

<    1   2   3   4   5   >