I recently switched my database from MySQL to PostGres. I also use GeoKit. When I started my app up with the new database already seeded, I get the following error:
PGError: ERROR: function radians(character varying) does not exist
LINE 1: ...COS(0.661045389762993)*COS(-2.12957994527573)*COS(RADIANS(ti...
...
I have customer and address tables.
query:
select * from addresses a, customers b where a.id = b.id
returns 474 records
For these records, I'd like to add the id of customer table into cid of address table.
Example:
If for the first record the id of customer is 9 and id of address is also 9 then i'd like to insert 9 into cid colu...
I need to restrict a specific unix user so that it can login with only a few select postgres usernames (with password prompt), but allowing every other user to use whatever pg username they want.
Assuming restrUnixUser is the unix user name and restrUser is one of the postgres users it may use, and AllowedDB is the only database they sh...
Hi,
I want my unit tests suite to load a SQL file in my database. I use a command like
"C:\Program Files\PostgreSQL\8.3\bin"\psql --host 127.0.0.1 --dbname unitTests --file C:\ZendStd\www\voo4\trunk\resources\sql\base_test_projectx.pg.sql --username postgres 2>&1
It run fine in command line, but need me to have a pgpass.conf Since ...
I'm trying to use PostgreSQL as the database for Hibernate/JPA. However, I get an error when executing a simple query. My query is as follows:
SELECT DISTINCT p FROM UserProfile p ORDER BY :order
When I execute the query, I'll pass in a value like "lastLoginDate" for :order. However, I get the following exception when trying to exe...
In order to save time moving data I pickled some models and dumped them to file. I then reloaded them into another database using the same exact model. The save worked fine and the objects kept their old id which is what I wanted. However, when saving new objects I run into nextval errors.
Not being very adept with postgres, I'm no...
I'm using a JMS queue to read from and insert data into a postgres table created by grails. The problem is obtaining the next sequence value. I thought I had found the solution with the following statement (by putting "DEFAULT" where the ID should go), but it's no longer working. I must have changed something, because I needed to recreat...
I'm trying to implement some basic entities using Hibernate/JPA. Initially the code was deployed on MySQL and was working fine. Now, I'm porting it over to use PostgreSQL. In MySQL, my entity class defines its primary key as an auto-incrementing long value with the following syntax:
@Id
@GeneratedValue(strategy = GenerationTy...
I recently installed postgresql using homebrew.
When trying to use the 'pg' or 'postgresql' gem irb just hangs.
Any ideas?
...
Id like to find out ( and delete ) all the databases owned by an owner in postgres 8.4.3 I'm new to postgres also, and although I can , and will , read the whole manual today i was forced to use
for i in $(psql -l |grep novicedba | awk '{print $1}')
psql -d postgres -c " drop database \"$i\""
out of desperation. What's the po...
I have a code below:
<?php
require "institution.php"
/* in this portion, query for database connection is executed, and */
$institution= $_POST['institutionname'];
$sCampID = 'SELECT ins_id FROM institution where ins_name= '$institution' ';
$qcampID = pg_query($sCampID) or die("Error in query: $query." . pg_last_error($connection));...
I have a PostgreSQL backup made with PHPPgadmin using Export > Copy (instead Copy > SQL which is actually what I need).
File contains entries like this:
COPY tablename(id, field) FROM stdin;
...
How to convert this file to SQL format?
INSERT INTO tablename...
I want to use Pgadmin to to import this file using execute SQL command.
...
My table has three boolean fields: f1, f2, f3. If I do
SELECT * FROM table ORDER BY f1, f2, f3
the records will be sorted by these fields in the order false, true, null. I wish to order them with null in between true and false: the correct order should be true, null, false.
I am using PostgreSQL.
...
I regularly need to delete all the data from my postgresql database before a rebuild. How would I do this directly in SQL?
At the moment I've managed to come up with a SQL statement that returns all the commands I need to execute:
SELECT 'TRUNCATE TABLE ' || tablename || ';' FROM pg_tables WHERE tableowner='MYUSER';
but I cant see ...
Hello, All!
Is somebody have an experience using inheritance in PostgreSQL?
Is it worth to use it, or better to keep hands of :)?
In which situation you would use it?
To be true I'm a little bit in doubt about mixing relational and OO models...
...
A long time ago in a galaxy far, far away...
Trying to migrate a database from MySQL to PostgreSQL. All the documentation I have read covers, in great detail, how to migrate the structure. I have found very little documentation on migrating the data. The schema has 13 tables (which have been migrated successfully) and 9 GB of data.
MyS...
PostgreSQL has announced an Android app contest. I wanted to try out something but the only hosting I have does not provide PostgreSQL.
Do I have any economical (read cheap :D ) options? Is there a free hosting that anyone knows of?
Thanks in advance. --AJ
...
I need to create a trigger in SQL Server.
Trigger works:
If I found new line where T = 'A'; then add this line to PostgreSQL table.
Is it possible to create it, without software?
(I know how to create trigger, but how to create connection between two servers?
...
On Pavel's page is the following function:
CREATE OR REPLACE FUNCTION makedate(year int, dayofyear int)
RETURNS date AS $$
SELECT (date '0001-01-01' + ($1 - 1) * interval '1 year' + ($2 - 1) * interval '1 day'):: date
$$ LANGUAGE sql;
I have the following code:
makedate(y.year,1)
What is the fastest way in PostgreSQL to create a da...
I am using jdbc to connect to a postgresql database in a java application (actually the app is written in Groovy). I have postgresql set up to use the 'trust' authentication method. Is it possible to open a jdbc connection without specifying a password? When I try to use the normal constructor with a blank password, it fails with
Ex...