Re: [SQL] Unique index VS unique constraint

2013-10-04 Thread Adrian Klaver
of it is, that since the SQL standard does not mention indices an INDEX (UNIQUE or otherwise) is just the databases application of a constraint. So for practical purposes they are the same thing. Respectfully, Jorge Maldonado -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list

Re: [SQL] Unique index VS unique constraint

2013-10-04 Thread Adrian Klaver
: in an unique constraint you can allow NULL values and ignore them. A primary key does not allow this. Respectfully, Jorge Maldonado Regards, Luca. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] openclinica

2013-09-30 Thread Adrian Klaver
On 09/30/2013 04:20 PM, hugh holston wrote: I cant understand why I am not able to access and open my openclinica webpage, . So what do I do. My guess is you will get a answer sooner here: https://community.openclinica.com/forums/users-email-forum -- Adrian Klaver adrian.kla...@gmail.com

Re: [SQL] table constraint on two columns

2013-07-22 Thread Adrian Klaver
columns... -- Adrian Klaver adrian.kla...@gmail.com -- 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] transaction isolationa level - SERIALIZABLE

2013-05-13 Thread Adrian Klaver
or the configuration file, and in turn are overridden by per-user settings; both are overridden by per-session settings. regards mk -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] Postgres trigger issue with update statement in it.

2013-04-04 Thread Adrian Klaver
in the function. Could be you wrote BEGIN; instead of BEGIN ... END; Thanks and Regards Kaleeswaran Velu -- Adrian Klaver adrian.kla...@gmail.com -- 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] Reading from file without superuser privilege

2013-03-21 Thread Adrian Klaver
Organitzatiu i Personal Edifici Vèrtex. Planta 3 Pl. Eusebi Güell, 6 08034 - Barcelona -- Adrian Klaver adrian.kla...@gmail.com -- 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] Creating a new database with a TEMPLATE did not work

2013-02-25 Thread Adrian Klaver
at Nabble.com. -- Adrian Klaver adrian.kla...@gmail.com -- 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] Problem with extract(epoch from interval ...

2013-01-23 Thread Adrian Klaver
it not be simpler: test= SELECT extract(epoch from b) from a; date_part --- 2592000 7776000 15552000 (3 rows) As the b field is already an interval. Regards Ian Barwick -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] returning the number of rows output by a copy command from a function

2013-01-16 Thread Adrian Klaver
it looks like you will need to parse the string for the count. Thanks in advance, James -- Adrian Klaver adrian.kla...@gmail.com -- 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] returning the number of rows output by a copy command from a function

2013-01-16 Thread Adrian Klaver
than from sql query in GET DIAGNOSTIC since the format and information in the string (when run outside of the function) are exactly the same. Execute strSQL into export_count; What is export_count DECLAREd as? -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql

Re: [SQL] returning the number of rows output by a copy command from a function

2013-01-16 Thread Adrian Klaver
On 01/16/2013 09:26 AM, James Sharrett wrote: Integer Well copy is returning a string, so try changing the type. You will have to parse that string for the count. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

Re: [SQL] How to generate drop cascade with pg_dump

2013-01-09 Thread Adrian Klaver
a partial dump or create your own script. Thanks a lot! Emi -- Adrian Klaver adrian.kla...@gmail.com -- 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] copy users/groups

2013-01-08 Thread Adrian Klaver
items. Edward W. Rouse -- Adrian Klaver adrian.kla...@gmail.com -- 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] Query execution based on a condition

2012-12-29 Thread Adrian Klaver
to be specific without more information. In a particular the condition/field being tested and values being tested for. Respectfully, Jorge Maldonado -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] Load UTF8@psql into latin1@mysql through JDBC

2012-12-12 Thread Adrian Klaver
-charsets.html All strings sent from the JDBC driver to the server are converted automatically from native Java Unicode form to the client character encoding, including all queries sent Thanks a lot! Emi -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] Load UTF8@psql into latin1@mysql through JDBC

