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] How can this INSERT fail?

2012-04-25 Thread Peter Harris
It is 9.0.4 if that helps. Is there some reason it should work differently on 9.1 or 8.x? On 25 April 2012 13:29, Abbas wrote: > Which version of postgresql it is ? > > Best Regards, > Abbas > > > > On Wed, Apr 25, 2012 at 5:15 PM, Peter Harris > wrote: > >&g

[SQL] How can this INSERT fail?

2012-04-25 Thread Peter Harris
, if there's no good solution I'm happy to simply swallow the exceptions, because I don't care (in this case) which of two competing transactions gets to insert the row. However, if I am doing something stupid I'd like to be put right! Peter Harris Software Engineer HuzuTech Ltd.

Re: [SQL] date arithmetic with columns

2012-03-06 Thread Peter Faulks
hari.fu...@gmail.com wrote: Peter Faulks writes: I have two columns in two distinct tables, one is the starting time of an event, timestamp without time zone. Data is the utc datetime (for sorting across time zones), the other is the number of minutes to add. Maybe I'm missing somethin

Re: [SQL] date arithmetic with columns

2012-03-03 Thread Peter Faulks
Bit more googling and I came up with: r.utc + CAST( tz.diffmins || ' ' || 'minutes' AS interval) It works, but is it the best way? On 1/03/2012 6:50 AM, Peter Faulks wrote: I have two columns in two distinct tables, one is the starting time of an event, timestamp withou

[SQL] date arithmetic with columns

2012-03-03 Thread Peter Faulks
I have two columns in two distinct tables, one is the starting time of an event, timestamp without time zone. Data is the utc datetime (for sorting across time zones), the other is the number of minutes to add. I am migrating from Firebird. One of the queries uses the dateadd function to build

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] enum data type vs table

2011-05-25 Thread Peter Koczan
y easily, so it made the most sense for me. Also, Postgres 9.1 allows adding values to enum types, so you could always use that when it is finally released. Hope this helps, Cheers, Peter -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] is there a refactor

2011-04-05 Thread Peter Steinheuser
y_test > user_test > timestamp_test > role_t > py_test > money_test > lock_test > local_1 > lang_test > interval_test > foob > fooa > fldlength > fk_1 > default_test > csv_null > check_two > check_test > array_test > (29 rows

Re: [SQL] Determine length of numeric field

2011-02-15 Thread Peter Steinheuser
;t had much luck with the length or char_length functions on > postgres. > > Thanks. > Tony > > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- Peter Steinheuser psteinheu...@myyearbook.com

Re: [SQL] Drawing a blank on some SQL

2011-02-11 Thread Peter Steinheuser
30 | 9 > 1950 | 10 > 7 | 11 >67 | 12 > > Thanking you in advance for any help on this. The caffiene seems to be not > working well today. > > Aaron > > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- Peter Steinheuser psteinheu...@myyearbook.com

Re: [SQL] "select c1, method(c2) group by c1" returns all values of c2 for c1

2011-02-08 Thread Peter Steinheuser
al6); > > select c1, method(c2) > group by c1 > > returns: > > 1, "val1, val2, val3" > 2, "val1" > 3, "val5, val6" > > > Thanks a lot! > > -- > Lu Ying > > -- > Sent via pgsql-sql mailing list (pgsql-sq

Re: [SQL] Getting top 2 by Category

2011-01-19 Thread Peter Steinheuser
magazineid; On Wed, Jan 19, 2011 at 3:11 PM, Carla wrote: > 2011/1/11 Peter Steinheuser > >> Well, if yoi have PG 8.4 and above - >> >> select categoryid, magazineid from ( >> select row_number() over (partition by categoryid order by >> categoryid,magazineid

Re: [SQL] Getting top 2 by Category

2011-01-11 Thread Peter Steinheuser
magazinecategoryid, magazineid, categoryid) > > VALUES (4, 10, 4); > > > > > > > > INSERT INTO magazinecategory( > > magazinecategoryid, magazineid, categoryid) > > VALUES (5, 11, 4); > > > > INSERT INTO magazinecategory( > >

Re: [SQL] concatenate question

2010-12-07 Thread Peter Steinheuser
I don't know what Postgres version you're using but check out the doc related to String Functions and Operators. Cheers, Peter On Tue, Dec 7, 2010 at 4:47 PM, Tony Capobianco wrote: > Ok, that worked. Why did I need to cast both as text though? > > plsql_dw=# se

Re: [SQL] concatenate question

2010-12-07 Thread Peter Steinheuser
psv_parent_master > limit ... >^ >HINT: No operator matches the given name and argument type(s). > You >might need to add explicit type casts. > >Thanks. > > > -- > Sent via pgsql-sql mailing lis

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] backup and document views and user functions

2010-08-30 Thread Peter Steinheuser
d for such report will be just fine. > > Sorry for the lame question. I didn't find any clues on the web > .(typically, I fail to phrase the right keywords) > > -- > Thanks. > > David Harel, > > == > > Home office +972 77 7657645 > Cellular: +972 54 4534502 > Snail Mail: Amuka > D.N Merom Hagalil > 13802 > Israel > Email: harel...@ergolight-sw.com > > -- Peter Steinheuser psteinheu...@myyearbook.com

Re: [SQL] Domains, casts, and MS Access

2010-08-17 Thread Peter Koczan
On Wed, Aug 4, 2010 at 8:49 PM, Richard Broersma wrote: > On Wed, Aug 4, 2010 at 3:41 PM, Peter Koczan wrote: > >> Yep, that's the stumbling block we're running into. ODBC and these >> fields' assumptions of true/false are at odds. I'm trying a few other &

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] Domains, casts, and MS Access

2010-08-04 Thread Peter Koczan
the stumbling block we're running into. ODBC and these fields' assumptions of true/false are at odds. I'm trying a few other things with casts in the meantime to see if they'll work. Does anyone know if another product, like OpenOffice Base with its native postgres drive

Re: [SQL] Domains, casts, and MS Access

2010-08-04 Thread Peter Koczan
On Wed, Aug 4, 2010 at 12:47 PM, Richard Broersma wrote: > On Wed, Aug 4, 2010 at 10:31 AM, Peter Koczan wrote: > >> One of the snags that's popped up is that there's some incompatibility >> between data types. Specifically, many fields are the Sybase type >> &

[SQL] Domains, casts, and MS Access

2010-08-04 Thread Peter Koczan
of cast function must match or be binary-coercible from source data type Is there a way to tell Access to do the right thing, or is there a better way to define the type/domain, or is there some better product to use? Thanks much, Peter P.S. In case people are interested in the specifics of the

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] tsearch2 and wildcards/pattern matching?

