Re: [SQL] Can I simplify this somehow?

2013-09-27 Thread Adam Jelinek
Are you looking for something like this for the result for the last 45 days or something else? TIME MON TUE WED ... 09:00 13 4 10:00 50 8 On Fri, Sep 27, 2013 at 10:22 AM, Larry Rosenman wrote: > I tried(!) to write this as a with (CTE), but failed. > >

[SQL] Perform Function When The Rows Of A View Change

2013-02-15 Thread Adam
or rule that can detect this situation and provide the notification I'm looking for. I could just query the view over and over again, and look for changes as they occur. But I'm hoping to find a more elegant (and less resource-intensive) solution. Any ideas? Thanks! -Adam -- Sent

Re: [SQL] Date Index

2012-11-05 Thread Adam Tauno Williams
On Fri, 2008-10-31 at 08:48 +0100, A. Kretschmer wrote: > am Thu, dem 30.10.2008, um 14:49:16 -0600 mailte Ryan Hansen folgendes: > > Hey all, > > I?m apparently too lazy to figure this out on my own so maybe one of you can > > just make it easy on me. J > > I want to index a timestamp field but

[SQL] Re-Sync Stand By Server

2012-03-07 Thread Adam Cornett
g_location()" pg_current_xlog_location -- 58/8E1B8D98 So, how do I get the standby to catch up to "catch up" to the primary? -Adam Cornett

Re: [SQL] new user on mac

2011-10-18 Thread Adam Cornett
ption: > http://www.postgresql.org/mailpref/pgsql-sql > psql + editor is the basic tool set, certainly the most flexible. Also be sure to check out pgadmin: http://www.pgadmin.org/download/macosx.php -Adam

Re: [SQL] Tripping over (my own) stupidity - VARCHAR declaration minus specificity

2011-10-14 Thread Adam Cornett
On Fri, Oct 14, 2011 at 2:09 PM, k...@rice.edu wrote: > On Fri, Oct 14, 2011 at 01:51:04PM -0400, Adam Cornett wrote: > > On Fri, Oct 14, 2011 at 1:27 PM, Good, Thomas wrote: > > > > > I created a table in a hurry and forgot to specify the max capacity for >

Re: [SQL] Tripping over (my own) stupidity - VARCHAR declaration minus specificity

2011-10-14 Thread Adam Cornett
sql > According to http://www.postgresql.org/docs/current/static/datatype-character.html, "If character varying is used without length specifier, the type accepts strings of any size. The latter is a PostgreSQL extension." -Adam Cornett

[SQL] which is better: using OR clauses or UNION?

2011-08-16 Thread Adam Witney
Bitmap Index Scan on in_dba_data_base_identifier (cost=0.00..32.64 rows=964 width=0) (actual time=0.178..0.178 rows=318 loops=1) Index Cond: (lower(identifier) ~=~ 'sptigr4-2210 (6f24)'::character varying) Total runtime: 4.174 ms Also which should

Re: [SQL] Crosstab Confusion

2010-02-01 Thread Adam Sherman
On 2010-02-01, at 14:22 , Lee Hachadoorian wrote: > The output column data type (day1, day2, etc.) is supposed to match the value > data type. I used numeric(10,4) because that's what your original post > specified, but the billed_duration column in your most recent post looks like > it might be

Re: [SQL] Crosstab Confusion

2010-02-01 Thread Adam Sherman
On 2010-02-01, at 11:34 , Lee Hachadoorian wrote: > You basically have three parts: > > 1) SELECT query in the form (row header, column header, cell value). In this > case it is an aggregate query so that you can sum the transactions over a > given day. > > 2) List of column headers. If you wa

[SQL] Crosstab Confusion

2010-02-01 Thread Adam Sherman
I'm really trying to understand how the tablefunc crosstab function works, to no avail. I have a table that looks like this: customer_id integer date timestamp with time zone amount numeric(10,4) There are rows in this table every-time a customer gets charged an amount, which is multiple times

Re: [SQL] short-cutting if sum()>constant

2009-12-22 Thread Adam Tauno Williams
On Tue, 2009-12-22 at 13:35 +0100, Ivan Sergio Borgonovo wrote: > Hi, > I'd like to know if > select sum(qty) from t where status=37; > is > constant. > qty is always >0. > Is there a way to skip examining further rows and return a result > ASAP? SELECT SUM(object_version) FROM date_x WHERE owner_

Re: [SQL] Comparing two tables of different database

2009-04-29 Thread Adam Ruth
The simple answer is to pg_dump both tables and compare the output with diff. Other than that, I think you'll need a custom program. On 29/04/2009, at 10:33 PM, Pawel Socha wrote: 2009/4/29 Nicholas I : Hi, can anybody me suggest me, how to compare two tables of different database. -Nic

[SQL]