2012-12-12 Thread Adrian Klaver
character cannot be auto-loaded. You might get an answer sooner at: https://groups.google.com/group/mybatis-user Thanks. -- Emi -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] pg_restore problem

2012-09-14 Thread Adrian Klaver
-- Adrian Klaver adrian.kla...@gmail.com -- 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] pg_restore problem

2012-09-13 Thread Adrian Klaver
? -- Rgds Kjell Inge Øygard Electronic Chart Centre www.ecc.no http://www.ecc.no -- Adrian Klaver adrian.kla...@gmail.com -- 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] must appear in GROUP by clause issue

2012-06-29 Thread Adrian Klaver
-- Adrian Klaver adrian.kla...@gmail.com -- 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] Insane behaviour in 8.3.3

2012-06-14 Thread Adrian Klaver
thing I could come up with is: SELECT id, currval('xadmin_xid_seq') from items_tmp WHERE id=1261319 ; Its grasping at straws, but I can not come up with a logical reason for the above. Achilleas Mantzios IT DEPT -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list

Re: [SQL] pg_dump: aborting because of server version mismatch

2012-05-11 Thread Adrian Klaver
in your script. *pg_dump: aborting because of server version mismatch* -e All database backups complete! -- Adrian Klaver adrian.kla...@gmail.com -- 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] Finding Max Value in a Row

2012-05-11 Thread Adrian Klaver
to ask is if it is declared CHAR was that done for a legitimate reason? One reason I can think of is to have leading 0s in a 'number'. Might want to double check that code downstream is not depending on CHAR behavior. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list

Re: [SQL] Change Ownership Recursively

2012-03-01 Thread Adrian Klaver
the request to change the specified database and all of it's tables, sequences, views, triggers to Lauren? See above. For future reference including the Postgres version would be helpful. This area ownership/grants/etc has undergone a lot of changes over the various versions. -- Adrian Klaver

Re: [SQL] Change Ownership Recursively

2012-03-01 Thread Adrian Klaver
was using 9.1 PostgreSQL. Oops, my mistake, I never got to the PS:( -- Adrian Klaver adrian.kla...@gmail.com -- 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] SQL View to PostgreSQL View

2012-02-27 Thread Adrian Klaver
: schema dbo does not exist SQL state: 3F000 Character: 761 Do you in fact have a schema dbo? If so can you access the schema and table using some other method, for instance using psql? -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] Problems with ODBC connections

2012-02-27 Thread Adrian Klaver
:)? A common reason for this is a firewall between the client and server that is preventing connection to the server port. Another reason is a pg_hba.conf that has not been configured to allow connections from the client. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list

Re: [SQL] on insert rule with default value

2012-02-22 Thread Adrian Klaver
. If you want all the gory details read through section 37, in particular 37.3 :) The above is why I use triggers now. It is a lot easier to follow the logic in a trigger than in a rule. -Ron- -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] pg_dump - 8.3 - schemas

2012-02-16 Thread Adrian Klaver
command line statement you are using? Are doing both dumps as the same user? Thanks Edward W. Rouse -- Adrian Klaver adrian.kla...@gmail.com -- 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] pg_dump - 8.3 - schemas

2012-02-16 Thread Adrian Klaver
in postgresql.conf. This can create the illusion that only one schema is available in a database. One way to check is to use the fully qualified name for a table you know to be in the reports schema. Ex: select * from reports.some_table; -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql

Re: [SQL] pg_dump - 8.3 - schemas

2012-02-16 Thread Adrian Klaver
reported? What do the Postgres logs show when you restore the data? Do a pg_restore -l against the dump file. This will list the contents of the dump. See if the schema and contents are there. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] type cast about int to bit

2012-02-06 Thread Adrian Klaver
. In the first case you are basically doing an int--char, for which there is a built in cast. In the second case you are doing int--varchar for which there is not a cast. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] type cast about int to bit