2010-07-07 Thread Peter Koczan
On Wed, Jul 7, 2010 at 5:44 PM, Oleg Bartunov wrote: > it's called prefix search: > > =# select 'zvt123456'::tsvector @@ 'zvt:*'; >  ?column? -- >  t Ah, that works. Excellent. Thanks, Peter -- Sent via pgsql-sql mailing list (pgsql-sql

[SQL] tsearch2 and wildcards/pattern matching?

2010-07-07 Thread Peter Koczan
oth of them in one query using something akin to 'zvt%', like select * from attachments where textsearchable @@ 'zvt%'; I've been unable to find anything in documentation. If there's anything in tsearch2 that can do this and is faster than LIKE clauses on full-text, tha

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] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Peter Headland
> Unfortunately, there is no single column that provides a unique id. Correction - I did not understand what ctid was, but now I do, so I will try your tip. -- Peter Headland Architect Actuate Corporation -Original Message- From: Peter Headland Sent: Tuesday, August 11, 2009 10

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Peter Headland
a new index) for performance reasons. Given that additional constraint, is my original plan using a loop to iterate over a cursor reasonable? I don't anticipate p_number_of_items being more than 20. -- Peter Headland Architect Actuate Corporation -Original Message- Fro

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Peter Headland
>Assuming that there is a unique identifier on queue Alas, there is not. The PK is made up of 4 columns. -- Peter Headland Architect Actuate Corporation -Original Message- From: D'Arcy J.M. Cain [mailto:da...@druid.net] Sent: Tuesday, August 11, 2009 03:25 To: Peter Headland C

[SQL] Updating a specific number of rows in pl/pgsql

2009-08-10 Thread Peter Headland
g like: UPDATE (SELECT ... ) ... -- Peter Headland Architect Actuate Corporation

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

[SQL] Best way to simulate Booleans

2009-07-06 Thread Peter Headland
... -- Peter Headland Architect - e.Reports Actuate Corporation

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] ascii-betical sort order?

2009-05-08 Thread Peter Koczan
king for. I'll look at this when I have a bit more time. Thanks, Peter -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] ascii-betical sort order?

2009-05-08 Thread Peter Koczan
rious). It may not be terribly important, but it'd be useful to know in case it actually is an issue. I couldn't find any clear answer searching online. Thanks, Peter -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

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] pl/pgsql or control structures outside of a function?