2009-04-23 Thread Adam Ruth
-- 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] Converting from MS Access field aliases

2007-07-12 Thread Adam Tauno Williams
On Thu, 2007-07-12 at 13:23 -0400, Tom Lane wrote: > chester c young <[EMAIL PROTECTED]> writes: > >> SELECT field1 / 2 AS foo, > >> field2 * 2 AS bar, > >> foo + bar AS total > >> WHERE foo < 12; > > First, I think it would be great if this worked - like the alias to an > > update table added in 8

Re: [SQL] Informix Schema -> PostgreSQL ?

2007-07-03 Thread Adam Tauno Williams
ace: -- CREATE UNIQUE INDEX unique_enterprise_login ON enterprise USING btree ("login"); The "--" lines just eats up screen real estate. -- Adam Tauno Williams, Network & Systems Administrator Consultant - http://www.whitemiceconsulting.com Developer - h

Re: [SQL] Informix Schema -> PostgreSQL ?

2007-07-03 Thread Adam Tauno Williams
ot;dbschema -d {database}" pg_dump -U OGo --schema-only OGo -- Adam Tauno Williams, Network & Systems Administrator Consultant - http://www.whitemiceconsulting.com Developer - http://www.opengroupware.org ---(end of broadcast)--

Re: [SQL] We all are looped on Internet: request + transport = invariant

2007-04-26 Thread Adam Tauno Williams
innovative, when they are properly motivated. > >others may require the assistance of a > J> technical specialist or a full-time programming team, but what's wrong > J> with that? > expenses of money, time, nerve to explain task to other man --

[SQL] Btrieve to PostgreSQL

2006-02-17 Thread Adam Alkins
any commercial solutions to do this really doesn't apply. Regards, -- Adam Alkins http://www.rasadam.com ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] ORDER BY does not work as expected with multiple joins

2006-01-13 Thread Adam Rosi-Kessel
age to using a left JOIN where it is not necessary? Adam signature.asc Description: OpenPGP digital signature

Re: [SQL] ORDER BY does not work as expected with multiple joins

2006-01-13 Thread Adam Rosi-Kessel
Tom Lane wrote: > Adam Rosi-Kessel <[EMAIL PROTECTED]> writes: >> I have a multijoin SELECT statement where the ORDER BY clause doesn't >> seem to be working. > You haven't mentioned your Postgres version, nor provided anywhere near > enough information to l

[SQL] ORDER BY does not work as expected with multiple joins

2006-01-13 Thread Adam Rosi-Kessel
I posted this message once through the Google Groups interface to pgsql.sql, but I've received no replies and the message doesn't appear at all in the MHonArc archives at postgresql.org, so I'm not sure it actually was distributed to this list. Apologies if this is a duplicate: I have a multijoin

Re: [SQL] pgdump by schema?

2005-02-02 Thread Adam Witney
From: pg_dump --help -n, --schema=SCHEMA dump the named schema only > Is there a way to dump everything in a particular schema? > > > Bradley Miller > NUVIO CORPORATION > Phone: 816-444-4422 ext. 6757 > Fax: 913-498-1810 > http://www.nuvio.com > [EMAIL PROTECTED] -- This message has

Re: [SQL] update from multiple rows