2012-02-06 Thread Adrian Klaver
1010 (1 row) test(5432)aklaver=SELECT 10::bit(4)::varbit(3); varbit 101 -- Adrian Klaver adrian.kla...@gmail.com -- 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] Display Length Between Var Varchar

2012-01-31 Thread Adrian Klaver
-character.html character varying(n), varchar(n)variable-length with limit character(n), char(n) fixed-length, blank padded -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Adrian Klaver
, afdate)::date AS asdate; Is there a way to use the integer only generate_series in 8.3 to generate dates by typecasting to/from integers? -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Adrian Klaver
On 01/19/2012 09:17 AM, Samuel Gendler wrote: On Thu, Jan 19, 2012 at 8:20 AM, Adrian Klaver adrian.kla...@gmail.com mailto:adrian.kla...@gmail.com wrote: On Thursday, January 19, 2012 7:59:27 am Gary Stainburn wrote: The following code works in 8.4 but not 8.3. Anyone know

Re: [SQL] UPDATE COMPATIBILITY

2012-01-17 Thread Adrian Klaver
= accounts.sales_id For completeness, you could also do: UPDATE accounts SET (contact_last_name,contact_first_name)= (s.last_name,s.first_name) FROM salesmen s WHERE s.id = accounts.sales_id Gets you a little closer to what you want:) -- Adrian Klaver adrian.kla...@gmail.com -- Sent

Re: [SQL] Unable To Modify Table

2012-01-12 Thread Adrian Klaver
. You need to make the change in the table 'orders'. This assumes the FK in 'orders' has ON UPDATE CASCADE enabled. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [SQL] compare table names

2012-01-09 Thread Adrian Klaver
and 1229 are all less than 1230. What happens if you do?: select tablename from pg_tables where tablename like 'tmp_staging%' and tablename 'tmp_staging1230' and tablename 'tmp_staging1228; Thanks. Tony -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list

Re: [SQL] compare table names

2012-01-09 Thread Adrian Klaver
- tmp_staging1229 Thanks. Tony -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [SQL] compare table names

2012-01-09 Thread Adrian Klaver
name_test where fld_1 'tmp_staging'|| to_char(current_date-interval '10 days','MMDD') and fld_1 'tmp_staging0131'; fld_1 - tmp_staging1229 Thanks. Tony -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] avoid the creating the type for setof

2011-12-30 Thread Adrian Klaver
for RETURNS TABLE return Johnf -- Adrian Klaver adrian.kla...@gmail.com -- 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] using a generated series in function

2011-12-17 Thread Adrian Klaver
. This is no longer allowed. As always everyone - thanks for your help! -- Adrian Klaver adrian.kla...@gmail.com -- 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] Column ... does not exist (view + union)

2011-12-17 Thread Adrian Klaver
; (ERROR: column relpages does not exist) I understand the error now (I think), and I know how to avoid it. SELECT relname FROM pg_class WHERE relhasindex UNION (SELECT relname FROM pg_class WHERE relhasoids ORDER BY relpages); thanks, stefan -- Adrian

Re: [SQL] using a generated series in function

2011-12-16 Thread Adrian Klaver
) as week_qty from (select ((date_trunc('week', '2011-11-20'::date )::date) + (i+6)) as week_date from generate_series(0,84,7) i ) as foo The above works! Johnf -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

Re: [SQL] FW: Hi

2011-09-10 Thread Adrian Klaver
are looking for psql not pgsql. Second it should be psql -U postgres ... Regards, Mandana -- Adrian Klaver adrian.kla...@gmail.com -- 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] bigint and unix time

2011-08-16 Thread Adrian Klaver
by 1,000,000 to make them seconds. Like: SELECT ticket, time/100, author, field, oldvalue, newvalue FROM ticket_change where time/100 BETWEEN extract(epoch from (date 'now' - integer '30')) AND extract(epoch from (date 'now')); Thanks, Janiv. -- Adrian Klaver

