Re: [SQL] order by different on mac vs linux

2012-05-31 Thread Peter Eisentraut
On lör, 2012-05-26 at 21:47 -0600, Wes James wrote: > on the ascii table here: > > http://www.ascii-code.com/ > > upper case letters should sort before lowercase letters. ASCII has nothing to do with how letters "should" be sorted. It is not a sorting standard, it is a character encoding standa

Re: [SQL] the use of $$string$$

2011-11-07 Thread Peter Eisentraut
On mån, 2011-11-07 at 08:44 +, Richard Huxton wrote: > > myvarString = "long string that contains single quotes" > > cusor.execute("insert into table (pkid, myfield) values (%s, $$%s > $$)",(123, > > myvarString)) > > > > When I execute the above I'm seeing: > > E'long string that contains sing

Re: [SQL] a strange order by behavior

2011-06-22 Thread Peter Eisentraut
On tor, 2011-06-23 at 05:57 +0200, Pavel Stehule wrote: > 2011/6/22 Peter Eisentraut : > > On ons, 2011-06-22 at 02:39 -0700, Samuel Gendler wrote: > >> Pavel suggested using a collation of ucs_basic, but I get an error > >> when I > >> try that on linux: >

Re: [SQL] a strange order by behavior

2011-06-22 Thread Peter Eisentraut
On ons, 2011-06-22 at 02:39 -0700, Samuel Gendler wrote: > Pavel suggested using a collation of ucs_basic, but I get an error > when I > try that on linux: > > $ createdb -U u1 --lc-collate=ucs_basic -E UTF-8 test > createdb: database creation failed: ERROR: invalid locale name ucs_basic ucs_ba

Re: [SQL] a strange order by behavior

