I have some oracle calls that I am porting. Today I came across this code which looks like "procedural" language, but is not declared in a function or anything... My question is: Can postgres handle this in this form? What form does this need to be in?
DECLARE
BEGIN
IF :start_time IS NULL OR
:start_date IS NULL OR
:end...
Hi there,
I feel like this is quite delicate,
I have various folders whith projects I would like to backup into a zip/tar file, but would like to avoid backing up files such as pyc files and temporary files.
I also have a Postgres db I need to backup.
Any tips for running this operation as a python script?
Also, would there be an...
Ok I'm quite new at logins what not so bare with me here lol but I gota learn so don't discourage me.
I tried this so far
<?php
$error = "";
$conn = pg_connect("host=localhost dbname=brittains_db user=brittains password=XXXX" );
$sql = "SELECT * FROM logins";
$result = pg_query($conn, $sql);
if($_SERVER["REQUEST_METHOD"] == "GET...
I am writing a sql query which involves finding if timestamp falls in particular range of days.
I have written that in the postgres but it doesn't works in Oracle and SQL Server:
AND creation_date < (CURRENT_TIMESTAMP - interval '5 days')
AND creation_date >= (CURRENT_TIMESTAMP - interval '15 days')
Is there are common way to compar...
whats the best way to synchronize few tables of mysql server with postgreSQL server,
currently people are executing scripts, which takes much time, is there any fast solution available from which we can map the tables and columns to synchronize the db server.
...
Hi
I have an integer column and I want to find numbers that start with specific digits.
For example they do match if I look for '123':
1234567
123456
1234
They do not match:
23456
112345
0123445
Is the only way to handle the task by converting the Integers into Strings before doing string comparison?
Also I am using Postgre rege...
I'm trying to figure out how to define the schema of a database on with Postgresql 8.
I have 2 tables:
Journals, Books
that define the publications I have
Journal:
id_j, name, issn, other fields
Book:
id_b, name, isbn, author, other fields
and I have another table Scans that logically refers both the previous tables.
Scans:
id, m...
I have this function:
CREATE OR REPLACE FUNCTION CREATE_AIRSPACE_AVAILABILITY_RECORD
(cur_user VARCHAR, start_time VARCHAR, start_date VARCHAR, end_time VARCHAR, end_date VARCHAR, airspace_name VARCHAR)
RETURNS VOID AS '
DECLARE
c_user ALIAS for $1;
BEGIN
IF start_time IS NULL OR
start_date IS NULL OR
end_time IS N...
Hi,
the players:
64bit linux with
php 5 (ZendFramework 1.10.2)
PostgreSQL 8.3
Doctrine 1.2
Via a Flash/Flex client i get an 8byte integer value.
the field in the database is an BIGINT (8 byte)
PHP_INT_SIZE show that system supports 8byte integer.
printing out the value in the code as it is and as intval() leads to this...
Hi everyone,
I know we cannot access directly to a database with Silverlight. Linq 2 SQL doesn't exist for Silverlight but can I use other things ? I heard too about RIA Services and ADO.net but I don't think they are implemented for a Linux Server.
Thanks for your future answers.
...
Below is the batch file I am kicking off at the end of an installer to properly configure my postgres database, however there comes an issue wherein the service is unable to be started.
This is what the service parameters look like:
C:\Program Files\pgsql\bin/pg_ctl.exe runservice -N "MyPostGres" -D "C:/Program Files/pgsql/PGDATA"
...
Looking for a simple SQL (PostgreSQL) regular expression or similar solution (maybe soundex) that will allow a flexible search. So that dashes, spaces and such are omitted during the search. As part of the search and only the raw characters are searched in the table.:
Currently using:
SELECT * FROM Productions WHERE part_no ~* '%sear...
Hello,
Following a question posted here about how I can increase the speed on one of my SQL Search methods, I was advised to update my table to make use of Full Text Search. This is what I have now done, using Gist indexes to make searching faster. On some of the "plain" queries I have noticed a marked increase which I am very happy abo...
Hi,
how can I make a range in a select in PostgreSQL ? I'd like to have this return:
num
---
1
2
3
4
5
6
In a query like:
SELECT range(1,6) AS num;
...
I have this model in django:
class JournalsGeneral(models.Model):
jid = models.AutoField(primary_key=True)
code = models.CharField("Code", max_length=50)
name = models.CharField("Name", max_length=2000)
url = models.URLField("Journal Web Site", max_length=2000, blank=True)
online = models.BooleanField("Online?")
...
I'm the process of moving applications over from all in the public schema to each having their own schema. for each application, I have a small script that will create the schema and then create the tables,functions,etc... to that schema. Is there anyway to automatically add a newly created schema to the search_path? Currently, the on...
Granted... this is a dumb question, but it's still a mystery to someone like me, whose never done it before... I'm trying to install pgloader, but I can't seem to find any documentation.... I'm running MAMP on MAC OS X. I've already installed the tcllib, and am about to do:
wget http://pgfoundry.org/frs/download.php/233/pgloader-1.0....
Given a table containing dotted quad IPv4 addresses stored as a VARCHAR(15), for example:
ipv4
--------------
172.16.1.100
172.16.50.5
172.30.29.28
what's a convenient way to SELECT all "ipv4" fields with the final two octets scrubbed, so that the above would become:
ipv4
------------
172.16.x.y
172.16.x.y
172.30.x.y
...
Is there a way to keep 2 sequences synchronized in Postgres?
I mean if I have:
table_A_id_seq = 1
table_B_id_seq = 1
if I execute SELECT nextval('table_A_id_seq'::regclass)
I want that table_B_id_seq takes the same value of table_A_id_seq
and obviously it must be the same on the other side.
I need 2 different sequences because I ...
I'm really struggling trying to figure this out... Really, really hope someone here can dumb this down for me... Another related question was pretty much answered, and I felt bad about keeping it open...
Basically, I have PostGreSQL installed. I just installed Darwin ports and the Pgtcl package or library or whatever you call it, acc...