Re: [SQL] bigint and unix time

2011-08-15 Thread Adrian Klaver
(date 'now' - integer '30')) AND extract(epoch from (date 'now')); bint -- (0 rows) That being said, if your time values are the order of magnitude shown they will not meet the criteria above. Is the time value supposed to be seconds? Thanks, Janiv,. -- Adrian Klaver

Re: [SQL] bigint and unix time

2011-08-14 Thread Adrian Klaver
to contemporary time values. As you understand, I always get all records ... How do I solve it? Thanks, Janiv. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] pgadmin debugger

2011-08-14 Thread Adrian Klaver
On Sunday, August 14, 2011 10:15:43 am David Harel wrote: On Sat, 2011-08-13 at 12:56 -0700, Adrian Klaver wrote: On Saturday, August 13, 2011 12:39:44 pm David Harel wrote: Greetings, I use Ubuntu 10.04. I have postgresql version 8.4.8 installed also I have pgadmin version 1.10.2

Re: [SQL] pgadmin debugger

2011-08-13 Thread Adrian Klaver
/archives/214-Using-PgAdmin-PLPgSQL-De bugger.html Any idea? http://www.enterprisedb.com/docs/en/8.4/pgadmin/debugger.html -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [SQL] why these results?

2011-08-01 Thread Adrian Klaver
where col::text !~~* '%text%'; count --- 98 (1 row) Shouldn't it be 99? That is out of 100 records there is one that has text in column col so the !~~* should return 99 rows. ?? NULL value in field? -wes -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing

Re: [SQL] ERROR: malformed record literal: ,DETAIL: Missing left parenthesis?

2011-07-06 Thread Adrian Klaver
is being applied to the first parameter only. Emi EXECUTE test('', '1', '1', '1', '1', '1', '1', '1', '1', '', 1, 1, '1', '0', '0', '0', '0', '0', '0', '0', '0') ; Thank you, Emi -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] problem with update data sets from front ends 8.4, Ubuntu 10.04

2011-05-23 Thread Adrian Klaver
a full restore or selective? Any assistance offered will be appreciated. -- Adrian Klaver adrian.kla...@gmail.com

Re: [SQL] Get id of a tuple using exception

2011-04-14 Thread Adrian Klaver
of the triple already existing in the table? If the id is the PRIMARY KEY then it would be the same as the id you tried to INSERT correct? Thanks, Filipe -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] Get id of a tuple using exception

2011-04-14 Thread Adrian Klaver
original question I am not aware of a way of returning the id of the offending tuple, other than through a SELECT. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [SQL] is there a refactor

2011-04-05 Thread Adrian Klaver
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) -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] what's wrong in this procedure?

2011-02-25 Thread Adrian Klaver
'; the column is t.status and not Aguardando Pagto; what's wrong ? thanks Try single quotes, 'Aguardando Pagto' -- Adrian Klaver adrian.kla...@gmail.com -- 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] quotes etc

2011-02-22 Thread Adrian Klaver
://www.postgresql.org/docs/9.0/interactive/sql-syntax-lexical.html 4.1.2.4. Dollar-Quoted String Constants test(5432)aklaver=SELECT $$D' Andes$$; ?column? -- D' Andes -- Adrian Klaver adrian.kla...@gmail.com

Re: [SQL] Help needed in skipping column for copy command

2011-01-17 Thread Adrian Klaver
column ? as the data in file is unknown so it column name is which is missing is not known in advance. You can specify a column list to COPY. See here: http://www.postgresql.org/docs/9.0/interactive/sql-copy.html Thanks Amar -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql

Re: [SQL] explicit casts

2011-01-05 Thread Adrian Klaver
in the date_trunc(). To be sure we would need to see those functions. As a shot in the dark: select to_date(date_trunc('month',add_months( $1 ,1)::date)... -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] explicit casts