2009-04-06 Thread Peter Koczan
e statements would very quickly become unmaintainable. Wrapper scripts are probably the way to go for me. Thanks again, Peter -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] pl/pgsql or control structures outside of a function?

2009-04-03 Thread Peter Koczan
. It's fine if the answer is no, I'm just curious if I should pursue this path or look for a different one. And if there's a way to do this or something like it besides "create scripts in Perl/Python/etc." that you know of, I'd appreciate any information.

Re: [SQL] FUNCTION problem

2009-04-03 Thread Peter Willis
(terribly ugly) my select statements to generate a single SQL query from all. This allows me to change the output of the query without needing to define a new set of output 'OUT' parameters each time I change things. I have use of the 'OUT' parameters with another set of functi

Re: [SQL] FUNCTION problem

2009-04-03 Thread Peter Willis
'RECORD'. (The lights come on...) And here I thought it would all be so simple. You show a valid, and most informative solution. This should get things working for me. Thank you very much for your help. Peter -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make chang

Re: [SQL] FUNCTION problem

2009-04-02 Thread Peter Willis
lines before the FOR loop... I think I need to go back and approach the function from a different direction. Thanks for all the pointers. Peter -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] FUNCTION problem

2009-04-02 Thread Peter Willis
Adrian Klaver wrote: On Wednesday 01 April 2009 4:31:20 pm Peter Willis wrote: Hello, I am having a problem with a FUNCTION. The function creates just fine with no errors. However, when I call the function postgres produces an error. Perhaps someone can enlighten me. --I can reproduce the

[SQL] FUNCTION problem

2009-04-01 Thread Peter Willis
Hello, I am having a problem with a FUNCTION. The function creates just fine with no errors. However, when I call the function postgres produces an error. Perhaps someone can enlighten me. --I can reproduce the error by making a test function --that is much easier to follow that the original:

[SQL] Proper entry of polygon type data

2009-03-24 Thread Peter Willis
orrect one? If per vertex format is the correct one, do I need to 'close' the path by entering the first vertex again at the end of the list? ie: INSERT INTO my_table (my_polygon_column) VALUES ( ((Ax,Ay),(Bx,By),(Cx,Cy),(Ax,Ay)) ); Thanks, Peter -- Sent via pgsql-sql mai

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

[SQL] New datestyle(s)

2009-02-16 Thread Peter Koczan
/include/miscadmin.h - Define your new datestyle. src/bin/psql/tab-complete.c - Not necessary to add it, but having it in the list of tab completions for datestyle is nice. I don't use the ecpg interface, so I didn't bother patching that. It seems like it would be analogous to what'

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

[SQL] looking for example of inserting into a view

2008-08-20 Thread EXT-Rothermel, Peter M
I can't seem to find an example I vaguely remember seeing when I was originally learning about INSERT rules and views. This example features a view that is an outer join of several tables. The example shows how to generate a CSV file of the data in the view and then loading the data into the origi

[SQL] LIMIT question

2008-08-19 Thread EXT-Rothermel, Peter M
I need to use a LIMIT count in a query but I also need to know how many rows the query itself would yield without the limit. I can do this inside a transaction like this BEGIN SELECT COUNT(*) from table1 where blah; select * from table1 where blah LIMIT 1000; COMMIT Now I can give some feedback l

[SQL] Savepoints and SELECT FOR UPDATE in 8.2

2008-08-01 Thread EXT-Rothermel, Peter M
I have a client application that needs: SELECT a set of records from a table and lock them for potential updates. for each record make some updates to this record and some other records in other tables call some call a function that does some application logic that does not access the da

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] "TZ"/"tz" not supported

2008-06-20 Thread Peter Kovacs
reason for this limitation or is it just the implementation waiting to be completed (nobody has had an itch intensive enough to scratch it)? Thanks Peter On Fri, Jun 20, 2008 at 8:50 AM, A. Kretschmer <[EMAIL PROTECTED]> wrote: > am Fri, dem 20.06.2008, um 8:35:10 +0200 mailte Peter K

Re: [SQL] "TZ"/"tz" not supported

2008-06-19 Thread Peter Kovacs
Thank you, Andreas! Your advice is very useful to me. I would still be interested why "TZ" is not accepted in the format string. Thanks Peter On Fri, Jun 20, 2008 at 8:15 AM, A. Kretschmer <[EMAIL PROTECTED]> wrote: > am Fri, dem 20.06.2008, um 7:51:50 +0200 mailte Pet

[SQL] "TZ"/"tz" not supported