2011-06-22 Thread Peter Eisentraut
On ons, 2011-06-22 at 01:43 -0700, Samuel Gendler wrote: > I seem to recall a thread here about it ignoring spaces entirely in that > collation (and maybe ignoring capitalization, too?). The way it works is that every collating element (letter or other character or character group that you sort as

Re: [SQL] How strings are sorted by LC_COLLATE specifically?

2010-11-30 Thread Peter Eisentraut
On tor, 2010-11-25 at 14:42 +0900, Chang Chao wrote: > How strings are sorted when LC_COLLATE = ja_JP.UTF-8. > I tried to read the documention on that,but there are just a few > words, > like LC_COLLATE determines string sort order, > Is there a specific reference about this? > So I can implement a

Re: [SQL] Using count on a join, group by required?

2010-08-11 Thread Peter Eisentraut
On tis, 2010-08-10 at 22:21 -0430, Jose Ildefonso Camargo Tolosa wrote: > And it works, it gives me something like: > > product_id | name | code | manufacturer_id | > manufacturer_name | num_serials > +--+---+--

Re: [SQL] type cast

2010-08-10 Thread Peter Eisentraut
On tis, 2010-08-10 at 18:38 +0200, Imre Horvath wrote: > Hi! > > I don't know if it's the right place or the psycopg2 list: > > I've got a plpython function, with a character varying param. > I can call it from sql. > But when i try to call it with psycopg2.callproc('testfunc', ['test']), > i've

Re: [SQL] How oids of the base data types often change?

2010-07-19 Thread Peter Eisentraut
On mån, 2010-07-19 at 14:47 +0400, Dmitriy Igrishin wrote: > For example, when using libpq(-xx), it is possible to get the oid of > the type of any column. > Is there a guarantee that oids of base types (void, integer, ... ) > will not change in future > releases of Postgres? There is no actual "g

Re: [SQL] Pg_Restore with --clean option

2009-09-30 Thread Peter Eisentraut
On Wed, 2009-09-30 at 22:14 -0700, Jyoti Seth wrote: > I want to restore data of a single table. Before restoring the data I > disabled all the triggers and constraints on that table. I used the restore > command with --clean option so that data gets deleted from that table and > then fresh data ge

Re: [SQL] Question about encoding

2009-08-24 Thread Peter Eisentraut
On mån, 2009-08-24 at 18:42 +0200, Denis BUCHER wrote: > Question 1 : > Is it the expected behavior ? These characters have a SQL_ASCII > equivalent because I already have them stored in another table of the > same database SQL_ASCII is not the same as ASCII. SQL_ASCII means, take the bytes as th

Re: [SQL] Double aggregate problem

2009-07-22 Thread Peter Eisentraut
On Wednesday 22 July 2009 19:16:21 David Weilers wrote: > I have the following query: > > select v.id, array_to_string(array_accum(s.name),', ') as sector , > array_to_string(array_accum(p.name),', ') as provincie from tblvacature > v, tblaccount a , tblvacaturesector vs, tblsector s , > tblvacatur

Re: [SQL] Xml Schemas

2009-06-08 Thread Peter Eisentraut
On Saturday 06 June 2009 22:53:19 Isaac Dover wrote: > Hello, I am attempting to build an xml representation of any database, but > I'm having trouble doing so. I was interested in using the existing xml > functions, such as "schema_to_xmlschema", but the results are strange and > unusable. The res

Re: [SQL] ENUM vs DOMAIN vs FKyed loookup table

2009-04-08 Thread Peter Eisentraut
On Wednesday 08 April 2009 20:08:55 Mario Splivalo wrote: > What are your practices, when do you use ENUMs and when Domains? When given the choice, pretty much ENUMs. Domains weren't really conceived for this sort of thing in the first place, so it's good to move away from them. -- Sent via p

Re: [SQL] select count of all overlapping geometries and return 0 if none.

2009-03-13 Thread Peter Eisentraut
On Thursday 12 March 2009 19:28:19 Duffer Do wrote: > I want to return the following: > locations    |  number_visits > Frankfurt    |  6 > Manhattan  |  3 > Talahassee |  0 > > My query only returns: > Frankfurt    |  6 > Manhattan  | 3 > My query: > SELECT count(user_name) as number_visits, loca

Re: [SQL] Create index on xml field

2009-01-13 Thread Peter Eisentraut
On Tuesday 13 January 2009 18:56:33 Brad Balmer wrote: > Why would the following not work? > create index tstTbl_idx on test_tbl (cast(xpath ('//uim:upcCode/text()', > job) as text[])); Looks like you are missing a namespace definition. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.or

Re: [SQL] Display message to user

2008-11-05 Thread Peter Eisentraut
Bart van Houdt wrote: Oracle has a nice package procedure (dbms_output.put_line) to display a message in SQL*Plus, which can display a message to the user. I use this a lot, to notify users of the progress being made during the execution of a script. Is there a way to do this with Postgres as

Re: [SQL] Performing intersection without intersect operator

2008-10-28 Thread Peter Eisentraut
Nacef LABIDI wrote: I want to perform an intersection between several select queries but without using the INTERSECT keyword. select userid from orders where productid=1 INTERSECT select userid from orders where productid=2 I want to transform it without the INTERSECT. (select userid from

Re: [SQL] DIfference between max() and greatest() ?

2008-09-12 Thread Peter Eisentraut
Ruben Gouveia wrote: What is the difference between these two. I know that max() is an aggregate function ... and greatest() is a normal single-row function. One works vertically, one works horizontally, if that helps you. :-) Or max() is like sum() and greatest is like +. -- Sent via pgsql

Re: [SQL] uuid-ossp contrib in pg 8.1

2008-08-28 Thread Peter Eisentraut
James Neethling wrote: I want to add uuid support to a postgres 8.1 installation. Can I install 8.3 uuid-contrib into 8.1? 8.1 does not have a uuid type, so this won't work. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresq

Re: [SQL] nesting XmlAgg

2008-07-03 Thread Peter Eisentraut
Am Donnerstag, 3. Juli 2008 schrieb Isaac Dover: > select >   XmlElement(name "Catalog", >     XmlElement(name "Tables", >       XmlAgg(XmlElement(name "Table", XmlAttributes(T.table_name as > "Name"), XmlElement(name "Columns", > -- i was attempting to aggregate here as well >         (select XmlE

Re: [SQL] query results in XML format?

2008-03-06 Thread Peter Eisentraut
Emi Lu wrote: > Can someone suggestion some tutorial/hyperlinks/docs about how > postgresql output query results into xml files? http://www.postgresql.org/docs/8.3/static/functions-xml.html#FUNCTIONS-XML-MAPPING -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] Backward compatibility psql 8.1 to 8.2

2008-02-17 Thread Peter Eisentraut
upport that setup. -- 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 datatypes do not match

Re: [SQL] PostgreSQL does not support updateable cursors

2008-02-17 Thread Peter Eisentraut
ForwardOnly, adLockReadOnly' then it work fine. However, > I need to use this query for make data ready to be updated on some record. >      How can I fix this problem? 8.3 supports updatable cursors. Try that. -- Peter Eisentraut http://developer.postgresql.org/~petere/ --

Re: [SQL] Usage of UUID with 8.3 (Windows)

2008-02-17 Thread Peter Eisentraut
can be made to present the same SQL-level API as we have for > OSSP. Otherwise we'll be faced with boatloads of platform-dependent > client code ... Indeed. Linux, for example, also has "its own" UUID generator, but I intentionally used the OSSP library, because it is platfo

Re: [SQL] table column names - search

2008-01-14 Thread Peter Eisentraut
ion_schema.columns WHERE column_name LIKE '%name%'; Add DISTINCT and other columns to taste. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Loading 8.2 data into 8.1

2007-11-22 Thread Peter Eisentraut
Am Dienstag, 20. November 2007 schrieb Andreas Joseph Krogh: > Is it considered "safe" to use 8.1's pg_dump to dump an 8.2-db and load it > into 8.1? No, pg_dump will complain if you try that. It could work, with manual fixups perhaps, but it is far from "safe&qu

Re: [SQL] SUPERUSER vs CREATEUSER causes foul 'code smell'

2007-08-16 Thread Peter Eisentraut
her roles, but not have other > SUPERUSER priveleges - how can I do that? See CREATEROLE privilege. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore yo

Re: [SQL] Database system identifier from SQL

2007-07-10 Thread Peter Eisentraut
Tom Lane wrote: > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > Is there a way to query the database system identifier that > > pg_controldata outputs from SQL? > > Don't think so. Do you have a use-case for providing a function to > return that? I'd

[SQL] Database system identifier from SQL

2007-07-10 Thread Peter Eisentraut
Is there a way to query the database system identifier that pg_controldata outputs from SQL? -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http

Re: [SQL] Potential bug in postgres 8.2.4

2007-05-24 Thread Peter Eisentraut
of this is strictly speaking incorrect anyway. And the queries that do work will most likely start not working in a future version. All of this is a gradual effort to reduce excessive automatic type casting. I suggest you fix your application. -- Peter Eisentraut http://developer.postgresql

Re: [SQL] CPU statistics

2007-04-04 Thread Peter Eisentraut
Am Mittwoch, 4. April 2007 14:36 schrieb [EMAIL PROTECTED]: > It is possible to retrieve information about the server hardware via > postgreSQL ? You'd have to write your own function. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end o

Re: [SQL] LOCK command inside a TRANSACTION

2007-04-03 Thread Peter Eisentraut
OR UPDATE. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

[SQL] Calling void functions

2007-04-02 Thread Peter Eisentraut
REATE FUNCTION foo (a int) RETURNS void LANGUAGE sql AS $$ SELECT foo($1, default-value); $$; -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 4: Have you searched our list arc

Re: [SQL] Foreign Unique Constraint

2007-03-28 Thread Peter Eisentraut
llowed in check constraints. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] Foreign Unique Constraint

2007-03-27 Thread Peter Eisentraut
e the access simpler. -- 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] select vs. select count

2007-03-27 Thread Peter Eisentraut
Claus Guttesen wrote: > Why does select and select(count) produce two different results? count(expression) only counts nonnull values. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 2: Don't

Re: [SQL] GiST index question: performance

2007-03-06 Thread Peter Eisentraut
n bring up > Q3C since it's less widely deployed. How do you manage to get your own code installed under that theory? -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 7: You can help support the Pos

Re: [SQL] Case with Char(1)

2007-02-28 Thread Peter Eisentraut
Am Mittwoch, 28. Februar 2007 14:02 schrieb Ezequias Rodrigues da Rocha: > it is possible to use case with character (1) ? Have you tried it? -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 7: You

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

2007-01-30 Thread Peter Eisentraut
ertainly allowed by PostgreSQL without any flags. It's just that the result is not what some people expect. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Create View

2006-11-04 Thread Peter Eisentraut
ng > all of the fields if I add columns to the table (whatever). > > Is this an SQL thing or a PostGreSQL thing? SQL -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 4: Have you se

Re: [SQL] double precision vs. numeric

2006-08-24 Thread Peter Eisentraut
Aarni Ruuhimäki wrote: > ' ... type double precision ... will be depreciated / unsupported in > future releases ... ' That is completely false. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)

Re: [SQL] SQL92 compliance

2006-08-23 Thread Peter Eisentraut
Scott Marlowe wrote: > Would it be possible if we required postfix operators and related to > be inside parens? > > select x ~~ y as yabba > OR > select (x ~~ y) yabba That's pretty much what you get if you restrict the expression to c_expr. -- Peter Eisentraut http://d

Re: [SQL] SQL92 compliance

2006-08-23 Thread Peter Eisentraut
so there were porting troubles, but I don't remember the details. I'm just saying that it's doable if it's a necessity for someone. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 9: In ve

Re: [SQL] SQL92 compliance

2006-08-23 Thread Peter Eisentraut
s at least for 7.4. I don't think it works for newer versions, but it should give you an idea what is required to get it working. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 4: Have you

Re: [SQL] Postgres 8.1 sequences and 'CALL'-syntax

2006-05-08 Thread Peter Eisentraut
ey DON'T support > the postgres-specific "select nextval('seq_name')". Instead they gave > me the hint to use the sql-conform "call nexval('seq_name')". That statement is not any more SQL conforming than the other. -- Peter Eisentraut http://develo

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

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] 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: > 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
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
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] 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] 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

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] 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] 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] 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] 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: > 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-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] 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

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

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] 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] 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

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] 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] 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] 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
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
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] 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] 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] 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] 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] 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

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] 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] 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] 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

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] [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])

Re: [SQL] BYTEA output presentation

2004-07-16 Thread Peter Eisentraut
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. libpq has functions to deal with bytea data: http://www.postgresql.org/docs/7.4/static/libpq-exec.html

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

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] In 7.4 ensure you have DEFAULT now () with no spaces

2004-06-19 Thread Peter Eisentraut
David B wrote: > We had been testing 7.4 for a few days and just noticed that some > tables had created_timestamp rows with a date/time of the date the DB > was created...not the date/time the insert was done. > > Looking at those tables the create DDL's for those few tables > contained now () > as

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] 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] 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

  1   2   3   >