2011-01-05 Thread Adrian Klaver
A temporary solution can be found here: http://petereisentraut.blogspot.com/2008/03/readding-implicit-casts-in-postgresql.html An important tip from the blog- The gist was, only restore the casts you need, not all of them. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing

Re: [SQL] create role

2010-12-31 Thread Adrian Klaver
effects can be obtained by altering the default search path setting, either globally or per-user. -- Adrian Klaver adrian.kla...@gmail.com -- 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] create role

2010-12-31 Thread Adrian Klaver
names. What you can see or do with those objects is determined by the privileges on those objects. Those privileges come from either the role that created the object or are GRANT(ed) by a sufficiently privileged role to another role. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql

Re: [SQL] create function problem

2010-12-30 Thread Adrian Klaver
IF to ELSEIF should fix it. -- Adrian Klaver adrian.kla...@gmail.com -- 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] create role

2010-12-30 Thread Adrian Klaver
database. Whenever the role subsequently starts a new session, the specified value becomes the session default, overriding whatever setting is present in postgresql.conf or has been received from the postgres command line. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list

Re: [SQL] insert from a select

2010-11-24 Thread Adrian Klaver
inserted into the schedule column. Johnf -- Adrian Klaver adrian.kla...@gmail.com -- 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] Need help with plpgsql function.

2010-11-14 Thread Adrian Klaver
; ELSE RETURN QUERY SELECT 60,70 UNION ALL SELECT 80,90; END IF; RETURN; END; $$ LANGUAGE plpgsql; SELECT * FROM foo(1); SELECT * FROM foo(2); Regards Pavel Stehule FYI the OP is using 8.2 :) RETURN QUERY is 8.3+ -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql

Re: [SQL] psql -f COPY from STDIN

2010-11-12 Thread Adrian Klaver
in advance. -- Adrian Klaver adrian.kla...@gmail.com -- 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] COPY command and required file permissions

2010-06-25 Thread Adrian Klaver
the files to /tmp and performing the copy from there, unsuccesfuly. Any ideas would be appreciated. Thanks, -Harold Are you connecting to the database as a superuser to run the COPY command? -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] Round integer division

2010-06-25 Thread Adrian Klaver
. Is there something obvious that I'm I missing? Thanks, -- Lee Hachadoorian PhD Student, Geography Program in Earth Environmental Sciences CUNY Graduate Center See here for explanation: http://archives.postgresql.org/pgsql-general/2010-03/msg00969.php -- Adrian Klaver adrian.kla...@gmail.com

Re: [SQL] COPY command and required file permissions

2010-06-25 Thread Adrian Klaver
are different commands. COPY is done from the server's perspective, \copy from the clients. Hence the permission issues will be different. See below for more detail. http://www.postgresql.org/docs/8.4/interactive/sql-copy.html http://www.postgresql.org/docs/8.4/interactive/app-psql.html -- Adrian

Re: [SQL] sorry, now with subject... trigger nextval(seq)

2010-05-20 Thread Adrian Klaver
'plpgsql'; -- and how will the trigger looks like ??? You know serial is just a shortcut for: pid int NOT NULL DEFAULT nextval('seq') I think you will find Access will place nice if you use the long form to define your autoincrement. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql

Re: [SQL] Please delete my email

2010-03-15 Thread Adrian Klaver
coche que sin Messenger www.vivirmessenger.com To unsubscribe go here: http://www.postgresql.org/mailpref/pgsql-sql Thanks, -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [SQL] Remove my e-mail

2010-03-15 Thread Adrian Klaver
On 03/15/2010 10:24 AM, Daniel Guedes wrote: Hi!, I don't want to receive more emails from postgresql. Please remove my email from your delivery list. Thanks To unsubscribe go here: http://www.postgresql.org/mailpref/pgsql-sql Thanks, -- Adrian Klaver adrian.kla...@gmail.com -- Sent via