2008-06-19 Thread Peter Kovacs
--- select * from pg_catalog.pg_timezone_abbrevs where abbrev = 'GMT'; abbrev | utc_offset | is_dst ++ GMT| 00:00:00 | f (1 row) -- The database version is 8.3.0. Any help appreciated, Peter -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] Auto-formatting timestamps?

2008-05-14 Thread Peter Koczan
some code that actually somewhat depends on this format, > > and one of my goals in this port is to change as little client code as > > possible. Is it possible to automatically change the output like this, > > preferably on a per-connection basis? I found stuff regarding the > > datestyle parameter in the docs, but that doesn't quite do what I'd > > like. > > > > Thanks much, > > Peter -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Auto-formatting timestamps?

2008-05-13 Thread Peter Koczan
ttle client code as possible. Is it possible to automatically change the output like this, preferably on a per-connection basis? I found stuff regarding the datestyle parameter in the docs, but that doesn't quite do what I'd like. Thanks much, Peter -- Sent via pgsql-sql mailing l

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] trigger for TRUNCATE?

2008-01-14 Thread Peter Childs
ata in the table only the speed and security or the table so foreign keys don't really fit in this class nor do unique indexes. Peter.

[SQL] Cheers for DISTINCT ON

2008-01-07 Thread Peter Kovacs
o-use than SQL. I've been wondering ever since why the worse so often gets the upper-hand over the better. (I am obviously having a hard time "growing-up" :-) ) Cheers, Peter ---(end of broadcast)--- TIP 9: In versions below 8.0, the

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] Get different sums from the same table in one query

2007-10-08 Thread Peter Childs
not three... You may want to use views to simplify things. Peter Childs Andreas > -- > Andreas Kretschmer > Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) > GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net > > ---

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] Increment a sequence by more than one

2007-08-06 Thread Peter Childs
hould use the cache feature of a sequence is there just for this purpose. That way when you get the next value your session caches and any other sessions will get one after your cache range. Peter

Re: [SQL] is there a 'table' data type in pg?

2007-07-24 Thread Peter Childs
ld build a view of all the sub tables and then select by tablename='whatever' You may also want to look into inheritance Only some ideas Peter.

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

[SQL] Adding "on delete cascade" to all foreign key constraints

2007-05-15 Thread Peter Hanson
Hello, I was wondering if there's a fast way I can add "on delete cascade" to all foreign key constraints in my database? Maybe a quick update I can make against the catalog possibly? Or is there a way I can query for all foreign key constrains in the database and then I could write up a quick

Re: [SQL] Selecting rows with "static" ordering

2007-04-26 Thread Peter Childs
able, values ((1,3),(2,2),(3,5),(4,1),(5,4)) as values where values.id=table.second order by values.first; never done it but I think it should work with a bit of playing arond... Peter. ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

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

[SQL] Looping recordset

2007-01-25 Thread Furesz Peter
Hello, How can I loop a PL/PgSQL recorset variable? The example: DECLARE v_tmp_regi RECORD; v_tmp RECORD; BEGIN SELECT * INTO v_tmp_regi FROM sulyozas_futamido sf WHERE sf.termekfajta_id= a_termekfajta_id AND sf.marka_id=a_marka_id; DELETE FROM sulyozas_fu

Re: [SQL] join a lot of columns of two tables

2006-12-14 Thread Peter Childs
solve this very simple problem quikly... :-( thanks Ivan select * from t1 full join t2 on (t1.id=t2.id); you'll end up with the id column from both tables if you don't want that you are going to need to list all the column names. Peter. ---

Re: [SQL] Autovaccum

2006-11-30 Thread Peter Childs
this automatically. Which is kind of useful. 5. You can do this manually via cron or by hand if you wish. Peter. ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

[SQL] writing a simple sql parser and database program

2006-11-06 Thread Peter Michaux
s done. Is there a link or book that explains the basics of how a database parses SQL and how it then operates on the data? Thank you, Peter ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at

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] Determining correct table order for insert or drop statements to satisfy foreign keys

2006-11-02 Thread Peter Hanson
Hi Aaron, I'm using PHP5 as the programming language. Thanks, Pete On Thursday 02 November 2006 16:58, Aaron Bono wrote: > On 11/2/06, Peter Hanson <[EMAIL PROTECTED]> wrote: > > Hello, > > > > First, sorry if this has already been covered, though I didn't

[SQL] Determining correct table order for insert or drop statements to satisfy foreign keys

2006-11-02 Thread Peter Hanson
Hello, First, sorry if this has already been covered, though I didn't find anything similar in the archives. Also sorry if this is the wrong list for this type of question, though it seemed to be the most relevant list for this question. On to the question: I'm writing a simple import script t

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)

  1   2   3   4   5   >