2005-01-23 Thread adam etienne
te little update of this table... (BI would like to apply a trigger only for little update but i don't know how (Bto proceed.. Maybe with a condition into the trigger.. But it's adding (Bcomputation time... (B (BThanks again, (BEtienne Adam (B (B (B (B> > I have some trou

[SQL] update from multiple rows

2005-01-22 Thread adam etienne
(Bbut it was obviously too much slow... (B (BIs there a more efficient way to achieve this ? (BThanks in advance.. This could help me very much.. (B (BEtienne Adam (B (B_ $BL5NA%a!<%k$J$i$d$C$Q$j(B $B!V(BMSN

[SQL] Possible rounding error of large float values?

2004-08-24 Thread Adam Lancaster
still possible to find the row using the original value select * from where = 9223372036854775807 Is this expected behavior? Thanks, Adam

[SQL] Subqueries returning more than one value?

2004-05-10 Thread Adam Witney
gives the error: ERROR: subquery must return only one column Is there any way around this? Thanks for any help adam -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ---(end of broadcast

Re: [SQL] double left outer join on the same table

2004-05-02 Thread Adam Witney
On 2/5/04 5:23 pm, "T E Schmitz" <[EMAIL PROTECTED]> wrote: > Hello, > > I have two tables SECTION and BRAND. SECTION is related to BRAND via two > foreign keys. I would like to select ALL SECTIONs whether the FKs are > null or not and fetch the BRAND attributes in one SQL statement. In > other w

Re: [SQL] perfomance question

2004-03-18 Thread Adam Ruth
27;, f2 will have a second copy with the same value in the new row that is created as part of the update. It's all part of the MVCC architecture. There may be some uncommon exceptions to this rule, but I'm not sure. Adam Ruth ---(end of broadcast)---

Re: [SQL] sort by on two columns

2004-01-02 Thread Adam Ruth
Sounds like you may want to concatenate the columns: ... order by table1.name || table2.name The sorting would then be performed on both of the them as though they were one column. Adam Ruth On Jan 2, 2004, at 8:04 PM, Michael Glaesemann wrote: On Jan 2, 2004, at 8:55 PM, Andy Lewis wrote

Re: [SQL] postgreSQL editors

2003-12-31 Thread Adam Ruth
I didn't notice an OS X version on their website. Do they have one? On Dec 31, 2003, at 12:57 PM, Andy Lewis wrote: I would have to agree with EMS-HiTech's product also. A feature rich, product, very responsive tech support/bug report. PGManager beats the competition hands down. Andy -Origi

Re: [SQL] postgreSQL editors

2003-12-30 Thread Adam Ruth
I currently use XCode from Apple (their free development environment). I create sql scripts which I then either execute directly in psql or copy and paste into an open psql session for small changes. On Dec 30, 2003, at 9:05 AM, beyaRecords - The home Urban music wrote: Hi, can anyone recommen

Re: [SQL] how to create a multi columns return function ?

2003-10-21 Thread Adam Witney
Take a look at the section on 'SQL Functions Returning Sets' http://www.postgresql.org/docs/7.3/static/xfunc-sql.html#AEN31304 > Hi > > I'm moving databases from sybase to postgres. > But I have difficulties in creating a postgres equivalent to the sybase stored > procedures... > > Appare

[SQL] Crosstab question

2003-10-20 Thread Adam Witney
NA (MWG1B1) |49.0 | 282.0 |49.0 | 282.0 The missing values seemed to have been ignored and so the data is being shifted to the left and so put in the wrong columns. Am I using this function correctly? What is supposed to happen with missing values? Thanks for any

[SQL] query or design question

2003-10-20 Thread Adam Witney
I may need to generate the output for more than two bioassay_ids. Also I may need to do an outer join to make sure I get all rows from both data sets? I am not sure if a crosstab function will do this? Any ideas of pointers would be greatly appreciated Thanks Adam -- This message has been

Re: [SQL] weird(to me) request

2003-09-25 Thread Adam Wieckowski
Użytkownik Larry Rosenman napisał: I have the following rows (in addition to others): acct_num text, master_acct_num text, These are in the same table. What I want to enforce is that if the master_acct_num field is NOT NULL (it can be NULL, and that's fine), that the value appears in some row a

Re: [SQL] Is it possible to connect to another database

2003-07-17 Thread Adam Witney
Take a look at dblink in the contrib directory... This may do what you need adam > Hi, > > I try to find how is it possible to connect 2 databases, with a symbolic > link. > > I have to use tables in another database to test user or other inform

Re: [SQL] Inherancing

2003-01-07 Thread Adam Witney
ting the insert and just doing insert into centers values (1, 'Lajeado', 'AZ'); Then select * from cities will give you 1 Lajedo And select * from centers will give 1 Lajedo AZ Is this what you want? adam > In this case, when i do > select * fr

Re: [SQL] Inherancing

2003-01-07 Thread Adam Witney
tuple > insert into cities values (1, 'Lajeado'); > > How i do if i want to make this city as a center ? If I understand you correctly you probably want to do this instead... insert into centers values (1, 'Lajeado', 'AZ'); Where AZ is your state HTH a

Re: [SQL] SQL list table names

2003-01-07 Thread Adam Witney
If you start psql like so psql -E Then all the SQL behind the \d type commands is displayed for you. adam > is it possible to execute an sql query to be able to list the tables's > names? > well, you can do it on psql using \dt. but im talking about the SQL > statement,

Re: [SQL] Creating Stored Procedures

2002-10-30 Thread Adam Witney
> I installed 7.3beta3 but how do I do it now? > How do I make a function that returns a dataset > > Greets > Zertox He is an email I received from Joe Conway on the subject a month or so ago > Adam Witney wrote: >> There have been a few emails recently concerning us

[SQL] Complex SQL query and performance strategy

2002-10-09 Thread Adam Witney
advice adam -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Rules and Triggers

2002-09-10 Thread Adam Erickson
Correct me if I'm wrong, but rules constrain the SQL (ie. validation). Triggers are carried out after the SQL is executed and the data is modified. So, to answer your question, I think rules come first. As to which order the rules / triggers are executed probably depends on the order you put them

Re: [SQL] retrieving all rows from a "tree" in one select - how ?

2002-08-09 Thread Adam Erickson
allows regexes in the where clause (ie. rlike in mysql) but with that you can "find all nodes 3 or more leaves down from node 123" or even weirder stuff. We have trees with 60,000 nodes 30-40 levels deep. Queries on the tree take very little time at all. Adam Erickson -

[SQL] oid and triggers

2001-05-16 Thread Adam Doligalski
Hi everybody! Is there any possibility to access oid's in trigger routines? I suppose that it makes no sense while 'before insert' routines but it would be very usable while treating oid's as rows identifiers. Thanks, Adam

[SQL] Cannot build PL/Perl ...

2001-05-02 Thread Adam Walczykiewicz
Cannot build PL/Perl because libperl is not a shared library. I'v got this error when I tried to compile PL/Perl. I have SuSE Linux 7.0 , have I get a libperl.so library , and put it in /usr /lib ... Thanks for any help Adam -- ---(end of broa

[SQL] PL/Perl documentation ...

2001-05-02 Thread Adam Walczykiewicz
Is there available some more examples of writing functions in PL/Perl ? In standard documentation there is only just 2 examples. Thanks in advance for any help. Adam -- ---(end of broadcast)--- TIP 2: you can get off all lists at once with

Re: [SQL] Copy To - fixed width

2000-08-23 Thread Adam Lang
Sort of nevermind, can I can save it tab delimited, but I am still curious if it can be done using fixed width fields. Adam Lang Systems Engineer Rutgers Casualty Insurance Company - Original Message - From: "Adam Lang" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> S

[SQL] Copy To - fixed width

2000-08-23 Thread Adam Lang
Is it possible to copy from a text file that has the fields as fixed width with no delimiter to a table? The other option is a CSV file... but then how do I handle if there is a comma in one of the fields? I'm transfering information from an AS/400 ... if it is into a text file, it is fixed widt

Re: [SQL] Creating sequences

2000-08-21 Thread Adam Lang
u can set the initial value to alphanumeric and it will increment from there. Adam Lang Systems Engineer Rutgers Casualty Insurance Company - Original Message - From: "Gannon, Terry" <[EMAIL PROTECTED]> To: "'Adam Lang'" <[EMAIL PROTECTED]> Sent: Friday

[SQL] Creating sequences

2000-08-18 Thread Adam Lang
Is it possible to have a sequence (or something like it) when it increments alpha-numeric? Say the first value is set at A01 and it will increment to A02, A03 by default. Also, it would be good if it could be made the primary key. Adam Lang Systems Engineer Rutgers Casualty Insurance Company

Re: [SQL] copy from

2000-08-15 Thread Adam Lang
Gotcha. Now, if I do an insert and just don't specify that field at all, it will, use the default value, correct? As long as I don't "touch" the field with anything it uses the default. Adam Lang Systems Engineer Rutgers Casualty Insurance Company - Original Message

Re: [SQL] copy from

2000-08-15 Thread Adam Lang
Hmmm... well, I don't think I have an "explicit" nextval. I created the table and then I did a create sequence broker_id; Are you implying that I can set the field to automatically create a nextval? Adam Lang Systems Engineer Rutgers Casualty Insurance Company - Original Mes

Re: [SQL] 8K Limit, whats the best strategy?

2000-08-15 Thread Adam Lang
I believe you are correct. Version 7.1 will supposedly eliminate the row size. Adam Lang Systems Engineer Rutgers Casualty Insurance Company - Original Message - From: "Thomas Swan" <[EMAIL PROTECTED]> To: "Keith Wong" <[EMAIL PROTECTED]>; <[EMAIL P

Re: [SQL] copy from

2000-08-15 Thread Adam Lang
I get it. I upload to the temp table, then for the select/insert I just do the nextval(seq_id) for the primary key field, correct? Adam Lang Systems Engineer Rutgers Casualty Insurance Company - Original Message - From: "Stephan Szabo" <[EMAIL PROTECTED]> To: &qu

[SQL] copy from

2000-08-14 Thread Adam Lang
copy from and assign the correct id number? Adam Lang Systems Engineer Rutgers Casualty Insurance Company

[SQL] SQL-92 SQLSTATE in PostgreSQL ?!

2000-07-11 Thread Adam Walczykiewicz
  Adam

[SQL] SPI documantation

2000-07-03 Thread Adam Walczykiewicz
Where can I get more information about programming  in SPI. (more than in PostgreSQL documentation). Thanks for any help Adam

[SQL] pg_recvbuf : unexpected EOF on client

2000-06-02 Thread Adam Walczykiewicz
I have an application in Java I use to insert records into postgreSQL base. Java shows no errors, butrecords can't write into base.In pgsqrever.log I found entry :pg_recvbuf : unexpected EOF on client connection.   Thanks for any help. Adam

[SQL] textpos() in postgreSQL 7.0

2000-05-31 Thread Adam Walczykiewicz
Thanks for any help. Adam