Re: [SQL] plpgsql loop question

2010-02-10 Thread Adrian Klaver
does not deal well with a variable having the same name as a schema object, in this case your table zones. -- Adrian Klaver adrian.kla...@gmail.com -- 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] Schema's, roles and privileges

2009-11-30 Thread Adrian Klaver
contrib directories. Uninstall the modules. Rerun make and then reinstall. From here: http://www.postgresql.org/docs/8.4/interactive/ddl-schemas.html There is nothing special about the public schema except that it exists by default. It can be dropped, too. -- Adrian Klaver akla...@comcast.net

Re: [SQL] Sqldf - error message

2009-11-20 Thread Adrian Klaver
                       regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Adrian Klaver akla...@comcast.net -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] How to order varchar data by word

2009-10-20 Thread Adrian Klaver
a couple of pointers to this subject. Again, thank you Best, Oliveiros A good place to start is: http://www.postgresql.org/docs/8.4/interactive/locale.html Check out the Further Reading section at: http://www.postgresql.org/docs/8.4/interactive/multibyte.html#AEN30078 -- Adrian Klaver akla

Re: [SQL] How to order varchar data by word

2009-10-14 Thread Adrian Klaver
, Oliveiros Can you show the SQL you are using? -- Adrian Klaver akla...@comcast.net -- 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] Rules, functions and RETURNING

2009-09-17 Thread Adrian Klaver
. If that is the case why not create an INSERT function/trigger that does the 'something' and then just do: INSERT INTO mytable (something) VALUES ('some text') RETURNING mytable_id; -- Adrian Klaver akla...@comcast.net -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] mail alert

2009-08-13 Thread Adrian Klaver
. As it stands now you have a lot of moving parts to keep track of via external processes. It is possible but you lose transactional support and trust me that turns into a royal pain. -- Adrian Klaver akla...@comcast.net -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make

Re: [SQL] Bit by commands ignored until end of transaction block again

2009-07-23 Thread Adrian Klaver
and Database-level autocommit. -- Adrian Klaver akla...@comcast.net -- 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] Need help combining 2 tables together

2009-05-22 Thread Adrian Klaver
circles, they : remind me of pizza -- Adrian Klaver akla...@comcast.net -- 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-03 Thread Adrian Klaver
On Thursday 02 April 2009 6:16:44 pm Adrian Klaver wrote: Now I remember. Its something that trips me up, the RECORD in RETURN setof RECORD is not the same thing as the RECORD in DECLARE RECORD. See below for a better explanation- http://www.postgresql.org/docs/8.3/interactive/plpgsql

Re: [SQL] FUNCTION problem

2009-04-03 Thread Adrian Klaver
On Friday 03 April 2009 6:51:05 am Adrian Klaver wrote: On Thursday 02 April 2009 6:16:44 pm Adrian Klaver wrote: Now I remember. Its something that trips me up, the RECORD in RETURN setof RECORD is not the same thing as the RECORD in DECLARE RECORD. See below for a better explanation

Re: [SQL] FUNCTION problem

2009-04-02 Thread Adrian Klaver
- Peter Willis pet...@borstad.com wrote: 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

Re: [SQL] FUNCTION problem

2009-04-02 Thread Adrian Klaver
On Thursday 02 April 2009 4:22:06 pm Peter Willis wrote: Adrian Klaver wrote: Did you happen to catch this: Note that functions using RETURN NEXT or RETURN QUERY must be called as a table source in a FROM clause Try: select * from test_function(1) I did miss that, but using

Re: [SQL] FUNCTION problem

2009-04-01 Thread Adrian Klaver
-control-structures.html#PLPGSQL-CONTROL-STRUCTURES-LOOPS -- Adrian Klaver akla...@comcast.net -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Fwd: Re: [SQL] Creating a function with single quotes

2009-02-20 Thread Adrian Klaver
Memo to self: Remember hit reply all. -- Forwarded Message -- Subject: Re: [SQL] Creating a function with single quotes Date: Friday 20 February 2009 From: Adrian Klaver akla...@comcast.net To: Leif B. Kristensen l...@solumslekt.org On Friday 20 February 2009 6:13:03 am you

Re: [SQL] How to excute dynamically a generated SQL command?

2009-01-04 Thread Adrian Klaver
''));'; EXECUTE sSQL; It raises the error as: ERROR: syntax error at end of input LINE 1: ...E'C:\\HM\\Data\\Flightmap.tif') ^ I would appreciate a lot if you offer your input. Thanks a lot. John -- Adrian Klaver akla

Re: [SQL] effectiveness tool

2008-10-14 Thread Adrian Klaver
in advanced!! Take a look at: http://www.postgresql.org/docs/8.3/interactive/sql-explain.html and: http://www.postgresql.org/docs/8.3/interactive/using-explain.html -- Adrian Klaver [EMAIL PROTECTED] -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription

Re: [SQL] Problem with delete trigger: how to allow only triggers to delete a row?

2008-10-10 Thread Adrian Klaver
is returned then the operation proceeds with that row value Could you have the the trigger examine the row to see if it meets the criteria for deletion. If it does RETURN a NON NULL value so the trigger completes, otherwise RETURN NULL to prevent the DELETE. -- Adrian Klaver [EMAIL PROTECTED

Re: [SQL] Problem with delete trigger: how to allow only triggers to delete a row?

2008-10-10 Thread Adrian Klaver
$ LANGUAGE plpgsql; -- Adrian Klaver [EMAIL PROTECTED] -- 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] Problem with delete trigger: how to allow only triggers to delete a row?

2008-10-10 Thread Adrian Klaver
On Friday 10 October 2008 1:57:28 pm Adrian Klaver wrote: On Friday 10 October 2008 11:25:05 am Christopher Maier wrote: On Oct 10, 2008, at 2:05 PM, Alvaro Herrera wrote: Looks like you should revoke DELETE privilege from plain users, and have your delete trigger be a security definer

Re: [SQL] PL/pgSQL function syntax question?

2008-09-08 Thread Adrian Klaver
: loop variable of loop over rows must be record or row variable at or near loop SQL state: 42601 Character: 195 You need to DECLARE v_record as a RECORD variable. v_record RECORD; -- Adrian Klaver [EMAIL PROTECTED] ---BeginMessage--- i get the following error when i try and create the following

Re: [SQL] Problem inserting data

2008-06-20 Thread Adrian Klaver
hundred queryes Thank you very much Two options: 1) Change the column in Postgres to an integer type. 2) Change the assignment in pg_cast from explicit to implied for the int4,bool cast. See for more details: http://www.postgresql.org/docs/8.3/interactive/catalog-pg-cast.html -- Adrian

Re: [SQL] cross-database references are not implemented

2008-06-03 Thread Adrian Klaver
suspect you have an extra period in your table name. Instead of public.table_name you have something like public.table.name. -- Adrian Klaver [EMAIL PROTECTED] -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [SQL] Problem with now() in function pgsql

2008-04-05 Thread Adrian Klaver
not change, clock_timestamp() does. See URL below for a more complete explanation: http://www.postgresql.org/docs/8.2/interactive/functions-datetime.html -- Adrian Klaver [EMAIL PROTECTED] -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

FW: Re: [SQL] Question 2 Interval and timestamptz

2008-03-26 Thread Adrian Klaver
-- Forwarded Message: -- From: [EMAIL PROTECTED] (Adrian Klaver) To: Shawn [EMAIL PROTECTED] Subject: Re: [SQL] Question 2 Interval and timestamptz Date: Wed, 26 Mar 2008 16:24:39 + -- Original message -- From: Shawn [EMAIL

  1   2   >